Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

sebyweb

macrumors newbie
Original poster
Dec 29, 2009
2
0
Hi all

I need to copy two files (a sqlite database and library) into the /Library folder through a installer.
The database can be modified before the installation of the application without re-build the package.
So I am using PackageMacker to do it and in particular with PackageMaker the library is copied and a post-install script (with a simple bash copy instruction) to copy the database.
The problem is that the database embedded in the installer is copied and not the database delivered with the installer.
How can avoid it?

Regards
sebyweb
 
Stick with the approach you're using, but make a few modifications: Don't bundle the database inside the installer, but instead use a post-install script that copies the database (which, in an ideal scenario, is located on the same disk image as the installer, but lives outside the installer) to the right location - make sure you've got the paths set right. You may need to do something like /Volumes/DiskImage/db/database.sqlite for your path, so it works the way it's supposed to unless the disk image gets renamed.
 
postinstall, postflight, etc. are given a few parameters which you may be able to use so that you don't have to make assumptions about the location of the package.

You could parse this one to determine the source of your database file relative to the package:
$1: Full path to the installation package the Installer application is processing. For example:

/Volumes/Users/michelle/Desktop/Levon.mpkg

Source (includes documentation on other params as well: http://developer.apple.com/mac/libr...on/Install_Operations/Install_Operations.html
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.