'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 iTunesSetup.exe",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) if returnValue <> 0 Then Wscript.Quit returnValue else returnValue=WshShell.Run("%windir%\system32\msiexec.exe /i AppleMobileDeviceSupport.msi /qn /norestart", 0, TRUE) if returnValue <> 0 Then Wscript.Quit returnValue else returnValue=WshShell.Run("%windir%\system32\msiexec.exe /i AppleSoftwareUpdate.msi /qn /norestart", 0, TRUE) if returnValue <> 0 Then Wscript.Quit returnValue else returnValue=WshShell.Run("%windir%\system32\msiexec.exe /i Quicktime.msi /qn /norestart", 0, TRUE) if returnValue <> 0 Then Wscript.Quit returnValue else returnValue=WshShell.Run("%windir%\system32\msiexec.exe /i Bonjour.msi /qn /norestart", 0, TRUE) if returnValue <> 0 Then Wscript.Quit returnValue else returnValue=WshShell.Run("%windir%\system32\msiexec.exe /i iTunes.msi /qn /norestart", 0, TRUE) if returnValue <> 0 Then Wscript.Quit returnValue else 'WScript.Echo "Installation of the iTunesSetup.exe is Success" Wscript.Quit returnValue End If End If End If End If End If End If End If 'WScript.Echo "Error Occurred while installing Itunes" Wscript.Quit returnValue