Home Forums Software InstaDMG Creating an Installer Choice Changes XML file for Leopard

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #370800
    Patrick Fergus

    I saw a few posts about this, so I’ll submit what I did using the Leopard installer as an example. Some of this may not be the most elegant way to handle this, but it does work.

    #1: Extract the choice information from the target installer. I used the following command:

    [code]sudo installer -showChoicesXML -pkg /Volumes/Mac\ OS\ X\ Install\ DVD/System/Installation/Packages/OSInstall.mpkg > /Users/Shared/OSInstall.mpkg_default_choices.xml[/code]

    This will output a list of the various choices the installer provides, whether they are visible or not within Installer.app. What we’re really interested in is the “choiceIdentifier” tags throughout the file.

    [code]grep -A 1 choiceIdentifier /Users/Shared/OSInstall.mpkg_default_choices.xml > /Users/Shared/OSInstall.mpkg_choiceIdentifiers.txt[/code]

    This will output a text file of more or less readable choiceIdentifiers. Note that there are possibly more choiceIdentifiers in the output of the above command than you actually see in Installer.app. This is normal, since something like “Essential System Software” is more than one package, but you don’t really want to not install pieces unless you know what you’re doing.

    #2: Pick your choices

    Thumb through the choiceIdentifiers outputted above. You’ll probably see items you recognize from Installer.app that you know you want to turn off or on. This would be a good time to actually start the installer of interest and examine the options provided by the installer (for example, Leopard provides these options behind the “Customize…” button). This will allow you to focus on the important customizations easily.

    Choose the choiceIdentifiers you wish to address. Each entry listed is a “click” within Installer.app. In my case, I want to “click” (disable, since they are enabled by default) the printer drivers (choiceIdentifier “PrinterDriversGroup”), additional fonts (choiceIdentifier “AdditionalFonts”), and X11 (choiceIdentifier “X11”). Create a plain text file (I’ll call mine “Leopard_Choices.xml”) and place the choiceIdentifiers inside an array of string tags.



    If you have a half-clicked (appears as a dash instead of a checkmark) installation option inside Installer.app, you’ll need to list it as many times in the text file as you would need to click it in Installer.app. Click the option twice to clear it inside Installer.app? List it twice in the text file.

    Enabling or disabling choices may cause other options to become available or disappear (for example, iSync required iCal in 10.3 and thus you could not disable installing iCal unless the iSync installation was first disabled). To check to see what happens if your text file of choices is applied to a particular installer, run the following command:

    [code]sudo installer -showChoicesAfterApplyingChangesXML Desktop/Leopard_Choices.xml -pkg /Volumes/Mac\ OS\ X\ Install\ DVD/System/Installation/Packages/OSInstall.mpkg > /Users/Shared/OSInstall.mpkg_afterChoiceXML.xml[/code]

    Compare OSInstall.mpkg_default_choices.xml and OSInstall.mpkg_afterChoiceXML.xml to ensure you are enabling and disabling the desired packages.

    #3 Use your Choices

    When running installer from the command line, tell installer to look at your choices:

    [code]sudo installer -applyChoiceChangesXML /Users/Shared/Leopard_Choices.xml -pkg /Volumes/Mac\ OS\ X\ Install\ DVD/System/Installation/Packages/OSInstall.mpkg -target /Volumes/TargetHD[/code]

    That should be it.

    Patrick Fergus

    One additional note–unless installer is pointed at a particular partition/disk with the -target option, it assumes that you will be installing to / . This presents a problem if you’re building an Installer Choice Changes file because the options provided by installer reflect the current installed software on /. If you build your development partition without languages to save installation time, the choices provided by installer and showChoicesXML will [i]not[/i] list the languages as enabled.

    Point installer at a partition/disk that doesn’t have an OS installed to get the plain vanilla showChoicesXML [code]installer -target /Volumes/InstaDMG_Target[/code] or keep in mind that your XML will reflect the current target of installer.

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

Comments are closed