ITunes

From WPKG | Open Source Software Deployment and Distribution
Jump to: navigation, search

Contents

[edit] 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 as an audio and video player, podcast streamer, etc and on the other hand a minimal ITunes installation if you only want to use it to sync/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. Please read the instructions carefully, because some things here dont work as you would assume. Don't blindly copy and paste the XML code.

[edit] 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:

[edit] Notes

[edit] Full iTunes 10.4.0.80 installation in VBS

' Directory folder %Software\iTunes, the script requires that the *.vbs file is located the same place as all *.msi files. If you have SCCM, you can distribute this script as a package.

Set WshShell = WScript.CreateObject("WScript.Shell") 
Set objFSO = CreateObject("Scripting.FileSystemObject") 
strScriptFileDirectory = objFSO.GetParentFolderName(wscript.ScriptFullName) 

' Create Transform for iTunes with orca or another msi editor, to make iTunes more "admin" friendly for distribution in company networks. A "how to" is described under the item iTunes.

WshShell.Run "msiexec /I AppleApplicationSupport.msi /q /norestart", 0, true
WshShell.Run "msiexec /I Bonjour.msi /q /norestart", 0, true
WshShell.Run "msiexec /I AppleMobileDeviceSupport.msi /q /norestart", 0, true
WshShell.Run "msiexec /I itunes.msi TRANSFORMS=itunes.mst /q /norestart", 0, true
WshShell.Run "msiexec /I quicktime.msi DESKTOP_SHORTCUTS=0 SCHEDULE_ASUW=0 REENABLEAUTORUN=0 /q /norestart", 0, true

' set parental controls, that disables "Run first welcome window", "Cannot change parental controls" and "No autoupdate"

Dim wshShell
Set wshShell = CreateObject( "WScript.Shell" )
wshShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Apple Computer, Inc.\iTunes\Parental Controls\Default\AdminFlags", 16777473, "REG_DWORD"


'Copy this to notepad++ or anoter editor, save as *.vbs :-)

[edit] Full ITunes installation 10.6

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

Deploy File/Folder Structure

 %SOFTWARE%\itunes\iTunes.msi
 %SOFTWARE%\itunes\AppleMobileDeviceSupport.msi
 %SOFTWARE%\itunes\AppleApplicationSupport.msi
<?xml version="1.0" encoding="UTF-8"?>
<package id='appleapplicationsupport' name='Apple Application Support' revision='%PKGVER%' reboot='false' priority='10'>
	<variable name='PKGVER' value='2.1.7' />
 
	<check type='uninstall' condition='versiongreaterorequal' path='Apple Application Support' value='%PKGVER%'/>
 
	<install cmd='msiexec /i "%SOFTWARE%\itunes\AppleApplicationSupport.msi" /passive /norestart' timeout='300'>
		<exit code='0' />
		<exit code='3010' reboot='postponed' />
	</install>
 
	<upgrade include='install' />
 
	<remove cmd='msiexec /x{EB879750-CCBD-4013-BFD5-0294D4DA5BD0} /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='%PKGVER%' reboot='false' priority='10'>
	<variable name='PKGVER' value='5.1.1.4' />
 
	<check type='uninstall' condition='versiongreaterorequal' path='Apple Mobile Device Support' value='%PKGVER%' />
 
	<install cmd='msiexec /i "%SOFTWARE%\itunes\AppleMobileDeviceSupport.msi" /passive /norestart' timeout='300'>
		<exit code='0' />
		<exit code='3010' reboot='postponed' />
	</install>
 
	<upgrade include='install' />
 
	<remove cmd='msiexec /x{EFC04D3F-A152-47E7-8517-EE0F6201AFEF} /passive /norestart' timeout='300'>		
		<exit code='0' />
		<exit code='1605' />
		<exit code='3010' reboot='postponed' />
	</remove>
</package>
 
<package id='itunes' name='Apple iTunes' revision='%PKGVER%' reboot='false' priority='9'>
	<depends package-id='appleapplication' />
 
	<variable name='PKGVER' value='10.6.0.40' />
 
	<check type='uninstall' condition='versiongreaterorequal' path='iTunes' value='%PKGVER%' />
	<!-- Check if automatic updates have been disabled (value: 256) and settings have been locked (value: 1) -->
	<check type='registry' condition='equals' path='HKLM\SOFTWARE\Apple Computer, Inc.\iTunes\Parental Controls\Default\AdminFlags' value='257' />
 
	<install cmd='msiexec.exe /i "%SOFTWARE%\itunes\iTunes.msi" SCHEDULE_ASUW=0 /passive' timeout='300'>
		<exit code='0' />
		<exit code='3010' reboot='postponed' />
	</install>
	<!-- Disable automatic update of ITunes via parental controls and lock the settings, see below for more info -->
	<install cmd='reg add "HKLM\SOFTWARE\Apple Computer, Inc.\iTunes\Parental Controls\Default" /v "AdminFlags" /t REG_DWORD /d "0x101" /f' timeout='60' />
 
	<upgrade include='install' />
 
	<remove cmd='msiexec.exe /x{8B92D97D-DB3D-4926-A8F7-718FE7C5EE18} /passive /norestart' timeout='300'>
		<exit code='0' />
		<exit code='1605' />
		<exit code='3010' reboot='postponed' />
	</remove>
</package>

[edit] Minimal ITunes installation 10.6

The goal of this setup is to get a working installation of ITunes which allows you to activate, backup and sync an IPhone or Ipod, install new iOS versions and optionally get songs/apps from the Apple Store, but does otherwise interfere with the PC as little as possible. Specifically this means: No automatic update checks, no desktop shortcuts, no automatic file type associations with ITunes, no ITunes CD grabbing, no unecessary background services or autostart entries, no traybar icons, no Windows firewall modifications. 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 at all. Of course all steps in this section are optional, if you don't want to leave a certain feature out, then simply omit the corresponding step.

[edit] 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.

[edit] Apple Application Support

[edit] Apple Mobile Device Support

[edit] ITunes

You can disable certain ITunes features via the registry. Apple has a list of almost 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. Also don't forget to change the <check> statement, if you modify the value in the registry. Be aware that disabling automatic updates in ITunes also stops the user from being able to download updates for Appstore apps in ITunes. Also ITunes does not recognize IPhones in DFU mode anymore. If the registry key for parental controls already exists in the HKCU hive, the ITunes seems to ignore the HKLM entries.

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!


[edit] Package definitions

[edit] Apple Application Support

<?xml version="1.0" encoding="UTF-8"?>
<package id='appleapplicationsupport' name='Apple Application Support' revision='%PKGVER%' reboot='false' priority='10'>
	<variable name='PKGVER' value='2.1.7' />
 
	<check type='uninstall' condition='versiongreaterorequal' path='Apple Application Support' value='%PKGVER%'/>
 
	<install cmd='msiexec /i "%SOFTWARE%\itunes\AppleApplicationSupport.msi" TRANSFORMS="%TEMP%\software\application-transform-from-above.mst" /passive /norestart' timeout='300'>
		<exit code='0' />
		<exit code='3010' reboot='postponed' />
	</install>
 
	<upgrade include='install' />
 
	<remove cmd='msiexec /x{EB879750-CCBD-4013-BFD5-0294D4DA5BD0} /passive /norestart' timeout='300'>
		<exit code='0' />
		<exit code='1605' />
		<exit code='3010' reboot='postponed' />
	</remove>
</package>

[edit] Apple Mobile Device Support

<?xml version="1.0" encoding="UTF-8"?>
<package id='applemobilesupport' name='Apple Mobile Device Support' revision='%PKGVER%' reboot='false' priority='10'>
	<variable name='PKGVER' value='5.1.1.4' />
 
	<check type='uninstall' condition='versiongreaterorequal' path='Apple Mobile Device Support' value='%PKGVER%' />
 
	<install cmd='msiexec /i "%SOFTWARE%\itunes\AppleMobileDeviceSupport.msi" TRANSFORMS="%TEMP%\software\mobiledevice-transform-from-above.mst" /passive /norestart' timeout='300'>
		<exit code='0' />
		<exit code='3010' reboot='postponed' />
	</install>
 
	<upgrade include='install' />
 
	<remove cmd='msiexec /x{EFC04D3F-A152-47E7-8517-EE0F6201AFEF} /passive /norestart' timeout='300'>		
		<exit code='0' />
		<exit code='1605' />
		<exit code='3010' reboot='postponed' />
	</remove>
</package>

[edit] ITunes

<?xml version="1.0" encoding="UTF-8"?>
<package id='itunes' name='Apple iTunes' revision='%PKGVER%' reboot='false' priority='1'>
	<depends package-id='appleapplicationsupport' />
 
	<variable name='PKGVER' value='10.6.0.40'' />
 
	<check type='uninstall' condition='versiongreaterorequal' path='iTunes' value='%PKGVER%' />
	<check type='registry' condition='equals' path='HKLM\SOFTWARE\Apple Computer, Inc.\iTunes\Parental Controls\Default\AdminFlags' value='257' />
 
	<!-- 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 
	OUTLOOK_LOAD_BEHAVIOR=0: Don't load ITunes-Calendar-Addin in Outlook 
	DONT_AUTO_SYNC_IPODS=1: Don't automatically sync with connected devices -->
	<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 OUTLOOK_LOAD_BEHAVIOR=0 DONT_AUTO_SYNC_IPODS=1 /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 include='install' />
 
	<remove cmd='msiexec.exe /x{8B92D97D-DB3D-4926-A8F7-718FE7C5EE18} /passive /norestart' timeout='300'>
		<exit code='0' />
		<exit code='1605' />
		<exit code='3010' reboot='postponed' />
	</remove>
</package>
Retrieved from "http://wpkg.org/ITunes"
Personal tools
Namespaces
Variants
Actions
Navigation
ideas?
Toolbox