PackageMaker: do not present destination selection to the user

I'm in the process of creating a package to install some software I've written. The problem I'm having is the software (a plug in for an Apply supplied application) has to be placed in a specific directory. Since this is to be per-user, I want to have it installed in the appropriate ~/Library folder, without giving the user the option to select the destination.


Unfortunately, even though I set the desired destination in the package configuration and do not have the "Allow custom location" box checked, when installing the package, the user is presented with the "Select a Destination" window as part of the installation. I would have thought specifying a location and not having the box checked would bypass this step.


Have I missed something?


- Mark

Mac OS X (10.7.4)

Posted on Aug 12, 2012 10:08 AM

Reply
7 replies

Aug 12, 2012 8:25 PM in response to pilant

Maybe start with a demo installer first. PackageMaker is very tricky.


I just created a little installer to put a file into a specific place in the user's home directory. I did the following:


1) Start PackageMaker

2) Drag my file into the Contents pane

3) Select the "Distribution" area above the Contents pane

4) In Install Destination, make sure only "User home directory is checked" and User Sees is "Easy Install Only"

5) Then I clicked on the file I added - not the row with the disclosure triangle and the blue indicator, the line below that.

6) Turn off "require admin authentication"

7) Set my path relative to root. In this example, I entered the following into Destination "/Library/Noodles". Allow custom location is off. Restart action is none.

8) Build and run


This installs my file into my home directory in the Library folder, in the newly created "Noodles" folder.


It is best to start small and simple and then add fancy stuff. Did I mention that PackageMaker is tricky?

Aug 13, 2012 2:53 PM in response to etresoft

> Maybe start with a demo installer first.


That is what I have done. I've been doing creation is stages/steps so I can evaluate better what works and doesn't work.


I do have "User home directly" selected. "Require admin authentication" is clear for all entries. Unfortunately, for other reasons (see my "PackageMaker: package enabled when it should not be" post) I can't set "Easy Install Only".


I'm going to continue to play around since there isn;t much good documentation.


> Did I mention that PackageMaker is tricky?


Well, I wouldn't use the term "tricky", but this is a public forum :-O :-)


- Mark

Sep 22, 2012 5:39 AM in response to pilant

pilant wrote:


I'm going to continue to play around since there isn;t much good documentation.

In my case, I have to provide a custom install option, so I can't have “easy install only”. If you find an answer to your problem, can you post it here, please? I'll do so if I find out.

(like you, I've defined the destinations of “read-only” components, but the destination is still modifiable; the lack of documentation is indeed obvious and annoying).

Sep 22, 2012 8:37 AM in response to Anic264b

I didn't ever find the solution I really wanted, but I did come up with something which was acceptable.


What I did was to select the "Custom Install Only" and "User Home Directory". Then for each component of the package, I explicitly set the destination to "./tmp"; which is based off the user's home directory. Then I execute a postinstall script which moves the files to their "real" locations.


This is a little strange bacause I needed to have one of the files live in a plugin directory of an unrelated application, and I wanted to have all my files live in the appropriate subdirectory (~/Library/my-product). This also made it a little easier to create an "uninstall" package to remove all the various pieces.


I hope this helps.


- Mark

Sep 24, 2012 9:28 AM in response to pilant

Thank you. So this implies one of the options (either “Custom Install Only” or “User Home Directory”) actually hides this popup menu for custom destination? That's far from clear; Apple should have made an option just for that instead of hiding the setting into another, non-related one.


Is it worth mentioning I'm disapointed by how PackageMaker “works”?

Sep 24, 2012 5:51 PM in response to Anic264b

I'd have to go back and test this again to be sure, but *I think* this is what I uncovered. The "User Home Directory" was needed to make sure the package used the user's home directory as the target/work directory. Otherwise it used a different location (and I can't remember exactly what it was). Then, the "Custom Install Only" was used to eliminate (in most cases) the popup asking for the location.


I say "mostly" because even with all this, I get different results for the destination/admin priv popups using *the

same package* file. I documented it here:


https://discussions.apple.com/thread/4223487


I understand your pain about PackageMaker. I won't say any more because "If you can't say anything nice, don't say anything at all"... I'll leave it at that.


- Mark

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

PackageMaker: do not present destination selection to the user

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