Disable the "Change installation location ..." button in the installer created using productbuild

I want to disable the "Change installation location ..." button (screenshot below) in the installer. I am trying to create an installer using pkgbuild and productbuild on macOSX 10.8. First, I create two .pkg files using pkgbuild.

pkgbuild --root myApp --component-plist myApp.plist --scripts appScripts --identifier com.myapp.coreapp --version 1.0.00 --install-location /Applications --ownership preserve pkgbuild --root myBr --component-plist myBr.plist --scripts brScripts --identifier com.myapp.browser --version 1.0.00 --install-location /Library/Internet\ Plug-Ins --ownership preserve 

In the above plists, I use BundleIsRelocatable as false .

And then I use productbuild to create the final installer package.

 productbuild --distribution dist.xml --resources res inst.pkg 

In dist.xml, I tried all combinations with domains , as well as rootVolumeOnly , but I still can’t disable the "Change installation location ..." button.

Can anyone help? Many thanks.

enter image description here

+7
source share
3 answers

I discovered a radar error for them and got an answer. You only need to specify a domain and set rootVolumeOnly to true.

So in my case it worked:

 <domains enable_localSystem="true"/> <options rootVolumeOnly="true"/> 
+10
source

Unfortunately, “Destination Selection” and “Installation Type” are always displayed by the installer. Like the "Change installation location ..." button.

This does not allow the user to change the installation location, but the user interface is not optimal. I can only recommend filling out a bug report.

You might want to explore: Known issues and workarounds - Destination Select Pane on using domains vs rootVolumeOnly

+3
source

This is a pretty old question, but since I just ran into this problem and fixed it. None of the solutions I found on the Internet solved my problem, so I will send my answer to others who are facing this problem.

The solution is somehow strange, but it works great. All you have to do is add an empty plugin to your installer. The following steps will help you:

  • Create a folder called Plugins in your project, I assume the folder is next to your distrib.xml file.
  • The file structure inside the Plugins folder should look like this:

enter image description here

as you see at the top level of the Plugins folder, there is a folder named DisbableDestinationSelect.bundle, and there is a file called InstallerSections.plist

  1. In the DisbableDestinationSelect.bundle section, you need the exact folder structure. DisbableDestinationSelect is an empty file that must be executed. Thus, if you create a file on the command line, be sure to run chmod +x DisbableDestinationSelect
  2. The InstallerSections.plist file should look like this:
 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>SectionOrder</key> <array> <string>DisbableDestinationSelect.bundle</string> <string>Introduction</string> <string>ReadMe</string> <string>Target</string> <string>PackageSelection</string> <string>Install</string> </array> </dict> </plist> 

Come here! Now create your final product with the following command:

 productbuild --distribution distribution.xml --resources Resources/ --plugins Plugins/ --package-path ./ "$PRODUCT_NAME.pkg" 

and the button "Change installation location ..." disappeared forever

+1
source

All Articles