You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

PackageMaker Install Path for Current User

I have been beating my brains out trying to find out how to set a path for the current users directory. Specifically, I want to install several files, two of them in the users" Application Support" folder. Can anyone tell me how to set the path.

This installation package will be used on 200+ Macs and the current user path is very important. Anyone?

Mac OS X (10.4.6)

Posted on Aug 1, 2008 6:42 AM

Reply
11 replies

Aug 1, 2008 11:24 AM in response to macie

I'm assuming you want to "get" the path, not "set" the path, hopefully?

Did you try "$HOME/Library/Application Support"?

Now, the above line is correct for "PackageMaker Install Path for Current User", but is almost certainly not what you want to do. Could you elaborate a bit?

If you are installing an application that needs something in Application Support, it should ideally have those files inside its own .app bundle and install them itself into the above path whenever it launches and detects that they aren't there. An easier but less robust solution would be the system Application Support path at /Library.

Finally, what are you installing in Application Support? Is that the best place for them? Is there any way at all they can go into the app bundle?

Aug 1, 2008 1:21 PM in response to etresoft

I am installing modified Illustrator CS3 Document Profiles. The default location is the users home directory in: Library/Application Support/Adobe/Adobe IllustratorCS3/New Document Profiles

This is the path that Illustrator uses for all current users settings and profiles.

These Document Profiles are modified to company standards and must be distributed to all users. In PackageMaker, a file is selected as a source and then a given path as destination. I do not know how to enter the destination path for the current user. The path/user is different for each Mac.

Thank you for your quick response. Any help is appreciated.

Aug 1, 2008 5:38 PM in response to macie

Ah, I get it now. There exists in PackageMaker a little known and little used mode to allow installations without requiring root authentication. When you first start up Package Maker, you have three options for "Install Destination". You want only the last one, "User home directory".

In the left hand pane, under Contents, select the item you want to install. In the right hand pane, there will be an item that says "Require Admin Authentication". This should be turned off. It will probably work if it is turned on, it is just the principle of the thing.

The key part is that what you want to install needs to have the same directory structure as where you are installing. For example, I have a little rtf file that contains a couple of lines of Javascript that makes any web site editable. I want to put this file into my user's Application Support directory. So, I create a folder named Library. In that folder, I create a folder named "Application Support". In that folder, I put my little file.

In Package Maker, I drag the Library folder (that I just created) into the left hand Contents pane. I selected the Library folder in the contents pane. Then, I turned off "Require Admin Authentication" in the right pane. Then, I click on the Contents tab on the right. I turn on the check box that says "Include root in package". Then it works.

PackageMaker is just really, really hard to use. You can change any of the options I have mentioned and get it to work. You just have to figure it out. It is rather hard to explain in a forum posting like this. If you play around with it, you will start to figure our where things go.

They key part is to set the top level "Install Destination" to "User home directory". Then, what you install should be a representative of the directory hierarchy that you want, relative to the user's home directory. You set the "Include root in package" because PackageMaker assumes that your install directory hierarchy will be in some other directory on your development system. It may be, in which case don't set that option.

I know this is confusing. There isn't much I can do about it. PackageMaker is hard to use.

Jan 23, 2009 12:46 PM in response to etresoft

Thanks! Been beating my heading trying to get around PackageMaker.

Only issue I have now is that following these instructions the receipt name is derived from the folder structure. Hence my receipt ends up library.pkg regardless of Package Identifier. Any way around that other than cracking open the built package and renaming the package (and name in distribution.dist)?

Thanks,
David

Jan 24, 2009 8:48 AM in response to peterparker

peterparker wrote:
Only issue I have now is that following these instructions the receipt name is derived from the folder structure. Hence my receipt ends up library.pkg regardless of Package Identifier. Any way around that other than cracking open the built package and renaming the package (and name in distribution.dist)?


This is a complete pain, because it leaves open the possibility of several manufacturers overwriting each other's receipts. It happens because Package Maker does not impose or enforce reverse URL naming of receipts, eg. com.company.product.component.

There is a bodge you can use which does work (but it is a bodge). Rename the component file name to a unique form based on reverse url naming. Don't even try to put in dots or capital letters because Package Maker won't honour them. So if you've got a component named (say) MyProgram.app, which belongs to the HyperWare product developed by AcmeCorp then rename it to comacmecorphyperwaremyprogram.app (which is quite a string but at least its unique). Don't worry that your system will no longer work with the changed file name, because we're going to change it back after installation!

Set up PM to install this long named component in the correct folder. It will write a package receipt based on the long name. Of course, after installation you need to rename the long named component back to MyProgram.app. This is "easily" achieved by the following post-flight script:

#!/bin/bash
cd /Applications/Acme Corp Hyperware
mv comacmecorphyperwaremyprogram.app MyProgram.app
exit

The post flight script renames the component to the correct name, but the package receipt will be a unique string.

You need to do this with all your components, but you can perform all the renaming in the post-flight script for the last one to get installed.

It works, but as I say, it's a bodge.

Don't issue the installer until you've double/treble/quadruple checked that it actually works as you want!!!!!

Bob

Jan 28, 2009 2:15 PM in response to etresoft

etresoft wrote:
Bob Lang1 wrote:
If you have spaces in a file or folder name then they need to be escaped using backslash. So the cd line should really be:
cd /Application/Acme\ Corp\ Hyperware


I'm guessing you don't want to know how PackageMaker handles source files with spaces


As Bill Gates might have said (but didn't): Eight characters and a three character extension should be sufficient to name any file 😉

PackageMaker Install Path for Current User

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.