Question

I am using Mac 10.8 and latest version of Package Maker. My product destination path (Install Location) contains our Product version.

Eg. Test/1.1.0.1/Sample.

We have planned to automate the process. We will increase the build number in each automation. So I need to change the Version number in destination path in every automation. I am using below command to make the Packages using Terminal.

PackageMaker –v –d Test.pmdoc –o TestSample.pkg

Is there any option to pass the version number from this argument? Shall we implement this using a preinstall script? Please provide same samples if any option from Preinstall Scripts, since I am new to shell scripts. Please help me to solve this issue.

Was it helpful?

Solution

Personally I found it much easier to do this:

  • copy the package folder from a common location (ie /project-redist-master)
  • modify package contents as desired (see below)
  • create package

If you need more personalization, for example the version number somewhere inside the package, I found it most convenient to simple search & replace strings. For example you could write ___PROJECTVERSION___ to any text or resource file (ie pmdoc) where the version number is used. Then, before creating the package, run a little tool (bash script, personally I prefer writing Cocoa command line tools) that searches and replaces such placeholder strings. That tool would also get the version string from somewhere, for example a version.h header or the changelist number from source control.

OTHER TIPS

PackageMaker always was buggy has hell, and got deprecated with Mac OS X 10.6 Snow Leopard.

I recommend to use pkgbuild together with productbuild.

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