PackageMaker and external files

Discussion in 'Mac Programming' started by sebyweb, Jul 15, 2010.

  1. sebyweb macrumors newbie

    Joined:
    Dec 29, 2009
    #1
    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
     
  2. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #2
    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.
     
  3. iSee macrumors 68040

    iSee

    Joined:
    Oct 25, 2004
    #3
    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:
    Source (includes documentation on other params as well: http://developer.apple.com/mac/libr...on/Install_Operations/Install_Operations.html
     

Share This Page