While developing an install with PackageMaker (XCode 3.2.1 1613, for Snow Leopard), sometimes the permissions, owner, and group that I have set on most (if not all) of the files just vaporize. The result looks like I just added the files to PackageMaker, before setting the file perm/own/grp on each.
What's weird, is that most of those xml files in the .pmdoc folder change, even index.xml, forcing a big SVN issue when nothing has changed! When that happens, I just SVN Revert, then inspect everything (taking maybe 20 min) before building.
How can I avoid this? What might I be doing to trigger this (undesirable) behavior? I haven't been able to correlate my actions with the problem yet. Next time it happens and I have the slack time, I'll diff the .pmdoc/xml changes and see if I can find a pattern.
Meanwhile, if anyone out there has some tips, I's appreciate it.
I'm seeing the same thing when using .pmdoc projects generated using the PackageMaker GUI.
The files that make up the .pmdoc contain embedded absolute paths to various things, including the .pmdoc file itself. This happens no matter whether you change the paths to the installed files to be relative to the .pmdoc location, or anything else.
After some experimentation, it appears that if you move the .pmdoc, or do anything else that changes its location or environment, PackageMaker resets all kinds of values to defaults - and that includes the owner/group permissions, as well as the component relocation and downgrade flags. This happens inside PackageMaker's memory, because the component files that make up my .pmdoc files are all locked by my source control system (Perforce), and I've verified they haven't changed.
For the time being, I'm just setting up a build machine and build folder and not moving anything.
In the longer term, I intend to switch to building the .pkg files using PackageMaker's command line interface, which is apparently what Apple does. I found a pretty good article with tips on that.
Update
This article has a great discussion and example of a simple installer built using the command line "packagemaker" utility. Replacing the obvious values in the example, this worked first time, out of the box, on every machine I tried it on, with none of this random reset hoohah. I accomplished more in an hour this way than I did in two days with PackageMaker. Ditch the GUI and use this - you will be happy.
If you really want to use a GUI to put your installer together, Packages looks promising, but I haven't actually tried it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With