Re: Postinstall script behaves differently than if launching fromTerminal
site_archiver@lists.apple.com Delivered-To: installer-dev@lists.apple.com Thank you so much Luke! Matt On Nov 3, 2008, at 11:44 AM, Luke Bellandi wrote: Hi Matt, "sudo -u $USER " Best, Luke On 11/2/08 6:24 AM, "Matt Brewer" <mbrewe12@utk.edu> wrote: I'm writing an installer for my company which also redistributes the Adobe AIR Runtime (licensing taken care of). There is a silent install option which should run this in the background and make it a seamless experience for the user. #!/bin/sh /Applications/Adobe\ AIR\ Installer.app/Contents/MacOS/Adobe\ AIR\ Installer -silent exit 0 This works just fine when launching from the Terminal. However, when used as a postinstall script, the Adobe installer complains that AIR isn't installed. Just wondering if anyone had any thoughts why it would behave differently. I also wrote an Installer plugin in Xcode, I take it that I can't launch a NSTask there, just wanted to clarify.... Matt _______________________________________________ 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/luke%40adobe.com This email sent to luke@adobe.com _______________________________________________ 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... Prepending 'sudo -u $USER' to the installation command executes perfectly. Exactly what I needed and I can't thank enough! You should be able to launch an NSTask in your installer plugin. Code is code, right? So why wouldn't you be able to? If your package requires root-user authentication, then your post- install script will run as root user. This confusion comes up a lot in working with preflight and other scripts in installer packages. To run it as the logged-in user (which is probably what you want and will fix this problem), prepend the following to your Adobe AIR install command line in your script: This email sent to site_archiver@lists.apple.com
participants (1)
-
Matt Brewer