It is a quite old question, but as I just faced this problem and fixed it. None of the solution I found on the internet solved my problem, so I will post my answer for others that face this problem.
The solution is somehow weird but it works fine. All you need to do is to add an empty plugin to your installer. The following steps will guide you through:
- Create a folder named Plugins in your project, I assume the folder is beside your distribution.xml file.
- The structure of files inside Plugins folder should look like this:
as you see on top level of Plugins folder there is a folder named DisbableDestinationSelect.bundle and there is a file named InstallerSections.plist
- Under DisbableDestinationSelect.bundle you need the exact folder structure. DisbableDestinationSelect is an empty file that must be executable. Thus, if you create the file in the command line do not forget to run
chmod +x DisbableDestinationSelect
- 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>
There you go! Now create your final product with a command like this:
productbuild --distribution distribution.xml --resources Resources/ --plugins Plugins/ --package-path ./ "$PRODUCT_NAME.pkg"
and the "Change Install Location..." button is gone forever