Difference between revisions of "ITunes"

From WPKG | Open Source Software Deployment and Distribution
Jump to: navigation, search
(Add version edited for current itunes. Also waiting for confirmation about the use of <depends>)
(complete rewrite of the page; removed old versions; added minimal itunes install method)
Line 1: Line 1:
== Apple iTunes ==
+
= General Information =
Apple iTunes is a program to both play different types of media, but it is also required if you want to sync an iPhone with outlook in a corporate environment. you can get it [[http://www.apple.com/itunes here]].  It comes bundled with multiple sub programs.  Some are desired and some are not.  I will post below the minimum required ones to get a get iTunes working. It will include the iTunes, Quicktime and Apple Mobile Device Support.
+
Apple iTunes is primarily a program to play different types of media, but it is also required if you want to backup an IPhone or sync your emails, notes, bookmarks etc over USB with your PC. ITunes comes bundled with multiple sub programs that are all automatically installed when running the regular ITunes setup wizard. However depending on your use case you don't actually need all of them. Therefore this page is divided into two subparts: On the one hand a full blown ITunes installation (excluding Apple Software Update) when you actually want to use ITunes and Quicktime as an audio and video player, image viewer, podcast streamer, etc and on the other hand a minimal ITunes installation if you only want to use it to snc/backup an IPhone.
  
== Pre-Setup Process ==
+
ITunes is one of the programs that are more difficult to package, since Apple is using it as a vehicle to distribute their other software. To get rid of at least some of those "extra" programs additional configuration steps are necessary to perform.
The iTunes installer does not have a silent option.  One must do the following to extract the msi's from the package.
+
  * Download the setup file from apple.
+
  * Begin the setup process, but do not proceed any further.
+
  * Goto your Temp folder for your profile "C:\Documents and Settings\Username\Application Data\Temp
+
  * Find the iTunes Temp folder there.  (it will probably be random name, so sort by last modified time)
+
  * Copy multiple MSI packages to a directory for your choosing.
+
  * You can now stop the iTunes install.
+
  
'''Alternatively''' simply open the setup file with 7Zip and copy the individual msi files to your %SOFTWARE%\iTunes\version directory
+
= Pre-Setup Process =
 +
The ITunes installer consists of multiple MSI packages for each of its sub programs and a runtime that executes those MSI packages one after the other. To extract the MSI files do the following:
 +
* Download the ITunes setup file from Apple (usually called iTunesSetup.exe)
 +
* Open the file with 7zip or another file archiver
 +
* Extract iTunes.msi, QuickTime.msi, AppleApplicationSupport.msi and AppleMobileDeviceSupport.msi
  
 +
== Notes ==
 +
* Apple Mobile Device Support is only necessary if you want to connect an Ipod or IPhone. Quicktime and Apple Application Support are mandatory to be able to run ITunes.
 +
* Each sub-application has its own version. When a new version for ITunes comes out, you will need to extract the MSI packages, right click on them and check their version under file info to see which sub programs have updated. Each sub program has its own WPKG package definition with separate install, upgrade and uninstall commands.
 +
* If you insist on also having the latest available version of Apple Application Support you'll have to download every installer from the Apple website and check which one contains the latest version of the Apple Application Support.
 +
* Apple is known to sometimes modify the setup packages of their programs even at minor version changes, so do not blindly assume that a new ITunes installer will work the same way as the old one did!
 +
* The version of Quicktime that is bundled with ITunes is '''not''' necessarily the newest version available and may contain known security flaws. If this is the case, you will have to download the standalone Quicktime installer from Apple and extract the file QuickTime.msi from there.
 +
* There is a 64bit version of ITunes available too. As of version 9.2.1.5 the 64bit installer contains 64bit versions of ITunes itself and Apple Mobile Device Support and 32bit versions of Quicktime and Apple Application Support. If you have package definition for the 64bit versions feel free to add them to the wiki.
  
I rename my packages to remove any spaces and or to shorten the name.  My XML will reflect that, so keep that in mind
+
= Full ITunes installation =
 +
''If you update this code, please remember the GUIDs change on each new version installed!''
  
'''** NOTE **''': Each sub-application has it's own version.  When a new version for iTunes comes out, you will need to install all the applications on a test box and see which sub-applications have updated. You will find that most of the time it is just the iTunes msi that has a new revision and the others remain the same. Each one also has it's own uninstall command.
+
== 9.2.1.5 ==
 
+
'''Warning:''' The installer of ITunes 9.2.1.5 contains Quicktime 7.66 which has a highly critical security flaw that allows for remote execution of arbitrary code, simply by visiting a webpage ([http://secunia.com/advisories/40729 secunia.com]). You have to download the standalone Quicktime installer instead and extract the version 7.67 of QuickTime.msi. Alternatively you can use the minimal ITunes installation method below, which removes the Quicktime browser plugin completely.
== XML ==
+
'''If you update this code, please remember the SIDs change on each new version installed'''
+
 
+
=== 9.2.1.5 ===
+
'''NOTICE: Apple Application Support is now required for Apple QuickTime to run'''
+
  
 
Deploy File/Folder Structure
 
Deploy File/Folder Structure
   %SOFTWARE%\itunes\9.2.1.5\iTunes.msi
+
   %SOFTWARE%\itunes\iTunes.msi
   %SOFTWARE%\itunes\9.2.1.5\QuickTime.msi
+
   %SOFTWARE%\itunes\QuickTime.msi
   %SOFTWARE%\itunes\9.2.1.5\AppleMobileDeviceSupport.msi
+
   %SOFTWARE%\itunes\AppleMobileDeviceSupport.msi
   %SOFTWARE%\itunes\9.2.1.5\AppleApplicationSupport.msi
+
   %SOFTWARE%\itunes\AppleApplicationSupport.msi
  
 
<source lang="xml">
 
<source lang="xml">
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
<package
+
<!-- Version 1.3.0 has the same GUID -->
        id="itunes"
+
<package id='appleapplicationsupport' name='Apple Application Support' revision='1.3.1' reboot='false' priority='1'>
        name="Apple iTunes"
+
<check type='registry' condition='equals' path='HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{B2D328BE-45AD-4D92-96F9-2151490A203E}\DisplayVersion' value='1.3.1' />
        revision="9.2.1.5"
+
        reboot="false"
+
        priority="1">
+
  
        <check type="file" condition="versiongreaterorequal" path="%PROGRAMFILES%\iTunes\iTunes.exe" value="9.2.1.5"/>
+
<install cmd='msiexec /i "%SOFTWARE%\itunes\AppleApplicationSupport.msi" /passive /norestart' timeout='300'>
        <install cmd="msiexec.exe /qn /norestart /i %SOFTWARE%\itunes\9.2.1.5\iTunes.msi" />
+
<exit code='0' />
        <upgrade cmd="msiexec.exe /qn /norestart /i %SOFTWARE%\itunes\9.2.1.5\iTunes.msi">
+
<exit code='3010' reboot='postponed' />
                <exit code="any" />
+
</install>
        </upgrade>
+
        <remove cmd="msiexec.exe /qn /uninstall {91F7F3F3-CE80-48C3-8327-7D24A0A5716A}" />
+
 
</package>
+
<upgrade cmd='msiexec /i "%SOFTWARE%\itunes\AppleApplicationSupport.msi" /passive /norestart' timeout='300'>
<package
+
<exit code='0' />
        id="applesupport"
+
<exit code='3010' reboot='postponed' />
        name="Apple Software Application Support"
+
</upgrade>
        revision="1.3.0"
+
        reboot="false"
+
        priority="1">
+
  
        <depends package-id="itunes"/>
+
<remove cmd='msiexec /x {B2D328BE-45AD-4D92-96F9-2151490A203E /passive /norestart' timeout='300'>
        <check type="registry"  condition="equals" path="HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{B2D328BE-45AD-4D92-96F9-2151490A203E}\DisplayVersion" value="1.3.0"/>
+
<exit code='0' />
        <install cmd="msiexec /qn /i %SOFTWARE%\itunes\9.2.1.5\AppleApplicationSupport.msi" />
+
<exit code='1605' />
        <upgrade cmd="msiexec /qn /i %SOFTWARE%\itunes\9.2.1.5\AppleApplicationSupport.msi" />
+
<exit code='3010' reboot='postponed' />
        <remove cmd="msiexec /qn /uninstall {B2D328BE-45AD-4D92-96F9-2151490A203E" />
+
</remove>
 
</package>
 
</package>
<package
+
<package id='applemobilesupport' name='Apple Mobile Device Support' revision='3.1.0.62' reboot='false' priority='1'>
        id="quicktime"
+
<check type='registry' condition='equals' path='HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{85991ED2-010C-4930-96FA-53F43C2CE98A}\DisplayVersion' value='3.1.0.62' />
        name="Apple Quicktime"
+
        revision="7.66.73.0"
+
        reboot="false"
+
        priority="1">
+
  
 +
<install cmd='msiexec /i "%SOFTWARE%\itunes\AppleMobileDeviceSupport.msi" /passive /norestart' timeout='300'>
 +
<exit code='0' />
 +
<exit code='3010' reboot='postponed' />
 +
</install>
  
        <depends package-id="itunes"/>
+
<upgrade cmd='msiexec /i "%SOFTWARE%\itunes\AppleMobileDeviceSupport.msi" /passive /norestart' timeout='300'>
        <check type="file" condition="versiongreaterorequal" path="%PROGRAMFILES%\QuickTime\QuickTimePlayer.exe" value="7.66.73.0"/>
+
<exit code='0' />
        <install cmd="msiexec /qn /i %SOFTWARE%\itunes\9.2.1.5\QuickTime.msi" />
+
<exit code='3010' reboot='postponed' />
        <upgrade cmd="msiexec /qn /i %SOFTWARE%\itunes\9.2.1.5\QuickTime.msi" />
+
</upgrade>
        <remove cmd="msiexec /qn /uninstall {3D9892BB-A751-4E48-ADC8-E4289956CE1D" />
+
<remove cmd='msiexec /x {85991ED2-010C-4930-96FA-52F43C2CE98A} /passive /norestart' timeout='300'>
 +
<exit code='0' />
 +
<exit code='1605' />
 +
<exit code='3010' reboot='postponed' />
 +
</remove>
 
</package>
 
</package>
<package
+
<package id='itunes' name='Apple iTunes' revision='9.2.1.5' reboot='false' priority='1'>
        id="applemobile"
+
<depends package-id='appleapplication' />
        name="Apple Mobile Device Support"
+
<depends package-id='quicktime' />
        revision="3.1.0.62"
+
        reboot="false"
+
        priority="1">
+
  
        <depends package-id="itunes"/>
+
<check type='uninstall' condition='exists' path='iTunes' />
        <check type="registry" condition="equals" path="HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{85991ED2-010C-4930-96FA-53F43C2CE98A}\DisplayVersion" value="3.1.0.62" />
+
<check type='file' condition='versiongreaterorequal' path='%PROGRAMFILES%\iTunes\iTunes.exe' value='9.2.1.5' />
        <install cmd="msiexec /qn /i %SOFTWARE%\itunes\9.2.1.5\AppleMobileDeviceSupport.msi" />
+
        <upgrade cmd="msiexec /qn /i %SOFTWARE%\itunes\9.2.1.5\AppleMobileDeviceSupport.msi" />
+
<install cmd='msiexec.exe /i "%SOFTWARE%\itunes\iTunes.msi" SCHEDULE_ASUW=0 /passive /norestart' timeout='300'>
        <remove cmd="msiexec /qn /uninstall {AADEA55D-C834-4BCB-98A3-4B8D1C18F4EE}" />
+
<exit code='0' />
 +
<exit code='3010' reboot='postponed' />
 +
</install>
 +
<!-- Disable update feature in ITunes via parental controls -->
 +
<install cmd='reg add "HKLM\SOFTWARE\Apple Computer, Inc.\iTunes\Parental Controls\Default" /v "AdminFlags" /t REG_DWORD /d "0x101" /f' timeout='60' />
 +
 +
<upgrade cmd='msiexec.exe /i "%SOFTWARE%\itunes\iTunes.msi" SCHEDULE_ASUW=0 /passive /norestart'>
 +
<exit code='0' />
 +
<exit code='3010' reboot='postponed' />
 +
</upgrade>
 +
<upgrade cmd='reg add "HKLM\SOFTWARE\Apple Computer, Inc.\iTunes\Parental Controls\Default" /v "AdminFlags" /t REG_DWORD /d "0x101" /f' timeout='60' />
 +
 +
<remove cmd='msiexec.exe /x {91F7F3F3-CE80-48C3-8327-7D24A0A5716A} /passive /norestart' timeout='300'>
 +
<exit code='0' />
 +
<exit code='1605' />
 +
<exit code='3010' reboot='postponed' />
 +
</remove>
 +
</package>
 +
<package id='quicktime' name='Apple QuickTime' revision='7.67.75.0' reboot='false' priority='1'>
 +
<check type='uninstall' condition='exists' path='QuickTime' />
 +
<check type='file' condition='versiongreaterorequal' path='%PROGRAMFILES%\QuickTime\QuickTimePlayer.exe' value='7.67.75.0' />
 +
 +
<install cmd='msiexec /i "%SOFTWARE%\itunes\QuickTime.msi" SCHEDULE_ASUW=0 /passive /norestart' timeout='300'>
 +
<exit code='0' />
 +
<exit code='3010' reboot='postponed' />
 +
</install>
 +
 +
<upgrade cmd='msiexec /i "%SOFTWARE%\itunes\QuickTime.msi" SCHEDULE_ASUW=0 /passive /norestart' timeout='300'>
 +
<exit code='0' />
 +
<exit code='3010' reboot='postponed' />
 +
</upgrade>
 +
 +
<remove cmd='msiexec /x {EB900AF8-CC61-4E15-871B-98D1EA3E8025} /passive /norestart' timeout='300'>
 +
<exit code='0' />
 +
<exit code='1605' />
 +
<exit code='3010' reboot='postponed' />
 +
</remove>
 
</package>
 
</package>
 
</source>
 
</source>
  
=== 9.0.0.70 ===
 
'''NOTICE: Apple Application Support is now required for Apple QuickTime to run'''
 
  
Deploy File/Folder Structure
 
  %SOFTWARE%\itunes\9.0.0.70\iTunes.msi
 
  %SOFTWARE%\itunes\9.0.0.70\QuickTime.msi
 
  %SOFTWARE%\itunes\9.0.0.70\AppleMobileDeviceSupport.msi
 
  %SOFTWARE%\itunes\9.0.0.70\AppleApplicationSupport.msi
 
  
<source lang="xml">
+
= Minimal ITunes installation =
<package
+
The goal of this setup is to get
        id="itunes"
+
# a working installation of ITunes which allows you to activate, backup and sync an IPhone or Ipod, download and install new iOS versions and optionally get songs/apps from the Apple Store,
        name="Apple iTunes"
+
# but does otherwise interfere with the PC as little as possible. Specifically this means: No Quicktime browser plugins, no Quicktime Java libraries, no automatic update checks, no desktop shortcuts, no automatic file type associations with Quicktime or ITunes, no ITunes CD grabbing, no unecessary background services, no autostart entries, no Quicktime picture viewer, no task icons.
        revision="9.0.0.70"
+
These package definitions are suited for someone who has to roll out ITunes in a corporate environment because the employees are using IPhones, but otherwise has no use case for ITunes and/or Quicktime at all. Of course all steps in this section is optional, if you don't want to leave a certain feature out, then simply omit the corresponding step.
        reboot="false"
+
        priority="1">
+
  
        <check type="file" condition="versiongreaterorequal" path="%PROGRAMFILES%\iTunes\iTunes.exe" value="9.0.0.70"/>
+
== Configuration ==
 +
Not all necessary changes to the setup packages can be made at the command line level, therefore the MSI files have to be modified. For this the Microsoft tool ''Orca'' (freeware) is necessary. If you don't have Orca yet, download it from [http://support.microsoft.com/kb/255905/ Microsoft].
  
        <install cmd="msiexec.exe /qn /norestart /i %SOFTWARE%\itunes\9.0.0.70\iTunes.msi" />
+
=== ITunes ===
        <upgrade cmd="msiexec.exe /qn /norestart /i %SOFTWARE%\itunes\9.0.0.70\iTunes.msi">
+
* Open iTunes.msi, select ''New Transform'' from the main menu.
                <exit code="any" />
+
* Drop the component ''itms.js'' from the table ''Component''. This file is responsible for registering ITunes as a trusted application in Firefox.
        </upgrade>
+
* Drop the argument ''Launch_iTunesHelper'' in the table ''ControlEvent''. This prevents iTunesHelper.exe from being started after the setup finishes. ITunes Helper is responsible for automatically starting ITunes when an iPhone or iPod is being connected to the PC.
        <remove cmd="msiexec.exe /qn /uninstall {EC2A8F27-4FBF-4E41-B27B-FE822511B761}" />
+
* Open the table ''Registry'' and drop the keys ''Registry415'' (adds iTunesHelper.exe to the Windows autorun) and ''Registry835'' to ''Registry843'' (adds the ITunes detector plugin to Firefox and other browsers). Of course the registry IDs may change in future ITunes versions, you can instead search for ''CurrentVersion\Run'' and ''MozillaPlugins'' in the column ''Key'' of the ''Registry'' table.
</package>
+
* Drop the file ''ITDetector.ocx'' from the table SelfReg. This prevents the ITunes detector ActiveX component from being registered, which is otherwise added as a plugin to Internet Explorer.
<package
+
* Click ''Generate Transform'' and save the resulting file into the same folder as the MSI.
        id="applesupport"
+
        name="Apple Software Application Support"
+
        revision="1.0"
+
        reboot="false"
+
        priority="1">
+
  
        <depends package-id="itunes"/>
+
You can disable certain ITunes features via the registry. Apple has a list of everything that you can disable: [http://support.apple.com/kb/ht2102 How to manage iTunes control features]. In the XML code below, only the update check in ITunes is disabled. If you want to disable other features too, look up their hexadecimal numbers at the above link, add them up and write the result as a DWORD value to ''HKLM\SOFTWARE\Apple Computer, Inc.\iTunes\Parental Controls\Default\AdminFlags''. Be aware that you always need to include the "Locked" flag (1) for the settings to take effect.
        <check type="registry"  condition="equals" path="HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{0C34B801-6AEC-4667-B053-03A67E2D0415}\DisplayVersion" value="1.0"/>
+
        <install cmd="msiexec /qn /i %SOFTWARE%\itunes\9.0.0.70\AppleApplicationSupport.msi" />
+
        <upgrade cmd="msiexec /qn /i %SOFTWARE%\itunes\9.0.0.70\AppleApplicationSupport.msi" />
+
        <remove cmd="msiexec /qn /uninstall {0C34B801-6AEC-4667-B053-03A67E2D0415}" />
+
</package>
+
<package
+
        id="quicktime"
+
        name="Apple Quicktime"
+
        revision="7.62.17.73"
+
        reboot="false"
+
        priority="1">
+
  
 +
After ITunes is removed, it does not delete the files in ''%APPDATA%\Apple Computer\iTunes'', ''%USERPROFILE%\Local Settings\Application Data\Apple Computer\iTunes'' and ''%ALLUSERSPROFILE%\Anwendungsdaten\Apple Computer\iTunes''. If you want to remove those directories, you have to specify additional remove commands for WPKG. The same is true for the registry key ''HKCU\Software\Apple Computer, Inc.\iTunes''. The backups of IPhones, songs and applications from the Apple Store are stored outside of those directores!
  
        <depends package-id="itunes"/>
+
=== Quicktime ===
        <check type="file" condition="versiongreaterorequal" path="%PROGRAMFILES%\QuickTime\QuickTimePlayer.exe" value="7.62.17.73"/>
+
* Open QuickTime.msi with Orca, select ''New Transform'' from the main menu.
 +
* Edit the table ''FeatureComponents'' and drop the component ''QuickTimeEssentials.qtx''. This gets rid of the installation of the Quicktime Firefox plugin. The rationale behind this is that the Quicktime plugin is of almost no use anymore because hardly anyone except Apple embeds Quicktime media files into websites. However nowadays one of the main attack vectors and primary source of drive-by installs are security holes in webbrowser plugins (for example the most recent installer of ITunes as of August 2010 contains a Quicktime version that is vulnerable to arbitrary remote code execution). Therefore it is strongly advisable to install as few plugins as possible.
 +
* Drop the condition ''NOT BNEWERPRODUCTISINSTALLED'' from the ''LaunchCondition'' table. This allows you the roll out the MSI via WPKG even if the user already installed a newer version of Quicktime manually.
 +
* Click ''Generate Transform'' and save the resulting file into the same folder as the MSI.
  
        <install cmd="msiexec /qn /i %SOFTWARE%\itunes\9.0.0.70\QuickTime.msi" />
+
Besides the periodic update checks via ''Apple Software Update'', Quicktime additionally performs update checks on its own when you launch it. To disable that behaviour install Quicktime on a test computer, delete the file ''%USERPROFILE%\Local Settings\Application Data\Apple Computer\QuickTime\QuickTime.qtp'' if it exists (adapt the path to your locale), then open the Quicktime settings in the Windows control panel, go to 'Update'', uncheck ''Check for updates automatically'' and click OK. Now copy the recreated file ''%USERPROFILE%\Local Settings\Application Data\Apple Computer\QuickTime\QuickTime.qtp'' (should be below 1kB) to ''%SOFTWARE%\itunes''. To deploy this file the package quicktimesettings is used. It copies ''QuickTime.qtp'' into ''%ALLUSERSPROFILE%\Application Data\Apple Computer\QuickTime'' and adds a registry key ''HKLM\SOFTWARE\Apple Computer, Inc.\QuickTime\LocalUserPreferences\FolderPath'' which points to this directory. '''Caution:''' Quicktime only checks that registry key if the key ''HKCU\SOFTWARE\Apple Computer, Inc.\QuickTime\LocalUserPreferences'' does not exist! If Quicktime is or was ever run without the HKLM-key present, it automatically creates the HKCU-key and then never checks the HKLM-key again.
        <upgrade cmd="msiexec /qn /i %SOFTWARE%\itunes\9.0.0.70\QuickTime.msi" />
+
        <remove cmd="msiexec /qn /uninstall {A429C2AE-EBF1-4F81-A221-1C115CAADDAD}" />
+
</package>
+
<package
+
        id="applemobile"
+
        name="Apple Mobile Device Support"
+
        revision="2.6.0.32"
+
        reboot="false"
+
        priority="1">
+
  
        <depends package-id="itunes"/>
+
After Quicktime is removed, it does not delete the files in ''%APPDATA%\Apple Computer\QuickTime'', ''%USERPROFILE%\Local Settings\Application Data\Apple Computer\QuickTime'' and ''%ALLUSERSPROFILE%\Application Data\Apple Computer\QuickTime''. If you want to remove those directories, you have to specify additional remove commands for WPKG. The same is true for the registry key ''HKCU\Software\Apple Computer, Inc.\QuickTime''.
        <check type="registry"  condition="equals" path="HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AADEA55D-C834-4BCB-98A3-4B8D1C18F4EE}\DisplayVersion" value="2.6.0.32"/>
+
        <install cmd="msiexec /qn /i %SOFTWARE%\itunes\9.0.0.70\AppleMobileDeviceSupport.msi" />
+
        <upgrade cmd="msiexec /qn /i %SOFTWARE%\itunes\9.0.0.70\AppleMobileDeviceSupport.msi" />
+
        <remove cmd="msiexec /qn /uninstall {AADEA55D-C834-4BCB-98A3-4B8D1C18F4EE}" />
+
</package>
+
</source>
+
  
 +
== Package definitions for 9.2.1.5 ==
 +
=== Apple Application Support and Apple Mobile Device Support ===
 +
Copy the package definitions from the full ITunes installation above and use the original MSI files as extracted from iTunesSetup.exe. These packages don't require any modifications.
  
=== 8.2.1.6 ===
+
=== ITunes ===
Deploy File/Folder Structure
+
  %SOFTWARE%\itunes\8.2.1.6\iTunes.msi
+
  %SOFTWARE%\itunes\8.2.1.6\QuickTime.msi
+
  %SOFTWARE%\itunes\8.2.1.6\AppleMobileDeviceSupport.msi
+
 
+
<source lang="xml">
+
<package
+
    id="iTunes"
+
    name="Apple iTunes"
+
    revision="8.2.1.6"
+
    reboot="false"
+
    priority="1">
+
  <check type="file" condition="versiongreaterorequal" path="%PROGRAMFILES%\iTunes\iTunes.exe" value="8.2.1.6"/>
+
  <install cmd="msiexec.exe /qn /norestart /i %SOFTWARE%\iTunes\8.2.1.6\iTunes.msi" />
+
  <upgrade cmd="msiexec.exe /qn /i %SOFTWARE%\iTunes\8.2.1.6\iTunes.msi">
+
  <exit code="3010" reboot="true" />
+
  <exit code="0" />
+
  </upgrade>
+
  <remove cmd="msiexec.exe /qn /uninstall {99ECF41F-5CCA-42BD-B8B8-A8333E2E2944}" />
+
  </package>
+
 
+
<package
+
        id="quicktime"
+
        name="Apple Quicktime"
+
        revision="7.62.14.0"
+
        reboot="false"
+
        priority="1">
+
        <depends package-id="iTunes"/>
+
        <check type="file" condition="versiongreaterorequal" path="%PROGRAMFILES%\QuickTime\QuickTimePlayer.exe" value="7.62.14.0"/>
+
        <install cmd="msiexec /qn /i %SOFTWARE%\iTunes\8.2.1.6\QuickTime.msi" />
+
        <upgrade cmd="msiexec /qn /i %SOFTWARE%\iTunes\8.2.1.6\QuickTime.msi" />
+
        <remove cmd="msiexec /qn /uninstall {C78EAC6F-7A73-452E-8134-DBB2165C5A68}" />
+
</package>
+
 
+
 
+
<package
+
        id="applemobile"
+
        name="Apple Mobile Device Support"
+
        revision="2.5.2.2"
+
        reboot="false"
+
        priority="1">
+
        <depends package-id="iTunes"/>
+
        <check type="registry" condition="equals" path="HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{C337BDAF-CB4E-47E2-BE1A-CB31BB7DD0E3}\DisplayVersion" value="2.5.2.2"/>
+
        <install cmd="msiexec /qn /i %SOFTWARE%\iTunes\8.2.1.6\AppleMobileDeviceSupport.msi" />
+
        <upgrade cmd="msiexec /qn /i %SOFTWARE%\iTunes\8.2.1.6\AppleMobileDeviceSupport.msi" />
+
        <remove cmd="msiexec /qn /uninstall {C337BDAF-CB4E-47E2-BE1A-CB31BB7DD0E3}" />
+
</package>
+
</source>
+
 
+
=== 8.1.0.52 ===
+
Deploy File/Folder Structure
+
  %SOFTWARE%\itunes\8.1.0.52\iTunes.msi
+
  %SOFTWARE%\itunes\8.1.0.52\QuickTime.msi
+
  %SOFTWARE%\itunes\8.1.0.52\AppleMobileDeviceSupport.msi
+
 
+
 
<source lang="xml">
 
<source lang="xml">
<package id="iTunes"  
+
<?xml version="1.0" encoding="UTF-8"?>
name="Apple iTunes"
+
<package id='itunes' name='Apple iTunes' revision='9.2.1.5' reboot='false' priority='1'>
revision="8.1.0.51"
+
<depends package-id='appleapplication' />
reboot="false"
+
<depends package-id='quicktime' />
priority="198">       >
+
  
<check type="file" condition="versiongreaterorequal" path="%PROGRAMFILES%\iTunes\iTunes.exe" value="8.1.0.52"/>
+
<check type='uninstall' condition='exists' path='iTunes' />
<install cmd="msiexec.exe /qn /norestart /i %SOFTWARE%\iTunes\8.1.0.52\iTunes.msi">
+
<check type='file' condition='versiongreaterorequal' path='%PROGRAMFILES%\iTunes\iTunes.exe' value='9.2.1.5' />
  <exit code="3010" />
+
        </install>
+
<!-- DESKTOP_SHORTCUTS=0: Don't create desktop shortcuts
 
+
MEDIA_DEFAULTS=0: Don't make ITunes the default program for Audio CDs and various audio filetypes
<upgrade cmd="msiexec.exe /qn /norestart /i %SOFTWARE%\iTunes\8.1.0.52\iTunes.msi" />
+
SCHEDULE_ASUW=0: Don't create a scheduled task to automatically search for ITunes updates
<remove cmd="msiexec.exe /qn /norestart /uninstall {F4D6C3EB-304E-4B0C-8BCE-F6B9E974CD17}" />
+
REENABLEAUTORUN=0: Don't try to re-enable Windows autorun feature for CDs -->
</package>
+
<install cmd='msiexec.exe /i "%SOFTWARE%\itunes\iTunes.msi" TRANSFORMS="%SOFTWARE%\itunes\itunes-transform-from-above.mst" DESKTOP_SHORTCUTS=0 MEDIA_DEFAULTS=0 SCHEDULE_ASUW=0 REENABLEAUTORUN=0 /passive /norestart' timeout='300'>
 
+
<exit code='0' />
<package
+
<exit code='3010' reboot='postponed' />
id="quicktime"
+
</install>
name="Apple Quicktime"
+
<!-- Disable update feature in ITunes via parental controls -->
revision="7.60.92.0"
+
<install cmd='reg add "HKLM\SOFTWARE\Apple Computer, Inc.\iTunes\Parental Controls\Default" /v "AdminFlags" /t REG_DWORD /d "0x101" /f' timeout='60' />
reboot="false"
+
priority="198">
+
<upgrade cmd='msiexec.exe /i "%SOFTWARE%\itunes\iTunes.msi" TRANSFORMS="%SOFTWARE%\itunes\itunes-transform-from-above.mst" DESKTOP_SHORTCUTS=0 MEDIA_DEFAULTS=0 SCHEDULE_ASUW=0 REENABLEAUTORUN=0 /passive /norestart'>
+
<exit code='0' />
<depends package-id="iTunes"/>
+
<exit code='3010' reboot='postponed' />
<check type="file" condition="versiongreaterorequal" path="%PROGRAMFILES%\QuickTime\QuickTimePlayer.exe" value="7.60.92.0"/>
+
</upgrade>
<install cmd="msiexec /qn /i %SOFTWARE%\iTunes\8.1.0.52\QuickTime.msi" />
+
<upgrade cmd='reg add "HKLM\SOFTWARE\Apple Computer, Inc.\iTunes\Parental Controls\Default" /v "AdminFlags" /t REG_DWORD /d "0x101" /f' timeout='60' />
<upgrade cmd="msiexec /qn /i %SOFTWARE%\iTunes\8.1.0.52\QuickTime.msi" />
+
<remove cmd="msiexec /qn /uninstall {216AB108-2AE1-4130-B3D5-20B2C4C80F8F}" />
+
<remove cmd='msiexec.exe /x {91F7F3F3-CE80-48C3-8327-7D24A0A5716A} /passive /norestart' timeout='300'>
</package>
+
<exit code='0' />
 
+
<exit code='1605' />
<package
+
<exit code='3010' reboot='postponed' />
id="applemobile"
+
</remove>
name="Apple Mobile Device Support"
+
revision="2.4.0.27"
+
reboot="false"
+
priority="198">
+
+
<depends package-id="iTunes"/>
+
<check type="registry"  condition="equals" path="HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{162B71B8-8464-4680-A086-601D555B331D}\DisplayVersion" value="2.4.0.27"/>
+
<install cmd="msiexec /qn /i %SOFTWARE%\iTunes\8.1.0.52\AppleMobileDeviceSupport.msi" />
+
<upgrade cmd="msiexec /qn /i %SOFTWARE%\iTunes\8.1.0.52\AppleMobileDeviceSupport.msi" />
+
<remove cmd="msiexec /qn /uninstall {162B71B8-8464-4680-A086-601D555B331D}" />
+
 
</package>
 
</package>
 
</source>
 
</source>
  
 
+
=== Quicktime ===
=== 8.0.2.20 ===
+
The Quicktime installer package is grouped into multiple features (categories). For reasons that are left to the imagination of the reader, Apple prevents the user from deselecting any of those features through the GUI. However by using the ''ADDLOCAL'' switch, it is possible to specify which features should be installed. To use the audio and video playback capabilites of Quicktime, only the feature ''QuickTimeEssentials'' is necessary.
Deploy File/Folder Structure
+
The other features as of version 7.67 are: QuickTimeInternet, QuickTimeImage, QuickTimeEffects, QuickTimeMusic, QuickTimeAuthoring, QuickTimeCapture, QuickTimeForJava, QuickTimeDiagnostics, QuickTimeProResDecoder. None of them is necessary to run ITunes, therefore they are all excluded. Be aware that ''QuickTimeInternet'' includes the Quicktime plugin for the Internet Explorer (see above for possible security implications when installing this feature).
  %SOFTWARE%\itunes\8.0.2.20\iTunes.msi
+
  %SOFTWARE%\itunes\8.0.2.20\QuickTime.msi
+
  %SOFTWARE%\itunes\8.0.2.20\AppleMobileDeviceSupport.msi
+
  
 
<source lang="xml">
 
<source lang="xml">
<package
+
<?xml version="1.0" encoding="UTF-8"?>
id="itunes"
+
<package id='quicktime' name='Apple QuickTime' revision='7.67.75.0' reboot='false' priority='1'>
name="Apple iTunes"
+
<chain package-id='quicktimesettings' />
revision="8.0.2.20"
+
reboot="false"
+
priority="1">
+
 
 
<check type="file" condition="versiongreaterorequal" path="%PROGRAMFILES%\iTunes\iTunes.exe" value="8.0.2.20"/>
+
<check type='uninstall' condition='exists' path='QuickTime' />
 
+
<check type='file' condition='versiongreaterorequal' path='%PROGRAMFILES%\QuickTime\QuickTimePlayer.exe' value='7.67.75.0' />
<install cmd="msiexec.exe /qn /norestart /i %SOFTWARE%\itunes\8.0.2.20\iTunes.msi" />
+
<upgrade cmd="msiexec.exe /qn /norestart /i %SOFTWARE%\itunes\8.0.2.20\iTunes.msi" />
+
<!-- ADDLOCAL=QuickTimeEssentials: Only install the main feature of Quicktime -->
<remove cmd="msiexec.exe /qn /uninstall {318AB667-3230-41B5-A617-CB3BF748D371}" />
+
<install cmd='msiexec /i "%SOFTWARE%\itunes\QuickTime.msi" TRANSFORMS="%SOFTWARE%\itunes\quicktime-transform-from-above.mst" ADDLOCAL=QuickTimeEssentials DESKTOP_SHORTCUTS=0 SCHEDULE_ASUW=0 /passive /norestart' timeout='300'>
 +
<exit code='0' />
 +
<exit code='3010' reboot='postponed' />
 +
</install>
 +
 +
<upgrade cmd='msiexec /i "%SOFTWARE%\itunes\QuickTime.msi" TRANSFORMS="%SOFTWARE%\itunes\quicktime-transform-from-above.mst" ADDLOCAL=QuickTimeEssentials DESKTOP_SHORTCUTS=0 SCHEDULE_ASUW=0 /passive /norestart' timeout='300'>
 +
<exit code='0' />
 +
<exit code='3010' reboot='postponed' />
 +
</upgrade>
 +
 +
<remove cmd='msiexec /x {EB900AF8-CC61-4E15-871B-98D1EA3E8025} /passive /norestart' timeout='300'>
 +
<exit code='0' />
 +
<exit code='1605' />
 +
<exit code='3010' reboot='postponed' />
 +
</remove>
 
</package>
 
</package>
<package
 
id="quicktime"
 
name="Apple Quicktime"
 
revision="7.55.90.70"
 
reboot="false"
 
priority="1">
 
  
 +
<package id='quicktimesettings' name='Apple QuickTime settings' revision='1' notify='false' reboot='false' priority='1'>
 +
<!-- Adapt the paths to your locale -->
 +
<check type='registry' condition='equals' path='HKLM\SOFTWARE\Apple Computer, Inc.\QuickTime\LocalUserPreferences\FolderPath' value='C:\Documents and Settings\All Users\Application Data\Apple Computer\QuickTime\' />
 +
<check type='file' condition='exists' path='%ALLUSERSPROFILE%\Application Data\Apple Computer\QuickTime\QuickTime.qtp' />
  
<depends package-id="itunes"/>
+
<install cmd='%COMSPEC% /C if exist "%ALLUSERSPROFILE%\Application Data" xcopy /y /v "%SOFTWARE%\itunes\QuickTime.qtp" "%ALLUSERSPROFILE%\Application Data\Apple Computer\QuickTime"' timeout='60' />
<check type="file" condition="versiongreaterorequal" path="%PROGRAMFILES%\QuickTime\QuickTimePlayer.exe" value="7.55.90.70"/>
+
<install cmd='%COMSPEC% /C if exist "%ALLUSERSPROFILE%\Application Data" reg.exe add "HKLM\SOFTWARE\Apple Computer, Inc.\QuickTime\LocalUserPreferences" /v "FolderPath" /d "%ALLUSERSPROFILE%\Application Data\Apple Computer\QuickTime\\" /f' timeout='60' />
<install cmd="msiexec /qn /i %SOFTWARE%\itunes\8.0.2.20\QuickTime.msi" />
+
<upgrade cmd="msiexec /qn /i %SOFTWARE%\itunes\8.0.2.20\QuickTime.msi" />
+
<remove cmd="msiexec /qn /uninstall {8DC42D05-680B-41B0-8878-6C14D24602DB}" />
+
</package>
+
<package
+
id="applemobile"
+
name="Apple Mobile Device Support"
+
revision="2.1.2.7"
+
reboot="false"
+
priority="1">
+
  
<depends package-id="itunes"/>
+
<upgrade cmd='%COMSPEC% /C if exist "%ALLUSERSPROFILE%\Application Data" xcopy /y /v "%SOFTWARE%\itunes\QuickTime.qtp" "%ALLUSERSPROFILE%\Application Data\Apple Computer\QuickTime"' timeout='60' />
<check type="registry"  condition="equals" path="HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{EC4455AB-F155-4CC1-A4C5-88F3777F9886}\DisplayVersion" value="2.1.2.7"/>
+
<upgrade cmd='%COMSPEC% /C if exist "%ALLUSERSPROFILE%\Application Data" reg.exe add "HKLM\SOFTWARE\Apple Computer, Inc.\QuickTime\LocalUserPreferences" /v "FolderPath" /d "%ALLUSERSPROFILE%\Application Data\Apple Computer\QuickTime\\" /f' timeout='60' />
<install cmd="msiexec /qn /i %SOFTWARE%\itunes\8.0.2.20\AppleMobileDeviceSupport.msi" />
+
<upgrade cmd="msiexec /qn /i %SOFTWARE%\itunes\8.0.2.20\AppleMobileDeviceSupport.msi" />
+
<remove cmd="msiexec /qn /uninstall {EC4455AB-F155-4CC1-A4C5-88F3777F9886}" />
+
</package>
+
</source>
+
  
=== 8.0.1.11 ===
+
<remove cmd='%COMSPEC% /C del "%ALLUSERSPROFILE%\Application Data\Apple Computer\QuickTime\QuickTime.qtp"' timeout='60'>
Deploy File/Folder Structure
+
<exit code='0' />
  %SOFTWARE%\itunes\8.0.1.11\iTunes.msi
+
<exit code='1' />
  %SOFTWARE%\itunes\8.0.1.11\QuickTime.msi
+
</remove>
  %SOFTWARE%\itunes\8.0.1.11\AppleMobileDeviceSupport.msi
+
<remove cmd='reg.exe delete "HKLM\SOFTWARE\Apple Computer, Inc.\QuickTime\LocalUserPreferences" /f' timeout='60'>
 
+
<exit code='0' />
<source lang="xml">
+
<exit code='1' />
<package
+
</remove>
id="itunes"
+
name="Apple iTunes"
+
revision="8.0.1.11"
+
reboot="false"
+
priority="1">
+
+
<check type="file" condition="versiongreaterorequal" path="%PROGRAMFILES%\iTunes\iTunes.exe" value="8.0.1.11"/>
+
 
+
<install cmd="msiexec.exe /qn /norestart /i %SOFTWARE%\itunes\8.0.1.11\iTunes.msi" />
+
<upgrade cmd="msiexec.exe /qn /norestart /i %SOFTWARE%\itunes\8.0.1.11\iTunes.msi" />
+
<remove cmd="msiexec.exe /qn /uninstall {DDDE0BE3-0CBE-4BF6-B75A-E3F69C947843}" />
+
 
</package>
 
</package>
<package
 
id="quicktime"
 
name="Apple Quicktime"
 
revision="7.55.90.70"
 
reboot="false"
 
priority="1">
 
  
 
<depends package-id="itunes"/>
 
<check type="file" condition="versiongreaterorequal" path="%PROGRAMFILES%\QuickTime\QuickTimePlayer.exe" value="7.55.90.70"/>
 
<install cmd="msiexec /qn /i %SOFTWARE%\itunes\8.0.1.11\QuickTime.msi" />
 
<upgrade cmd="msiexec /qn /i %SOFTWARE%\itunes\8.0.1.11\QuickTime.msi" />
 
<remove cmd="msiexec /qn /uninstall {8DC42D05-680B-41B0-8878-6C14D24602DB}" />
 
</package>
 
<package
 
id="applemobile"
 
name="Apple Mobile Device Support"
 
revision="2.1.1.13"
 
reboot="false"
 
priority="1">
 
 
<depends package-id="itunes"/>
 
<check type="registry"  condition="equals" path="HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{976C2B2A-CE59-4AB3-83FB-BF895E28F2E6}\DisplayVersion" value="2.1.1.13"/>
 
<install cmd="msiexec /qn /i %SOFTWARE%\itunes\8.0.1.11\AppleMobileDeviceSupport.msi" />
 
<upgrade cmd="msiexec /qn /i %SOFTWARE%\itunes\8.0.1.11\AppleMobileDeviceSupport.msi" />
 
<remove cmd="msiexec /qn /uninstall {976C2B2A-CE59-4AB3-83FB-BF895E28F2E6}" />
 
</package>
 
 
</source>
 
</source>
  
 
[[Category:Silent Installers]]
 
[[Category:Silent Installers]]

Revision as of 15:32, 19 August 2010

General Information

Apple iTunes is primarily a program to play different types of media, but it is also required if you want to backup an IPhone or sync your emails, notes, bookmarks etc over USB with your PC. ITunes comes bundled with multiple sub programs that are all automatically installed when running the regular ITunes setup wizard. However depending on your use case you don't actually need all of them. Therefore this page is divided into two subparts: On the one hand a full blown ITunes installation (excluding Apple Software Update) when you actually want to use ITunes and Quicktime as an audio and video player, image viewer, podcast streamer, etc and on the other hand a minimal ITunes installation if you only want to use it to snc/backup an IPhone.

ITunes is one of the programs that are more difficult to package, since Apple is using it as a vehicle to distribute their other software. To get rid of at least some of those "extra" programs additional configuration steps are necessary to perform.

Pre-Setup Process

The ITunes installer consists of multiple MSI packages for each of its sub programs and a runtime that executes those MSI packages one after the other. To extract the MSI files do the following:

  • Download the ITunes setup file from Apple (usually called iTunesSetup.exe)
  • Open the file with 7zip or another file archiver
  • Extract iTunes.msi, QuickTime.msi, AppleApplicationSupport.msi and AppleMobileDeviceSupport.msi

Notes

  • Apple Mobile Device Support is only necessary if you want to connect an Ipod or IPhone. Quicktime and Apple Application Support are mandatory to be able to run ITunes.
  • Each sub-application has its own version. When a new version for ITunes comes out, you will need to extract the MSI packages, right click on them and check their version under file info to see which sub programs have updated. Each sub program has its own WPKG package definition with separate install, upgrade and uninstall commands.
  • If you insist on also having the latest available version of Apple Application Support you'll have to download every installer from the Apple website and check which one contains the latest version of the Apple Application Support.
  • Apple is known to sometimes modify the setup packages of their programs even at minor version changes, so do not blindly assume that a new ITunes installer will work the same way as the old one did!
  • The version of Quicktime that is bundled with ITunes is not necessarily the newest version available and may contain known security flaws. If this is the case, you will have to download the standalone Quicktime installer from Apple and extract the file QuickTime.msi from there.
  • There is a 64bit version of ITunes available too. As of version 9.2.1.5 the 64bit installer contains 64bit versions of ITunes itself and Apple Mobile Device Support and 32bit versions of Quicktime and Apple Application Support. If you have package definition for the 64bit versions feel free to add them to the wiki.

Full ITunes installation

If you update this code, please remember the GUIDs change on each new version installed!

9.2.1.5

Warning: The installer of ITunes 9.2.1.5 contains Quicktime 7.66 which has a highly critical security flaw that allows for remote execution of arbitrary code, simply by visiting a webpage (secunia.com). You have to download the standalone Quicktime installer instead and extract the version 7.67 of QuickTime.msi. Alternatively you can use the minimal ITunes installation method below, which removes the Quicktime browser plugin completely.

Deploy File/Folder Structure

 %SOFTWARE%\itunes\iTunes.msi
 %SOFTWARE%\itunes\QuickTime.msi
 %SOFTWARE%\itunes\AppleMobileDeviceSupport.msi
 %SOFTWARE%\itunes\AppleApplicationSupport.msi
<?xml version="1.0" encoding="UTF-8"?>
<!-- Version 1.3.0 has the same GUID -->
<package id='appleapplicationsupport' name='Apple Application Support' revision='1.3.1' reboot='false' priority='1'>
	<check type='registry' condition='equals' path='HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{B2D328BE-45AD-4D92-96F9-2151490A203E}\DisplayVersion' value='1.3.1' />

	<install cmd='msiexec /i "%SOFTWARE%\itunes\AppleApplicationSupport.msi" /passive /norestart' timeout='300'>
		<exit code='0' />
		<exit code='3010' reboot='postponed' />
	</install>
		

	<upgrade cmd='msiexec /i "%SOFTWARE%\itunes\AppleApplicationSupport.msi" /passive /norestart' timeout='300'>
		<exit code='0' />
		<exit code='3010' reboot='postponed' />
	</upgrade>

	<remove cmd='msiexec /x {B2D328BE-45AD-4D92-96F9-2151490A203E /passive /norestart' timeout='300'>
		<exit code='0' />
		<exit code='1605' />
		<exit code='3010' reboot='postponed' />
	</remove>
</package>
<package id='applemobilesupport' name='Apple Mobile Device Support' revision='3.1.0.62' reboot='false' priority='1'>
	<check type='registry' condition='equals' path='HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{85991ED2-010C-4930-96FA-53F43C2CE98A}\DisplayVersion' value='3.1.0.62' />

	<install cmd='msiexec /i "%SOFTWARE%\itunes\AppleMobileDeviceSupport.msi" /passive /norestart' timeout='300'>
		<exit code='0' />
		<exit code='3010' reboot='postponed' />
	</install>

	<upgrade cmd='msiexec /i "%SOFTWARE%\itunes\AppleMobileDeviceSupport.msi" /passive /norestart' timeout='300'>
		<exit code='0' />
		<exit code='3010' reboot='postponed' />
	</upgrade>
	<remove cmd='msiexec /x {85991ED2-010C-4930-96FA-52F43C2CE98A} /passive /norestart' timeout='300'>		
		<exit code='0' />
		<exit code='1605' />
		<exit code='3010' reboot='postponed' />
	</remove>
</package>
<package id='itunes' name='Apple iTunes' revision='9.2.1.5' reboot='false' priority='1'>
	<depends package-id='appleapplication' />
	<depends package-id='quicktime' />

	<check type='uninstall' condition='exists' path='iTunes' />
	<check type='file' condition='versiongreaterorequal' path='%PROGRAMFILES%\iTunes\iTunes.exe' value='9.2.1.5' />
	
	<install cmd='msiexec.exe /i "%SOFTWARE%\itunes\iTunes.msi" SCHEDULE_ASUW=0 /passive /norestart' timeout='300'>
		<exit code='0' />
		<exit code='3010' reboot='postponed' />
	</install>
	<!-- Disable update feature in ITunes via parental controls -->
	<install cmd='reg add "HKLM\SOFTWARE\Apple Computer, Inc.\iTunes\Parental Controls\Default" /v "AdminFlags" /t REG_DWORD /d "0x101" /f' timeout='60' />
	
	<upgrade cmd='msiexec.exe /i "%SOFTWARE%\itunes\iTunes.msi" SCHEDULE_ASUW=0 /passive /norestart'>
		<exit code='0' />
		<exit code='3010' reboot='postponed' />
	</upgrade>
	<upgrade cmd='reg add "HKLM\SOFTWARE\Apple Computer, Inc.\iTunes\Parental Controls\Default" /v "AdminFlags" /t REG_DWORD /d "0x101" /f' timeout='60' />
	
	<remove cmd='msiexec.exe /x {91F7F3F3-CE80-48C3-8327-7D24A0A5716A} /passive /norestart' timeout='300'>
		<exit code='0' />
		<exit code='1605' />
		<exit code='3010' reboot='postponed' />
	</remove>
</package>
<package id='quicktime' name='Apple QuickTime' revision='7.67.75.0' reboot='false' priority='1'>
	<check type='uninstall' condition='exists' path='QuickTime' />
	<check type='file' condition='versiongreaterorequal' path='%PROGRAMFILES%\QuickTime\QuickTimePlayer.exe' value='7.67.75.0' />
		
	<install cmd='msiexec /i "%SOFTWARE%\itunes\QuickTime.msi" SCHEDULE_ASUW=0 /passive /norestart' timeout='300'>
		<exit code='0' />
		<exit code='3010' reboot='postponed' />
	</install>
		
	<upgrade cmd='msiexec /i "%SOFTWARE%\itunes\QuickTime.msi" SCHEDULE_ASUW=0 /passive /norestart' timeout='300'>
		<exit code='0' />
		<exit code='3010' reboot='postponed' />
	</upgrade>
	
	<remove cmd='msiexec /x {EB900AF8-CC61-4E15-871B-98D1EA3E8025} /passive /norestart' timeout='300'>
		<exit code='0' />
		<exit code='1605' />
		<exit code='3010' reboot='postponed' />
	</remove>
</package>


Minimal ITunes installation

The goal of this setup is to get

  1. a working installation of ITunes which allows you to activate, backup and sync an IPhone or Ipod, download and install new iOS versions and optionally get songs/apps from the Apple Store,
  2. but does otherwise interfere with the PC as little as possible. Specifically this means: No Quicktime browser plugins, no Quicktime Java libraries, no automatic update checks, no desktop shortcuts, no automatic file type associations with Quicktime or ITunes, no ITunes CD grabbing, no unecessary background services, no autostart entries, no Quicktime picture viewer, no task icons.

These package definitions are suited for someone who has to roll out ITunes in a corporate environment because the employees are using IPhones, but otherwise has no use case for ITunes and/or Quicktime at all. Of course all steps in this section is optional, if you don't want to leave a certain feature out, then simply omit the corresponding step.

Configuration

Not all necessary changes to the setup packages can be made at the command line level, therefore the MSI files have to be modified. For this the Microsoft tool Orca (freeware) is necessary. If you don't have Orca yet, download it from Microsoft.

ITunes

  • Open iTunes.msi, select New Transform from the main menu.
  • Drop the component itms.js from the table Component. This file is responsible for registering ITunes as a trusted application in Firefox.
  • Drop the argument Launch_iTunesHelper in the table ControlEvent. This prevents iTunesHelper.exe from being started after the setup finishes. ITunes Helper is responsible for automatically starting ITunes when an iPhone or iPod is being connected to the PC.
  • Open the table Registry and drop the keys Registry415 (adds iTunesHelper.exe to the Windows autorun) and Registry835 to Registry843 (adds the ITunes detector plugin to Firefox and other browsers). Of course the registry IDs may change in future ITunes versions, you can instead search for CurrentVersion\Run and MozillaPlugins in the column Key of the Registry table.
  • Drop the file ITDetector.ocx from the table SelfReg. This prevents the ITunes detector ActiveX component from being registered, which is otherwise added as a plugin to Internet Explorer.
  • Click Generate Transform and save the resulting file into the same folder as the MSI.

You can disable certain ITunes features via the registry. Apple has a list of everything that you can disable: How to manage iTunes control features. In the XML code below, only the update check in ITunes is disabled. If you want to disable other features too, look up their hexadecimal numbers at the above link, add them up and write the result as a DWORD value to HKLM\SOFTWARE\Apple Computer, Inc.\iTunes\Parental Controls\Default\AdminFlags. Be aware that you always need to include the "Locked" flag (1) for the settings to take effect.

After ITunes is removed, it does not delete the files in %APPDATA%\Apple Computer\iTunes, %USERPROFILE%\Local Settings\Application Data\Apple Computer\iTunes and %ALLUSERSPROFILE%\Anwendungsdaten\Apple Computer\iTunes. If you want to remove those directories, you have to specify additional remove commands for WPKG. The same is true for the registry key HKCU\Software\Apple Computer, Inc.\iTunes. The backups of IPhones, songs and applications from the Apple Store are stored outside of those directores!

Quicktime

  • Open QuickTime.msi with Orca, select New Transform from the main menu.
  • Edit the table FeatureComponents and drop the component QuickTimeEssentials.qtx. This gets rid of the installation of the Quicktime Firefox plugin. The rationale behind this is that the Quicktime plugin is of almost no use anymore because hardly anyone except Apple embeds Quicktime media files into websites. However nowadays one of the main attack vectors and primary source of drive-by installs are security holes in webbrowser plugins (for example the most recent installer of ITunes as of August 2010 contains a Quicktime version that is vulnerable to arbitrary remote code execution). Therefore it is strongly advisable to install as few plugins as possible.
  • Drop the condition NOT BNEWERPRODUCTISINSTALLED from the LaunchCondition table. This allows you the roll out the MSI via WPKG even if the user already installed a newer version of Quicktime manually.
  • Click Generate Transform and save the resulting file into the same folder as the MSI.

Besides the periodic update checks via Apple Software Update, Quicktime additionally performs update checks on its own when you launch it. To disable that behaviour install Quicktime on a test computer, delete the file %USERPROFILE%\Local Settings\Application Data\Apple Computer\QuickTime\QuickTime.qtp if it exists (adapt the path to your locale), then open the Quicktime settings in the Windows control panel, go to 'Update, uncheck Check for updates automatically and click OK. Now copy the recreated file %USERPROFILE%\Local Settings\Application Data\Apple Computer\QuickTime\QuickTime.qtp (should be below 1kB) to %SOFTWARE%\itunes. To deploy this file the package quicktimesettings is used. It copies QuickTime.qtp into %ALLUSERSPROFILE%\Application Data\Apple Computer\QuickTime and adds a registry key HKLM\SOFTWARE\Apple Computer, Inc.\QuickTime\LocalUserPreferences\FolderPath which points to this directory. Caution: Quicktime only checks that registry key if the key HKCU\SOFTWARE\Apple Computer, Inc.\QuickTime\LocalUserPreferences does not exist! If Quicktime is or was ever run without the HKLM-key present, it automatically creates the HKCU-key and then never checks the HKLM-key again.

After Quicktime is removed, it does not delete the files in %APPDATA%\Apple Computer\QuickTime, %USERPROFILE%\Local Settings\Application Data\Apple Computer\QuickTime and %ALLUSERSPROFILE%\Application Data\Apple Computer\QuickTime. If you want to remove those directories, you have to specify additional remove commands for WPKG. The same is true for the registry key HKCU\Software\Apple Computer, Inc.\QuickTime.

Package definitions for 9.2.1.5

Apple Application Support and Apple Mobile Device Support

Copy the package definitions from the full ITunes installation above and use the original MSI files as extracted from iTunesSetup.exe. These packages don't require any modifications.

ITunes

<?xml version="1.0" encoding="UTF-8"?>
<package id='itunes' name='Apple iTunes' revision='9.2.1.5' reboot='false' priority='1'>
	<depends package-id='appleapplication' />
	<depends package-id='quicktime' />

	<check type='uninstall' condition='exists' path='iTunes' />
	<check type='file' condition='versiongreaterorequal' path='%PROGRAMFILES%\iTunes\iTunes.exe' value='9.2.1.5' />
	
	<!-- DESKTOP_SHORTCUTS=0: Don't create desktop shortcuts
	MEDIA_DEFAULTS=0: Don't make ITunes the default program for Audio CDs and various audio filetypes
	SCHEDULE_ASUW=0: Don't create a scheduled task to automatically search for ITunes updates
	REENABLEAUTORUN=0: Don't try to re-enable Windows autorun feature for CDs -->
	<install cmd='msiexec.exe /i "%SOFTWARE%\itunes\iTunes.msi" TRANSFORMS="%SOFTWARE%\itunes\itunes-transform-from-above.mst" DESKTOP_SHORTCUTS=0 MEDIA_DEFAULTS=0 SCHEDULE_ASUW=0 REENABLEAUTORUN=0 /passive /norestart' timeout='300'>
		<exit code='0' />
		<exit code='3010' reboot='postponed' />
	</install>
	<!-- Disable update feature in ITunes via parental controls -->
	<install cmd='reg add "HKLM\SOFTWARE\Apple Computer, Inc.\iTunes\Parental Controls\Default" /v "AdminFlags" /t REG_DWORD /d "0x101" /f' timeout='60' />
	
	<upgrade cmd='msiexec.exe /i "%SOFTWARE%\itunes\iTunes.msi" TRANSFORMS="%SOFTWARE%\itunes\itunes-transform-from-above.mst" DESKTOP_SHORTCUTS=0 MEDIA_DEFAULTS=0 SCHEDULE_ASUW=0 REENABLEAUTORUN=0 /passive /norestart'>
		<exit code='0' />
		<exit code='3010' reboot='postponed' />
	</upgrade>
	<upgrade cmd='reg add "HKLM\SOFTWARE\Apple Computer, Inc.\iTunes\Parental Controls\Default" /v "AdminFlags" /t REG_DWORD /d "0x101" /f' timeout='60' />
	
	<remove cmd='msiexec.exe /x {91F7F3F3-CE80-48C3-8327-7D24A0A5716A} /passive /norestart' timeout='300'>
		<exit code='0' />
		<exit code='1605' />
		<exit code='3010' reboot='postponed' />
	</remove>
</package>

Quicktime

The Quicktime installer package is grouped into multiple features (categories). For reasons that are left to the imagination of the reader, Apple prevents the user from deselecting any of those features through the GUI. However by using the ADDLOCAL switch, it is possible to specify which features should be installed. To use the audio and video playback capabilites of Quicktime, only the feature QuickTimeEssentials is necessary. The other features as of version 7.67 are: QuickTimeInternet, QuickTimeImage, QuickTimeEffects, QuickTimeMusic, QuickTimeAuthoring, QuickTimeCapture, QuickTimeForJava, QuickTimeDiagnostics, QuickTimeProResDecoder. None of them is necessary to run ITunes, therefore they are all excluded. Be aware that QuickTimeInternet includes the Quicktime plugin for the Internet Explorer (see above for possible security implications when installing this feature).

<?xml version="1.0" encoding="UTF-8"?>
<package id='quicktime' name='Apple QuickTime' revision='7.67.75.0' reboot='false' priority='1'>
	<chain package-id='quicktimesettings' />
	
	<check type='uninstall' condition='exists' path='QuickTime' />
	<check type='file' condition='versiongreaterorequal' path='%PROGRAMFILES%\QuickTime\QuickTimePlayer.exe' value='7.67.75.0' />
	
	<!-- ADDLOCAL=QuickTimeEssentials: Only install the main feature of Quicktime -->
	<install cmd='msiexec /i "%SOFTWARE%\itunes\QuickTime.msi" TRANSFORMS="%SOFTWARE%\itunes\quicktime-transform-from-above.mst" ADDLOCAL=QuickTimeEssentials DESKTOP_SHORTCUTS=0 SCHEDULE_ASUW=0 /passive /norestart' timeout='300'>
		<exit code='0' />
		<exit code='3010' reboot='postponed' />
	</install>
		
	<upgrade cmd='msiexec /i "%SOFTWARE%\itunes\QuickTime.msi" TRANSFORMS="%SOFTWARE%\itunes\quicktime-transform-from-above.mst" ADDLOCAL=QuickTimeEssentials DESKTOP_SHORTCUTS=0 SCHEDULE_ASUW=0 /passive /norestart' timeout='300'>
		<exit code='0' />
		<exit code='3010' reboot='postponed' />
	</upgrade>
	
	<remove cmd='msiexec /x {EB900AF8-CC61-4E15-871B-98D1EA3E8025} /passive /norestart' timeout='300'>
		<exit code='0' />
		<exit code='1605' />
		<exit code='3010' reboot='postponed' />
	</remove>
</package>

<package id='quicktimesettings' name='Apple QuickTime settings' revision='1' notify='false' reboot='false' priority='1'>
	<!-- Adapt the paths to your locale -->
	<check type='registry' condition='equals' path='HKLM\SOFTWARE\Apple Computer, Inc.\QuickTime\LocalUserPreferences\FolderPath' value='C:\Documents and Settings\All Users\Application Data\Apple Computer\QuickTime\' />
	<check type='file' condition='exists' path='%ALLUSERSPROFILE%\Application Data\Apple Computer\QuickTime\QuickTime.qtp' />

	<install cmd='%COMSPEC% /C if exist "%ALLUSERSPROFILE%\Application Data" xcopy /y /v "%SOFTWARE%\itunes\QuickTime.qtp" "%ALLUSERSPROFILE%\Application Data\Apple Computer\QuickTime"' timeout='60' />
	<install cmd='%COMSPEC% /C if exist "%ALLUSERSPROFILE%\Application Data" reg.exe add "HKLM\SOFTWARE\Apple Computer, Inc.\QuickTime\LocalUserPreferences" /v "FolderPath" /d "%ALLUSERSPROFILE%\Application Data\Apple Computer\QuickTime\\" /f' timeout='60' />

	<upgrade cmd='%COMSPEC% /C if exist "%ALLUSERSPROFILE%\Application Data" xcopy /y /v "%SOFTWARE%\itunes\QuickTime.qtp" "%ALLUSERSPROFILE%\Application Data\Apple Computer\QuickTime"' timeout='60' />
	<upgrade cmd='%COMSPEC% /C if exist "%ALLUSERSPROFILE%\Application Data" reg.exe add "HKLM\SOFTWARE\Apple Computer, Inc.\QuickTime\LocalUserPreferences" /v "FolderPath" /d "%ALLUSERSPROFILE%\Application Data\Apple Computer\QuickTime\\" /f' timeout='60' />

	<remove cmd='%COMSPEC% /C del "%ALLUSERSPROFILE%\Application Data\Apple Computer\QuickTime\QuickTime.qtp"' timeout='60'>
		<exit code='0' />
		<exit code='1' />
	</remove>
	<remove cmd='reg.exe delete "HKLM\SOFTWARE\Apple Computer, Inc.\QuickTime\LocalUserPreferences" /f' timeout='60'>
		<exit code='0' />
		 <exit code='1' />
	</remove>
</package>