3

I'm putting together an installer package for OS X, and I can't figure out how to disable the screen that asks the user which volume to install to. I want it to install to / without prompting.

Here's how I'm building the package:

pkgbuild--root build/staging/ --identifier xxxx --scripts InstallerOSX/resources/ --scripts InstallerOSX/scripts/ ${OBJROOT}/AgentPayload.pkg

productbuild--distribution InstallerOSX/distribution.dist --package-path ${OBJROOT} --resources InstallerOSX/resources/ ${BUILT_PRODUCTS_DIR}/AgentInstaller.pkg

and here's my distribution file:

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<installer-gui-script minSpecVersion="1">
    <title>xxxx</title>
    <background file="background.png" mime-type="image/png" scaling="tofit"/>
    <pkg-ref id="xxxx"/>
    <options customize="never" require-scripts="false"/>
    <choices-outline>
        <line choice="xxxx"/>
    </choices-outline>
    <choice id="xxxx" title="title" description="desc">
        <pkg-ref id="xxxx"/>
    </choice>
    <domains enable_anywhere="false" enable_currentUserHome="false" enable_localSystem="true"/>
    <pkg-ref id="xxxx" version="0" onConclusion="none">AgentPayload.pkg</pkg-ref>
</installer-gui-script>

The <domains> element doesn't seem to do the trick...

3 Answers 3

2

I ended up adding the following to the distribution definition:

<options rootVolumeOnly="true"/>

rootVolumeOnly is deprecated, but it works for now, while domains doesn't seem to.

0
1

Using the domains approach appears not to work because the UI is not the best. The "Change Install Location..." button is still visible, but if you click it then only the "Install for all users of this computer" option is enabled.

1

2019 Update:

<options rootVolumeOnly="true"/> still works fine and skips the Destination select option during installation.

Since rootVolumeOnly is deprecated, the following option in Distribution.xml has the same behavior and skips the Destination as well.

<domains enable_anywhere="false" enable_currentUserHome="false" enable_localSystem="true"/>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.