Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Verify Adobe version with VBScript

Status
Not open for further replies.
Jan 30, 2007
3
US
I am trying to find out if anyone knows a way for me to verify a software version through use of a VBScript. For example, I am in the process of rolling out Adobe updates for Adobe Professional and Standard. What I would like to be able to do is incorporate code into my "rollout" script to make sure that the updates are not rolled out unless Adobe version 7.0.5 is detected. Once detected then updates 7.0.7, 7.0.8 and 7.0.9 can be rolled out. Can anyone help me with this request? Here is the script I have so far:

<package>
<job id="vbs">
<script language="VBScript">
Set oShell = CreateObject("WScript.Shell")
strLaunchCmd = "msiexec.exe /i AcroStan.msi TRANSFORMS=AcroStan.mst /qb- REBOOT=ReallySuppress"
oShell.CurrentDirectory = "J:\APPS\Acrobat 7 Standard MSI"
'intRetVal = oShell.Run(strLaunchCmd,1,True)
strLaunchCmd = "msiexec.exe /p update707std.msp /qb- REBOOT=ReallySuppress Reinstallmode=omus reinstall=all"
intRetVal = oShell.Run(strLaunchCmd,1,True)
strLaunchCmd = "msiexec.exe /p update708std.msp /qb- REBOOT=ReallySuppress Reinstallmode=omus reinstall=all"
intRetVal = oShell.Run(strLaunchCmd,1,True)
strLaunchCmd = "msiexec.exe /p update709std.msp /qb- REBOOT=ReallySuppress Reinstallmode=omus reinstall=all"
intRetVal = oShell.Run(strLaunchCmd,1,True)

If intRetVal = 3010 Then
MsgBox "Installation is finished but you need a reboot!"
ElseIf intRetVal = 1641 Then
' Reboot is started by MSI (ForceReboot action)
' and installation will continue after boot
WScript.Sleep 30000
ElseIf intRetVal = 0 Then
MsgBox "Installation was successful"
Else
MsgBox "Installation failed - Error #" & intRetVal
End if
</script>
</job>
</package>
 
you will probably find that a number of methods will work

1. check an application file version?/modified date?
2. take a look at the registry keys generated by adobe and i am sure you will find a version number in the registry which the 'help/about' reads?
3. enum HKLM\software\microsoft\windows\currentversion\uninstall\xxx\displayversion
 
Right! I know was thinking about using a reg key to verify the version but need the VBscript code to place it in my script. Do you know the syntax for the code that I could use?
 
strComputer = "."

Set objWMIService = GetObject("winmgmts:" & _
"{impersonationLevel=impersonate}!\\" & _
strComputer & _
"\root\cimv2")

Set colSoftware = objWMIService.ExecQuery _
("SELECT * FROM Win32_Product")

If colSoftware.Count > 0 Then
For Each objSoftware in colSoftware
Wscript.Echo objSoftware.Caption & vbtab & _
objSoftware.Version
Next
Else
WScript.Echo "hmm no software"

End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top