site_archiver@lists.apple.com Delivered-To: installer-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=4cOOurZyajU7GaA8WpkpwW1bhc5AdjPVt2/yWrqOows=; b=pIiI5FF4HLsMNWcFGvz5QdI/JCJwCGcdUByIjtB+/aYZjupOVGYxvkmfhy0L+O2Nmg x1hxMEQIg9gAIDRGaEaKvD0FtkMLWe/J0qi0XCi5blLj1RVjkIXOy1FT+nSnC9Bi6wvV eETwXufydtSSHK29MSzgYXeHfz2CIAg9gUoFo= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=kYfY0b0Eru1BCiIQKg5qi1VUsfECojT48kATcNDnRmNHEyXV3Frd7cLtA6gGoKAaK3 KpfZ4oiYDYqp9W5KixsRYCNBhetJMVSyFIPgHHdhmtLBojRa2joYMfIIDUh+VBtfctJf NVluEh5eF+MehEcrZI2E3FNZ+PrqaB5/37orM= Hello! I need to install my application to /Users/<current user name, who launched the installer>. I have searched the list, I know what i want to do is wrong, but i can't install my application for all users. The reason is that i have to create /Users/<username>/LaunchAgents/my.app.plist, and create it in user's home directory - because later my application will need to have privileges to delete this file, or to rewrite it, depending on if a user sets the checkbox "Launch app on startup". My application (like every other app from /Applications) is not launched with root privileges - user just "doubleclicks" it, therefore it can't modify the Launchd's *plist file in /Library/LaunchAgents/..., but it can do that to /Users/<username>/Library/LaunchAgents/... Thus i'm having an issue determining the user's home directory during installation. Of course, if there was a way to modify the "root's" .plist in /Library/LaunchAgents from an ordinary app, i wouldn't have needed all that "dancing around with a tembourine". What is the most reliable way to get that user directory in installation script? I was thinking to do it all this way: install the stuff to a temporary dir, and then copy it altogether to the /Users/<username> via PostInstall script. But the $User variable doesn't give the real username out, neither does $home. Looking for the answer I have found a command id -p that gives in one of its lines, together with the text "login", someone's username (in a second column). In my case, on my system this was the needed username - a name of a user, who had started the launching process, but i am not sure it will be that way on everybody else's mac. If it works for everybody else, i'd use grep | awk or something in a script, but i'm still afraid that it's not a reliable idea. Could you give me a hint, what is the best approach? Or, if there's no way out, how could my application modify (create, delete, overwrite) not user's, but "root's" plist (in /Library/LaunchAgents/my.app.plist)? Thanks! _______________________________________________ Do not post admin requests to the list. They will be ignored. Installer-dev mailing list (Installer-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/installer-dev/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com
participants (1)
-
eveningnick eveningnick