On May 18, 2009, at 10:36 AM, Karl Kuehn wrote: On May 18, 2009, at 1:00 AM, Chris Gardner wrote: I have a pragram of alpha version and want to update this version to add new files. After making a update package with Package Maker tool, and setuping the update package, the same name of original file will be instead, but the others will disappear. Why?
Apple's installer system is being helpful, it is just not working the way you think. When it installs a package it writes out a receipt (or into the reciepts.db) the list of files that it installed. When you then install something with the same name/identifier it compares the list of files to what is already installed, and figures that if a file that was in the old version is not in the new version it should remove it (cleaning up after itself). The problem in this case is that you are trying to out-think the installer, and so it is removing files that you still want in the later version. How can I update the old specified files ,meanwhile do not delete the others with update package made by Package Maker.
Don't try and create packages that are just updaters. Create a new full installer of the latest version (and bump the version number), and Apple's installer will take care of "updating" for you.
Option 2: Make a package with a new name and bundle id, and installation logic to prevent it from creating a broken app.
For instance, this is what I do for iLife apps:
My "full" installer is called iPhoto.pkg, and it has the Bundle ID com.apple.pkg.iPhoto -- it installs version 8.0.
Now I need to release 8.0.1, so I make iPhoto801.pkg with Bundle ID com.apple.pkg.iPhoto801
(Yes, you could use better naming conventions for the packages, perhaps iPhoto 8.0.1 Update.pkg. I have a few more limits because of Apple's infrastructure.)
I have installation checks to make sure that the version of iPhoto is 8.0 or 8.0.1, so that I don't create a broken app.
Having a separate name and bundle ID prevents the "upgrade mode" from happening, so you don't delete all the files that are not in your new package. |