1

My Question

I want to make my installer copy a config file is placed in same directory as the PKG. The .pkg + config file would be distributed as a DMG.

I need the installer to copy this config file to a particular folder as part of install process. ${PACKAGE_PATH} is an environment variable which is set by the installer and could be used to get the path to config file... But, this doesn't work when the .pkg is run from a mounted dmg (requires user to extract files to file system).

Is there any way around this?

Background info for why I want to do this...

Our application has a config file that organizations customize to their liking and then they would distribute this config file in the same directory as the .pkg.

We got around this issue before by making a simple deploy tool that customer drag and dropped their .pkg and config file on and it'd generate for a customized pkg with it embedded.

Mountain Lion now requires pkg installers to be signed which prevents us from inserting custom files without resigning it.

So, my options are:

  1. Create a webapp that customers can upload their files to and get a customized signed pkg which is kind of a pain.
  2. Extend my deploy tool to sign the package. This isn't ideal as it'd basically require us to distribute our private key which is a big no no.
  3. Hope there is a simpler solution... like the DMG approach i'm asking about.
blak3r
  • 16,066
  • 16
  • 78
  • 98

1 Answers1

0

$1 and $PACKAGE_PATH, both give the full path to the installation package the Installer application is processing. For example: /Volumes/Users/Vikrams/Desktop/TestPkg.pkg

It should work even when installer is run from mounted dmg. You can get more information at Scripting in Packagemaker.

Vikram Singh
  • 1,726
  • 1
  • 13
  • 25
  • I'm definitely able to get a path... but it fails to copy. Probably some type of permission issue. I'll try and redirect the output of the copy command to get more info. I have to work through another guy to do this at the moment since I haven't upgraded my box to 10.8 yet (which is needed for our build scripts now). – blak3r Aug 28 '12 at 05:06