Thursday, January 21, 2016

Old school installer architecture selection script.

Some days you need to write a script that takes action based on whether you are installing on a x32 or x64 box.  Here is a simple VBscript that just works...

Set WshShell = WScript.CreateObject("WScript.Shell")

OSbits = WshShell.RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE")

If OSbits = "x86"
WshShell.Run "msiexec.exe /qn /i install_x86.msi /norestart"
WshShell.Run "msiexec.exe /qn /i install_x64.msi /norestart"
End If

No comments:

Post a Comment