Home Forums Software InstaDMG New way of doing InstallerChoices.xml files

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #375208
    larkost
    Participant

    While at Macworld this year a little birdie told me that there was another way of doing InstallerChoices files that did not require simulating clicks like the documented way does. It was also wispered that Apple’s SIU (System Imaging Utility) uses this method, and that an example of this file might exist somewhere in a SIU Installer output dmg. I finally sat down and did the work of figuring this out, and here is what I turned up (copy-paste of an email I just sent the InstaDMG dev team):

    Since the new version of the Server Admin Tools just came out, I decided to see if anything had changed, so created a SUI Installer image. Since I had that and the Installer DVD already open I did a quick diff on the two, and turned up the file that replaces the installerchoices file. It is stored at:

    /var/db/MacOSXInstaller.choiceChanges

    A quick check using -showChoicesAfterApplyingChangesXML makes me believe that this format is indeed a straight stand-in for the installerchoices.xml format. This is probably going to be a lot easier to man-handle than the simulated clicks method.

    And the format looks like this when I just turned off installing printer drivers:

    [code]



    attributeSetting

    choiceAttribute
    visible
    choiceIdentifier
    PrinterDriversGroup

    [/code]

    #375222
    alantrewartha
    Participant

    are you saying that this format file can be fed to the installer in the -applyChoiceChangesXML option as it stands now – or is this in a new version of installer? (the help on the command line still only says “…an array of choiceIdentifiers…Each choiceIdentifier specified will be toggled in order…”

    #375235
    Patrick Fergus
    Participant

    Nearly the same question as alantrewartha–does this work if you are building on a Mac running 10.5.6 and using a 10.5.0 retail disc image?

    #375236
    larkost
    Participant

    My understanding is that SIU has been using this technique all along in the NetInstal form, so that probably means that it will go back to the installer (the executable) on 10.5.0. And this should not care about what sort of packages you feed it. In theory you could use this to modify a 10.4 install that is done while running on 10.5 (note: I have never tried that install).

    So my initial testing seems to indicate that this is a direct replacement for the format you feed into the -applyChoiceChangesXML option. This is totally undocumented, and I would never have known to look without a hint from “a little birdie”.

    #375237
    Patrick Fergus
    Participant

    I apparently need better birdies.

    – Patrick

    #375243
    Greg Neagle
    Participant

    We’ll need to do some more experimenting to figure out this alternate syntax.

    I tried feeding this xml file to installer against the iLife-08 installer:

    [code]



    attributeSetting

    choiceAttribute
    visible
    choiceIdentifier
    iWeb

    [/code]

    like so:

    sudo installer -showChoicesAfterApplyingChangesXML /tmp/choices.xml -pkg /Volumes/iLife\ \’08\ Install\ DVD/iLife\ \’08.mpkg -target /

    And as might be guessed, iWeb stayed selected for install, but the choice was made invisible (like that’s useful at the command-line…):

    [code]

    childItems

    choiceDescription
    This package installs iWeb ’08.
    choiceIdentifier
    iWeb
    choiceIsEnabled
    choiceIsSelected
    1
    choiceIsVisible

    choiceSizeInKilobytes
    293520
    choiceTitle
    iWeb
    pathsOfActivePackagesInChoice

    file://localhost/Volumes/iLife ’08 Install DVD/iLife ’08.mpkg/Contents/Installers/iWeb.pkg


    [/code]

    So I edited /tmp/choices.xml like this:

    [code]



    attributeSetting

    choiceAttribute
    selected
    choiceIdentifier
    iWeb

    [/code]

    and tried again. Looks better:

    [code]

    childItems

    choiceDescription
    This package installs iWeb ’08.
    choiceIdentifier
    iWeb
    choiceIsEnabled
    choiceIsSelected
    0
    choiceIsVisible
    choiceSizeInKilobytes
    293520
    choiceTitle
    iWeb
    pathsOfActivePackagesInChoice

    file://localhost/Volumes/iLife ’08 Install DVD/iLife ’08.mpkg/Contents/Installers/iWeb.pkg


    [/code]

    It seems like it’s far most useful to control the “selected” attribute, rather than “enabled” or “visible”, which seem to be relevant only in the GUI…

    It also looks like you must provide a separate dict for each choiceIdentifier+choiceAttribute combination:

    [code]



    attributeSetting

    choiceAttribute
    selected
    choiceIdentifier
    iWeb


    attributeSetting

    choiceAttribute
    enabled
    choiceIdentifier
    iWeb


    attributeSetting

    choiceAttribute
    visible
    choiceIdentifier
    iWeb

    [/code]

    results in:

    [code]

    childItems

    choiceDescription
    This package installs iWeb ’08.
    choiceIdentifier
    iWeb
    choiceIsEnabled

    choiceIsSelected
    0
    choiceIsVisible

    choiceSizeInKilobytes
    293520
    choiceTitle
    iWeb
    pathsOfActivePackagesInChoice

    file://localhost/Volumes/iLife ’08 Install DVD/iLife ’08.mpkg/Contents/Installers/iWeb.pkg


    [/code]

    Note that “choiceIsEnabled” is set to false; “choiceIsSelected” is set to 0, and “choiceIsVisible” is set to false, though I’m still not certain why’d you want to control anything other than “choiceIsSelected”.

    I wonder if there is an undocumented place one could insert a choices.xml file into a package bundle that would then be used by Installer.app to provide different default choices in the GUI?

    -Greg

    #375439
    pepijn
    Participant

    This method actually let me tackle an unwilling vanilla 10.5.0 installer that would not let me nix the language translations using the “old” format. Even using multiple entries for them, in just about every permutation possible and the output of showChoicesAfterApplyingChangesXML happily showing me no language were to be installed, *promise*, it still insisted on installing them all come InstaDMG build time.

    After a quick conversion from the “old” format to this one (thank you Textmate) and making sure to triple up on the negativity (selected, enabled, visible) the InstallerChoices.xml file now works out the way I want it to, skipping language translations and their fonts (as well as a few other minor items). So thank you for figuring this one out, I’m very much looking forward to wrapping some kind of GUI around the whole InstallerChoices.xml-creation process but I hadn’t started yet due to the seemingly unreliable outcome in the past. This might work better.

    Pepijn.

    #375530
    knowmad
    Participant

    pepjin, if you simplify that, every new user here will rejoice, and the old ones will sigh with a bit of relief.
    Simplifying the choices file would mean I would use it more often.
    you have my vote.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.

Comments are closed