Question

I have a Mac OS X flat package that runs a postinstall script. I would like to know in the script if it's a new install or an upgrade. Bundle-style packages have pre and postupgrade scripts but I can't use a bundle package.

I've dumped out the environment variables in the script and I've dumped the arguments to the script itself and none of these seem to indicate if it's an upgrade or install. I can tell that Installer knows because the Installer Log indicates install or upgrade. I just don't know how to tell from the postinstall script.

Was it helpful?

Solution

If it's your package, why don't you check for signs that you're already on the machine? Either leave some marker that will tell you that you've already been installed or check if your old files are present on the disk before deployment?

OTHER TIPS

If your package is installed for the first time Installer will call postinstall script but if it is upgraded, it should call postupgrade script.

More information here in the What About script section.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top