'ManageEngine Desktop Central Agent 'Script to deploy ITunes setup '============================= Set WshShell = WScript.CreateObject("WScript.Shell") 'Get the Agent Installed directory from the Registry location details '==================================================================== Err.Clear checkOSArch = WshShell.RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE") 'Wscript.Echo checkOSArch if Err Then Err.Clear 'WScript.Echo "The OS Architecture is unable to find ,so it was assumed to be 32 bit" regkey = "HKEY_LOCAL_MACHINE\SOFTWARE\AdventNet\DesktopCentral\DCAgent" else if checkOSArch = "x86" Then 'Wscript.Echo "The OS Architecture is 32 bit" regkey = "HKEY_LOCAL_MACHINE\SOFTWARE\AdventNet\DesktopCentral\DCAgent" else 'Wscript.Echo "The OS Architecture is 64 bit" regkey = "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\AdventNet\DesktopCentral\DCAgent" End IF End If agentDir = WshShell.RegRead(regkey & "\DCAgentInstallDir") 'WScript.Echo agentDir location = agentDir&"bin\7za.exe" 'WScript.Echo location 'Extraction of the iTunesSetup.exe returnValue =WshShell.Run(Chr(34)& location &Chr(34)& " x -y "&WScript.Arguments.Item(0),0,TRUE) 'Once the extraction is sucess , install the msi in the specific order '===================================================================== if returnValue <> 0 Then 'WScript.Echo "Extraction of iTunesSetup.exe is failed" Wscript.Quit returnValue else returnValue=WshShell.Run("%windir%\system32\msiexec.exe /i AppleApplicationSupport.msi /qn /norestart", 0, TRUE) returnValue=WshShell.Run("%windir%\system32\msiexec.exe /i AppleApplicationSupport64.msi /qn /norestart", 0, TRUE) returnValue=WshShell.Run("%windir%\system32\msiexec.exe /i AppleMobileDeviceSupport64.msi /qn /norestart", 0, TRUE) returnValue=WshShell.Run("%windir%\system32\msiexec.exe /i AppleSoftwareUpdate.msi /qn /norestart", 0, TRUE) returnValue=WshShell.Run("%windir%\system32\msiexec.exe /i Bonjour64.msi /qn /norestart", 0, TRUE) returnValue=WshShell.Run("%windir%\system32\msiexec.exe /i iTunes64.msi /qn /norestart", 0, TRUE) End If 'WScript.Echo "Error Occurred while installing Itunes" Wscript.Quit returnValue