Postflight script failing to execute from a package.
Postflight script failing to execute from a package.
- Subject: Postflight script failing to execute from a package.
- From: "Matt Fox-Wilson" <email@hidden>
- Date: Tue, 3 Oct 2006 19:04:00 +1300
I am having problem getting a 'postflight' script running from a package I
have created in PackageMaker. The package installs an application, and then
is supposed to launch that application from a postflight shell script I have
included. The problem is that the script doesn't seem to be called when the
installer is done.
I've found a fair number of different methods listed on various sites, so
I've tried a large number of combinations but essentially what I am doing
is:
1. Create a Shell Script using Xcode's New File dialog, selecting the Shell
Script option for file type.
2. Enter the following script inside that:
#!/bin/sh
echo $SCRIPT_NAME: Launching the app.
open -b com.mycompany.myapp
exit 0
'com.mycompany.myapp' is replaced with the ID for the application. That
script is almost word for word the sample script in the 'Software Delivery
Guide'
(http://developer.apple.com/documentation/DeveloperTools/Conceptual/Software
Distribution/SoftwareDeliveryGuide.pdf).
3. This file is saved as 'postflight.sh' (the extension being the one
applied by default by XCode). I am assuming this is a valid script type for
the package maker. The Software Delivery Guide doesn't actually appear to
tell you how to create the script, or where to find that info, it just gives
the sample code.
4. I construct my package using the Package Maker (version 2.1.1) 'Assist
Me' assistant. Given that my app runs on 10.3 as well as 10.4 I select the
'Support 10.3x and 10.2x' option. Notes I found on the package maker
(http://s.sudre.free.fr/Stuff/PackageMaker_Howto.html) imply that while some
scripts are not supported on 10.3, the postflight script should be.
5. After I have constructed my package using the assistant, and built it the
first time, I edit it and in the Scripts tab under 'Extras' I enter the
folder in which I stored the script.
6. I build the package again (Cmd-B from inside the package maker).
At this point, the .pkg's Contents/Resources folder contains postflight.sh
as I expected. When I run the package, the install of the product works
fine, but the application I wanted to trigger does not launch.
To test out the script, I ran Terminal and executed the file by navigating
to its folder and typing its name in to the prompt. It worked fine, running
the application. So the script appears to be valid, but I have no idea why
the package is not launching it.
Among (many) other things, I have tried:
- Creating the script as an applescript instead of the shell script, though
I didn't seem to be able to use 'open' and com.mycompany.myapp there.
- Using an external package such as ShellGUI to construct my script.
- Ensuring that the executable bit was set on the file using chmod (555 and
777) from Terminal.
- Removing the .sh extension in case it was a name issue.
None of those have helped so far. Does anyone have any idea what could be
stopping it running from my installer?
- Matt Fox-Wilson
- email@hidden
_______________________________________________
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