- This topic has 7 replies, 6 voices, and was last updated 16 years, 1 month ago by
knowmad.
-
AuthorPosts
-
January 23, 2009 at 6:54 pm #375208
larkost
ParticipantWhile 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]
[/code]
attributeSetting
choiceAttribute
visible
choiceIdentifier
PrinterDriversGroup
January 26, 2009 at 10:01 am #375222alantrewartha
Participantare 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…”
January 26, 2009 at 4:05 pm #375235Patrick Fergus
ParticipantNearly 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?
January 26, 2009 at 4:29 pm #375236larkost
ParticipantMy 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”.
January 26, 2009 at 5:01 pm #375237Patrick Fergus
ParticipantI apparently need better birdies.
– Patrick
January 26, 2009 at 8:04 pm #375243Greg Neagle
ParticipantWe’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]
[/code]
attributeSetting
choiceAttribute
visible
choiceIdentifier
iWeb
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]
[/code]
attributeSetting
choiceAttribute
selected
choiceIdentifier
iWeb
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]
[/code]
attributeSetting
choiceAttribute
selected
choiceIdentifier
iWeb
attributeSetting
choiceAttribute
enabled
choiceIdentifier
iWeb
attributeSetting
choiceAttribute
visible
choiceIdentifier
iWeb
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
February 17, 2009 at 8:32 pm #375439pepijn
ParticipantThis 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.
February 23, 2009 at 10:27 pm #375530knowmad
Participantpepjin, 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. -
AuthorPosts
- You must be logged in to reply to this topic.
Comments are closed