Re: Option to execute a command?
site_archiver@lists.apple.com Delivered-To: installer-dev@lists.apple.com Let us assume you are working from Per Olofsson's example.
Start by creating a folder named Scripts, and inside create two bash scripts:
preinstall:
#!/bin/bash
LAUNCHD=/Library/LaunchDaemons/edu.caltech.autonomy.foo.plist if [ -e "$LAUNCHD" ]; then launchctl unload -w "$LAUNCHD" fi
This unloads the launchd job defined in /Library/LaunchDaemons/edu.caltech.autonomy.foo.plist only if it already exists. This is useful for reinstalls and installs of new versions of your software. The file does not need to exist.
postinstall:
#!/bin/bash
launchctl load -w /Library/LaunchDaemons/edu.caltech.autonomy.foo.plist
Since this is a postinstall script, the payload has been installed, which presumably includes your launchd plist. This script simply tells launchd to load the plist. So I don't see why you need the plist file anywhere other than your package payload. -Greg On Mar 30, 2011, at 11:27 AM, Nathan Sims wrote:
On Mar 30, 2011, at 10:45 AM, Greg Neagle wrote:
On Mar 30, 2011, at 10:37 AM, Nathan Sims wrote:
How can I have PackageMaker place the $LAUNCHD plist into the LaunchAgents folder so that launchctl can run it?
By making it part of your package payload, just like any other file you'd like installed.
But doesn't the preinstall script get run before any files get moved?
_______________________________________________ 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)
-
Greg Neagle