Re: An installer question
Re: An installer question
- Subject: Re: An installer question
- From: Peter Bierman <email@hidden>
- Date: Tue, 9 Aug 2005 12:42:03 -0700
On Aug 9, 2005, at 12:09 PM, Glenn Zelniker wrote:
Here's the scenario:
I have a .mpkg that's wrapped in a .dmg (this is part of the
workaround to prevent Windows from mucking up permissions). The
.mpkg does a big installation job and then runs a postflight
script. The postflight does the following:
1. Starts the app the got installed from the .mpkg (using 'open')
2. Creates a desktop icon (i.e., symbolic link) for the app (using 'ln')
3. Unmounts the .dmg containing the .mpkg (using 'hdiutil unmount -force)
4. Echoes a few lines of text to the log, just as a sanity check
5. Shuts down the installer app (via 'killall')
I'm having a problem with the postflight quitting before it gets
gone. It makes it up to step 3 above, but then I don't see any of my
sanity-check echoes and the installer app doesn't get killed. But
the installer does keep running -- it finishes the installation,
registers the app, writes receipts, etc.
Yikes! I'm surprised it's handling it as gracefully as that.
In step 3, you're pulling the rug out from under the installer. The
package is on the volume you just force-unmounted! The installer is
thinking "Hey! I'm still eating that!" as you're clearing the table.
The rest of the script doesn't execute, because the script is gone!
Step 5 is equally dangerous. Killing the installer could prevent it
from performing any number of necessary steps. You could easily end
up with a corrupted install or receipt.
There are two similar things you need to change here. Your cleanup
needs to happen after the installer has exited cleanly.
You need your script to start some sort of monitoring in the
background, and unmount the dmg only after the installer has quit.
You can try to get the installer to quit by using [osascript -e 'tell
application "Installer" to quit'], which will ask the installer to
quit as if the user hit cmd-Q, instead of forcing it to quit without
cleanup.
Alternately, reconsider whether you want this behavior at all. This
isn't the typical user experience for the Apple Installer.
-pmb
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Installer-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden