Cody
Cody

Reputation: 2482

How do I disable selection of an alternate volume in my OS X installer package?

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...

Upvotes: 3

Views: 1500

Answers (3)

Siva Prakash
Siva Prakash

Reputation: 4997

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"/>

Upvotes: 1

postmechanical
postmechanical

Reputation: 11

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.

Upvotes: 1

Cody
Cody

Reputation: 2482

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.

Upvotes: 2

Related Questions