We have an installer with a postflight script written in
KSH. It needs the installation destination.
Originally it was coded to use $2, as that is what the documentation says it
should be. However whenever the package being installed resides in a directory
with a space (or multiple spaces), or if the destination directory contains one
or more spaces, this gets fouled up. The arguments passed to the
postflight are not quoted, and so the postflight script gets more
arguments. E.G.
Package to install is located in:
/Space Dir/my_app.pkg
And I choose an installation directory of:
/Applications/My App
Then when postflight runs, it receives 6 arguments:
Arg1: /Space
Arg2: Dir/my_app.pkg
Arg3: /Applications/My
Arg4: App
Arg5: /
Arg6: /.
Now we can pick up the package path from $PACKAGE_PATH, but
there does not seem to be a clean way to get the Installation
directory. Our current workaround
is to mash all the arguments together and then try and parse
things out ourselves. This leaves us vulnerable to Apple changing
something.
Also we have a customer that was installing, and on his
system he did not receive 4 arguments as the documentation states, he only had
3 arguments:
Arg1: Path to install package
Arg2: Install directory
Arg3: /.
Does anyone have any idea why this would be? He was
not using any directories with spaces in it.
Thanks
Keith Hafen
Siemens