PDA

View Full Version : PackageMaker and set up of Requirements




jmbill
Oct 24, 2009, 03:16 PM
I thought this would be really easy, but it seems not...

Basically I want end users to download and install a small plugin to ~/Library/Application Support/RapidWeaver/

I created a folder on my Desktop with a structure of Library/Application Support/RapidWeaver/ and added this to the sidebar of PackageMaker. "Easy Install Only" is selected and "User home directory" is ticked under the Configuration tab. Then under the contents tab, I have "Include root in package" ticked which I'm informed should be selected. On its own like this, it works fine.

The next stage seems to be the thing which is causing the problem. I want the installer to go to ~/Library/Application Support/RapidWeaver/ as an essential requirement and open the preference list file of an existing plugin to check a version number string before allowing a user to continue with the installation of a plugin.

If the "Info from the Property List on Target" file path is set to
Users/Me/Library/Application Support/RapidWeaver/MyPlugin/Contents/theme.plist
the installer works perfectly. But of course as soon as it's run on another computer or account, it fails because it can't find the home directory 'Me'.

Under file path I have tried:
$HOME/Library/Application Support/RapidWeaver/MyPlugin/Contents/theme.plist
/$HOME/Library/Application Support/RapidWeaver/MyPlugin/Contents/theme.plist
~/Library/Application Support/RapidWeaver/MyPlugin/Contents/theme.plist
/~/Library/Application Support/RapidWeaver/MyPlugin/Contents/theme.plist
but the installer still fails. The property list file it is looking for is definitely there. But it just can't seem to access any home directories.

So IS is actually possible to read a preference list file in a users home folder allowing the commencement of an installer?

Thanks in advance :)



jmbill
Oct 25, 2009, 09:42 AM
I also tried setting the requierment file path as:

$home/Library/Application Support/RapidWeaver/MyPlugin/Contents/theme.plist
/$home/Library/Application Support/RapidWeaver/MyPlugin/Contents/theme.plist
~$HOME/Library/Application Support/RapidWeaver/MyPlugin/Contents/theme.plist
/$HOME/Library/Application Support/RapidWeaver/MyPlugin/Contents/theme.plist
../../Library/Application Support/RapidWeaver/MyPlugin/Contents/theme.plist
/Library/Application Support/RapidWeaver/MyPlugin/Contents/theme.plist
Library/Application Support/RapidWeaver/MyPlugin/Contents/theme.plist

But these all fail. :mad:

Seems odd considering that the installer can install files to a users home directory, but it is unable to carry out any type of requirement checking on a users home directory. At least this is the problem I've hit. Perhaps there is a workaround? :confused:

If a pre-install script needs to be used instead, can anyone make any suggestions based on the above scenario. Unfortunately I don't know the first thing about AppleScript.