**Please use Google Chrome for best viewing experience**
- Download iTunes & 7-Zip
- Using 7-Zip extract the executable contents. Of all those extracted MSI's you would only need 3 of them (See Fig:1).
(Fig:1) (Fig: 2a) # Click on "Property Manager" under "Behavior & Logic": Edit/Add these properties. REGSRCH_DESKTOP_SHORTCUTS = 0 REGSRCH_MEDIA_DEFAULTS = 0 IAcceptLicense = 0 DISABLEADVTSHORTCUTS = 0 SCHEDULE_ASUW = 0 ChkOptLaunchiTunes = 1 TARGETDIR = C:\ INSTALLDIR = C:\Program Files (x86)\iTunes\ ITUNES_LANGID = 1033 DESKTOP_SHORTCUTS = 1 AMDS_IS_INSTALLED = 1 REENABLEAUTORUN = 0 NO_ASUW = 0 NO_BONJOUR = 0 REBOOT = ReallySuppress # Click on "Direct Editor" under "Additional Tools": > Search for "caPackage" table, Right-click on "AppleSoftwareUpdate" and select "Drop Row(s)" button. Do the same for "Bonjour" aswell (See Fig: 2b).(Fig: 2b)
(Fig: 3)
(Fig: 4) - > Search for "Component" table and look for "iTunesDesktopShortcuts" component. Set the condition DESKTOP_SHORTCUTS="0".
- Configuring "AppleMobileDeviceSupport64.msi": Follow the instructions as discussed in Step#3 to create a transform. Select the "Property Manager" listed under "Behavior and Logic". Now set these values, IAcceptLicense = Yes INSTALLDIR = C:\Program Files (x86)\CommonFiles\Apple\Mobile Device Support\ TARGETDIR = C:\ Click on "Direct Editor" under "Additional Tools": Search for "LaunchCondition" table, right-click on "NOTBNEWERPRODUCTINSTALLED" and select "Drop Row(s)" (See Fig below).
- Now create a batch file to install these 3 MSI's in sequence. (a) AppleApplicationSupport.msi (b) AppleMobileDeviceSupport64.msi & AppleMobileDeviceSupport64.mst (c) iTunes64.msi & iTunes64.mst
- Launch the iTunes shortcut (Start > All Programs > iTunes > iTunes.lnk).
- Click "OK"
- On the welcome screen, click on "Agree"
- Click on "Advanced" tab and uncheck "Check for new software upgrades automatically".
- Close iTunes.
- Here comes the tricky part. Create a folder (Eg. Apple iTunes) and create two sub-folders (Local & Roaming). Under Roaming create another sub-folder "Preferences". Now copy these files onto respective folders that you have just created, (a) %userprofile%\Appdata\Local\Apple Computer\iTunes\cache.db (b) %userprofile%\Appdata\Local\Apple Computer\iTunes\iTunesPrefs.xml (c) %userprofile%\AppData\Roaming\Apple Computer\iTunes\iTunesPrefs.xml (d) %userprofile%\AppData\Roaming\Apple Computer\iTunes\com.apple.iTunes.plist (e) %userprofile%\AppData\Roaming\Apple Computer\iTunes\Preferences\com.apple.mediaaccessibility.plist Note: The "iTunesPrefs.xml" files located in Local & Roaming are different though they share the same name. Do not mix it up.
- Copy this VBscript code onto notepad and name it "copyConfigFiles.vbs". 'This script creates required folders under AppData and copies the files to it.on error resume nextSet oShell = CreateObject( "WScript.Shell" )userprofile=oShell.ExpandEnvironmentStrings("%USERPROFILE%")systemdrive=oShell.ExpandEnvironmentStrings("%SYSTEMDRIVE%")Set fso = CreateObject("Scripting.FileSystemObject")Set afile = fso.GetFile(systemdrive & "\ProgramData\Apple iTunes\local\cache.db")strDestination1 =userprofile & "\AppData\Local\Apple Computer\iTunes\cache.db"Set bfile = fso.GetFile(systemdrive & "\ProgramData\Apple iTunes\local\iTunesPrefs.xml")strDestination2 =userprofile & "\AppData\Local\Apple Computer\iTunes\iTunesPrefs.xml"Set cfile = fso.GetFile(systemdrive & "\ProgramData\Apple iTunes\Roaming\iTunesPrefs.xml")strDestination3 =userprofile & "\AppData\Roaming\Apple Computer\iTunes\iTunesPrefs.xml"Set dfile = fso.GetFile(systemdrive & "\ProgramData\Apple iTunes\Roaming\Preferences\com.apple.iTunes.plist")strDestination4 =userprofile & "\AppData\Roaming\Apple Computer\iTunes\Preferences\com.apple.iTunes.plist"Set efile = fso.GetFile(systemdrive & "\ProgramData\Apple iTunes\Roaming\Preferences\com.apple.mediaaccessibility.plist")strDestination5 =userprofile & "\AppData\Roaming\Apple Computer\iTunes\Preferences\com.apple.mediaaccessibility.plist"fso.CreateFolder(userprofile & "\AppData\Local\Apple Computer")fso.CreateFolder(userprofile & "\AppData\Local\Apple Computer\iTunes")fso.CreateFolder(userprofile & "\AppData\Roaming\Apple Computer")fso.CreateFolder(userprofile & "\AppData\Roaming\Apple Computer\iTunes")fso.CreateFolder(userprofile & "\AppData\Roaming\Apple Computer\iTunes\Preferences")afile.Copy(strDestination1)bfile.Copy(strDestination2)cfile.Copy(strDestination3)dfile.Copy(strDestination4)efile.Copy(strDestination5)
- Now move this script to the folder you created before (Step14: Apple iTunes) .
- Create another VBscript (Active Setup) that creates registry entries to run the "copyConfigFiles.vbs" from "%ProgramData%\Apple iTunes" directory. Name this file as "Apple_iTunes_ActiveSetup.vbs". Here is the code for it, Dim strReturn : strReturn = 0Call Main()Sub Main()Dim objFSO : Set objFSO = CreateObject("Scripting.FileSystemObject")Dim objShell : Set objShell = CreateObject("WSCript.Shell")' Set installation registry values for Apple_iTunes_12.0.1objShell.RegWrite "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\Apple_iTunes_12.0.1\", "Apple_iTunes_12.0.1_R00", "REG_SZ"objShell.RegWrite "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\Apple_iTunes_12.0.1\stubpath", "C:\Windows\System32\wscript.exe //b //nologo " & Chr(34) & objShell.ExpandEnvironmentStrings("%ProgramData%") & "\Apple iTunes\copyConfigFiles.vbs" & Chr(34), "REG_SZ"objShell.RegWrite "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\Apple_iTunes_12.0.1\version", "1", "REG_SZ"Set objFSO = NothingSet objShell = NothingEnd Sub
- Using InstallShield create a new MSI from scratch and name it (eg. iTunes Config). Click on "Installation Designer" tab and go to "Application Data" > "Files and Folders" > "Destination Computer" > Right click and select "Show Predefined Folder" > [CommonAppDataFolder]. Repeat the same and select [ProgramFilesFolder] as well. # Copy the folder that you have created (Apple iTunes) and paste it under [CommonAppDataFolder]. # Under [ProgramFilesFolder] create a folder and name it "iTunes Config". Copy the "Apple_iTunes_ActiveSetup.vbs" script to this directory. # Create a custom action to run "Apple_iTunes_ActiveSetup.vbs". Follow these steps to create custom action and build your MSI.
- Finally not the least, create a batch/VB script to run the MSI's in sequence. (a) AppleApplicationSupport.msi (b) AppleMobileDeviceSupport64.msi & AppleMobileDeviceSupport64.mst (c) iTunes64.msi & iTunes64.mst (d) iTunes Config.msi Note: Your customization will only become effective once you LogOff and Log back in after the install. Yeah, you guessed it right, active setup needs to run to copy the files under current user AppData directory.
- Launch the iTunes shortcut and boom you're done.
Expected Behavior: iTunes tends to self-heal when you happen to launch the shortcut. Please comment if anyone has a solution to get rid of this behavior. References: (i) Re-Packaging Apple iTunes 10.6.1.7 and later (ii) Advanced customization - Apple
Thanks to Rohit Thum! I got the solution to managed installation. I will visit your site to get more updates.
ReplyDelete