Tuesday, July 6, 2010

Adobe Updates on x64

I will go back and modify my script on this blog and my http://www.sccm-tools.com/ website later today but I wanted to post because people have asked me about my script and x64 machines.
I have several posts http://sms-hints-tricks.blogspot.com/2009/05/deploy-adobe-acrobat-updates.html on how to deploy the adobe updates in a single VBscript file that makes life easy. Again this for those that don't have an Administrative install point or some other method for patching Adobe.

So you need to check the registry to determine what version of Adobe Reader/Pro is install so you know which patch to install. The problem is the 64bit machines will store this in the Wow64 section since it isn't a 64bit app. Here is the trick for your machine.

By looking in WMI we can determine if the machine is a 32bit machine or 64bit machine. This data is in several places in WMI. Here is just one example.

Adobe 9 Professional
---------------------------------------
Dim objShell, RegLocate
Set objShell = WScript.CreateObject("WScript.Shell")
On error resume next


'determine if this is a 64bit machine

Set Wmi = GetObject("winmgmts:\\.\root\CIMV2")
Set Col = Wmi.ExecQuery("SELECT * FROM Win32_Processor")
For Each Obj in Col
MachineType= Obj.AddressWidth
next

if MachineType=32 then
Dim sngVersion
'''' Adobe 9.0.0
sngVersion = objShell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-1033-0000-7760-000000000004}\DisplayVersion")
if sngVersion="9.0.0" then
objShell.run "msiexec /p AcroPro-std9.1.msp /qb /norestart", 0, True
end if


'''' Adobe 9.1.0
sngVersion = objShell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-1033-0000-7760-000000000004}\DisplayVersion")
if sngVersion="9.1.0" then
objShell.run "msiexec /p Adobe_9.1.2_pro.msp /qb /norestart", 0, True
end if


'''' Adobe 9.1.1
sngVersion = objShell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-1033-0000-7760-000000000004}\DisplayVersion")
if sngVersion="9.1.1" then
objShell.run "msiexec /p Adobe_9.1.2_pro.msp /qb /norestart", 0, True
end if

'''' Adobe 9.1.3
sngVersion = objShell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-1033-0000-7760-000000000004}\DisplayVersion")
if sngVersion="9.1.2" then
objShell.run "msiexec /p AcrobatUpd913_all_incr.msp /qb /norestart", 0, True
end if

'''' Adobe 9.2
sngVersion = objShell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-1033-0000-7760-000000000004}\DisplayVersion")
if sngVersion="9.1.3" then
objShell.run "msiexec /p AcrobatUpd920_all_incr.msp /qb /norestart", 0, True
end if

'''' Adobe 9.2
sngVersion = objShell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-1033-0000-7760-000000000004}\DisplayVersion")
if sngVersion="9.2.0" then
objShell.run "msiexec /p AcrobatUpd930_all_incr.msp /qb /norestart", 0, True
end if

'''' Adobe 9.3.2
sngVersion = objShell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-1033-0000-7760-000000000004}\DisplayVersion")
if sngVersion="9.3.0" then
objShell.run "msiexec /p AcrobatUpd932_all_incr.msp /qb /norestart", 0, True
end if

'''' Adobe 9.3.2
sngVersion = objShell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-1033-0000-7760-000000000004}\DisplayVersion")
if sngVersion="9.3.1" then
objShell.run "msiexec /p AcrobatUpd932_all_incr.msp /qb /norestart", 0, True
end if

'''' Adobe 9.3.3
sngVersion = objShell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-1033-0000-7760-000000000004}\DisplayVersion")
if sngVersion="9.3.2" then
objShell.run "msiexec /p AcrobatUpd933_all_incr.msp /qb /norestart", 0, True
end if


else ' MachineType=64


'''' Adobe 9.0.0
sngVersion = objShell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-1033-0000-7760-000000000004}\DisplayVersion")
if sngVersion="9.0.0" then
objShell.run "msiexec /p AcroPro-std9.1.msp /qb /norestart", 0, True
end if


'''' Adobe 9.1.0
sngVersion = objShell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-1033-0000-7760-000000000004}\DisplayVersion")
if sngVersion="9.1.0" then
objShell.run "msiexec /p Adobe_9.1.2_pro.msp /qb /norestart", 0, True
end if


'''' Adobe 9.1.1
sngVersion = objShell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-1033-0000-7760-000000000004}\DisplayVersion")
if sngVersion="9.1.1" then
objShell.run "msiexec /p Adobe_9.1.2_pro.msp /qb /norestart", 0, True
end if

'''' Adobe 9.1.3
sngVersion = objShell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-1033-0000-7760-000000000004}\DisplayVersion")
if sngVersion="9.1.2" then
objShell.run "msiexec /p AcrobatUpd913_all_incr.msp /qb /norestart", 0, True
end if

'''' Adobe 9.2
sngVersion = objShell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-1033-0000-7760-000000000004}\DisplayVersion")
if sngVersion="9.1.3" then
objShell.run "msiexec /p AcrobatUpd920_all_incr.msp /qb /norestart", 0, True
end if

'''' Adobe 9.2
sngVersion = objShell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-1033-0000-7760-000000000004}\DisplayVersion")
if sngVersion="9.2.0" then
objShell.run "msiexec /p AcrobatUpd930_all_incr.msp /qb /norestart", 0, True
end if

'''' Adobe 9.3.2
sngVersion = objShell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-1033-0000-7760-000000000004}\DisplayVersion")
if sngVersion="9.3.0" then
objShell.run "msiexec /p AcrobatUpd932_all_incr.msp /qb /norestart", 0, True
end if

'''' Adobe 9.3.2
sngVersion = objShell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-1033-0000-7760-000000000004}\DisplayVersion")
if sngVersion="9.3.1" then
objShell.run "msiexec /p AcrobatUpd932_all_incr.msp /qb /norestart", 0, True
end if

'''' Adobe 9.3.3
sngVersion = objShell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-1033-0000-7760-000000000004}\DisplayVersion")
if sngVersion="9.3.2" then
objShell.run "msiexec /p AcrobatUpd933_all_incr.msp /qb /norestart", 0, True
end if
end if
WScript.Quit
------------------------------------------

The nice trick about this is you don't need to create a seperate program or package for the 64bit machines. You simply modify the vbscript/batch/cmd file you use to deploy your application. I admit there are good reasons for seperating this. We have some advertisments that have a program for 64bit and some for 32 but in this instance it is easy to send it all machines and allow the program to determine the best course.