How to specify the default installation location in $ HOME using pkgbuild?

I am moving our installer from PackageMaker to pkgbuild and am trying to set the default installation location to the user's current home directory and still allow the user to install the system as a whole.

In my distribution file, I have enable_currentUserHome = "true" and enable_localSystem = "true", which correctly allows the user to "Install for all users of this computer" or "Install only for me." However, I would like the โ€œInstall for meโ€ option to be selected by default.

pkgbuild has a command line parameter for "--install-location", which indicates the default help page, but does not mention how to specify the home directory. I tried "~" and "$ HOME" with no luck. Is there some kind of macro that I don't know about?

Does anyone know how to install pkgbuild for installation in the user's current home directory by default?

Thanks in advance!

-Owen

+4
source share
2 answers

pkgbuild creates a component package for you. Although you can install the component package yourself, it is usually included in the product archive. In the product archive, you can set the installation domain as localSystem and home.

For example, pkgbuild --install-location /Application install it as expected in / Application if the local system domain is selected, or in $ HOME / Application if the home installation is selected.

However, I am very inclined towards the form, using the installer to install the home folder. It just doesn't work in the real world.

See Known Issues and Workarounds in Creating OS X Installer Packages , and Installer Problems and Solutions .

+4
source

One way is to set the distribution file parameters as follows:

 enable_localSystem="false" enable_anywhere="true" enable_currentUserHome="true" 

The home installation will be selected by default, as it is turned on for the first time.

Users will still be allowed to install it on a system basis by selecting Install on a specific disk... โ†’ Macintosh HD . Disadvantage: this is less convenient for the user than choosing directly: Install for all users of this computer .

0
source

Source: https://habr.com/ru/post/1439442/


All Articles