iTunes 12.2.2.25 Silent Install

email me

Part of the sequence script

c:\windows\system32\msiexec.exe /i “%CD%\AppleApplicationSupport.msi” /qn /norestart
c:\windows\system32\msiexec.exe /i “%CD%\AppleApplicationSupport64.msi” /qn /norestart
c:\windows\system32\msiexec.exe /i “%CD%\AppleMobileDeviceSupport64.msi” /qn /norestart
c:\windows\system32\msiexec.exe /i “%CD%\Bonjour64.msi” /qn /norestart
c:\windows\system32\msiexec.exe /i “%CD%\AppleSoftwareUpdate.msi” /qn /norestart
c:\windows\system32\msiexec.exe /i “%CD%\iTunes6464.msi” /qn /norestart IAcceptLicense=Yes ALLUSERS=1 DESKTOP_SHORTCUTS=1 INSTALL_ASUW=0 NO_ASUW=1
“%CurDir%\copytoallprofiles_7.vbs”

The copytoallprofiles_7.vbs script – cycles through profiles to copy custom settings

If the iTunesPrefs.xml isn’t working for you, take a look at com.apple.iTunes.plist. Apple loves to sneak in new ways of storing configs.

on error resume next

Set objShell = CreateObject("Wscript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")

Const HKEY_LOCAL_MACHINE = &H80000002
Const OverwriteExisting = TRUE
Source1 = "C:\Program Files (x86)\LANDesk\LDClient\sdmcache\apps\Apple\iTunes\12.2.2.25\<strong>iTunesPrefs.xml</strong>"

'SETS CURRENT DIRECTORY TO VARIABLE
strCurrentDirectory = objShell.CurrentDirectory

on error resume next
'LSource1 = strCurrentDirectory & "\iTunesPrefs.xml"
'LSource2 = strCurrentDirectory & "\First Run"

'Target is dynamic is assigned below

strComputer = "."

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set objRegistry=GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\ProfileList"
objRegistry.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubkeys
For Each objSubkey In arrSubkeys
on error resume next
strValueName = "ProfileImagePath"
strSubPath = strKeyPath & "\" & objSubkey
objRegistry.GetExpandedStringValue HKEY_LOCAL_MACHINE,strSubPath,strValueName,strValue
Const POPUP_TITLE = "User To SID Conversion"
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set objAccount = objWMIService.Get("Win32_SID.SID='" & objSubkey & "'")
strUser = objAccount.AccountName
'strDomain = objAccount.ReferencedDomainName'returns referenced domain

'DISPLAY PROFILE NAME & SID
objSubkey = trim(objSubkey)'trims whitespace
strUser = trim(strUser)'trims whitespace
'msgbox "objSubkey: " & objSubkey'returns SID
'msgbox strUser'returns username

'LOGIC TO DETERMINE IF REGISTRY ACCOUNT IS TO BE LOADED
if strUser = "SYSTEM" then strUser=""
if strUser = "LOCAL SERVICE" then strUser=""
if strUser = "NETWORK SERVICE" then strUser=""
if strUser = "ADMINISTRATOR" then strUser=""

if strUser &lt;&gt; "" then
on error resume next
objShell.Run "%comspec% /c md " & chr(34) & "C:\users\" & strUser & "\AppData\Roaming\Apple Computer\iTunes" & chr(34),0,false
Wscript.Sleep 1000
'path for local users
Target1 = "C:\users\" & strUser & "\AppData\Roaming\Apple Computer\iTunes\"
'path for redirected users


objFSO.CopyFile Source1, Target1, OverwriteExisting

'FAILSAFE
on error resume next
strMainSource = "C:\Program Files (x86)\LANDesk\LDClient\sdmcache\apps\Apple\iTunes\12.2.2.25"
strMainTarget1 = strValue & "\AppData\Roaming\Apple Computer\iTunes"
Wscript.Sleep 1000

'vbcsript copy
objFSO.CopyFile "C:\Program Files (x86)\LANDesk\LDClient\sdmcache\apps\Apple\iTunes\12.2.2.25\<strong>iTunesPrefs.xml</strong>", strValue & "\AppData\Roaming\Apple Computer\iTunes\", OverwriteExisting

Wscript.Sleep 1000

'shell copy
'for local users
objShell.Run "%comspec% /c copy /y " & chr(34) & strMainSource & "\iTunesPrefs.xml" & chr(34) & " " & chr(34) & strMainTarget1 & "\iTunesPrefs.xml" & chr(34),0,true
objShell.Run "%comspec% /c copy /y " & chr(34) & strCurrentDirectory & "\iTunesPrefs.xml" & chr(34) & " " & chr(34) & strMainTarget1 & "\iTunesPrefs.xml" & chr(34),0,true

'added for redirected users
'objShell.Run "%comspec% /c copy /y " & chr(34) & strCurrentDirectory & "\iTunesPrefs.xml" & chr(34) & " " & chr(34) & Target2 & "\iTunesPrefs.xml" & chr(34),0,true
Wscript.Sleep 1000

end if

Next