/build/static/layout/Breadcrumb_cap_w.png

HKLM Run once MSI's not running VBScript

I have created the follwong script that runs when using it logged in as the user, but if i try and run it from the HKLM runonce key after a reboot, the script runs but the MSI's do not install, the MSG boxes pop up etc. so its running through the script, it just doesnt install the MSI's.Theres nothing in the eventlog about the MSI's, Ive checked the installer service is running, it looks like there just not being called.Im stumped as it works when logged on.
Can anybody help??

cheers

Set objShell = WScript.CreateObject("WScript.Shell")
On error resume next


'Start Service
strServiceName = "MSISserver"
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set colListOfServices = objWMIService.ExecQuery ("Select * from Win32_Service Where Name ='" & strServiceName & "'")
For Each objService in colListOfServices
objService.StartService()




MsgBox "Updates Starting",64," Installer"

Dim objShell, RegLocate
Dim sngVersion

'' Adobe 8.0.0 pro
sngVersion = objShell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-1033-0000-7760-000000000003}\DisplayVersion")
if sngVersion="8.0.0" then
objShell.run "msiexec /p AcrobatUpd810_euro_incr.msp /qn /norestart", 0, True
end if

'' Adobe 8.0.0 standard
sngVersion = objShell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-1033-F400-BA7E-000000000003}\DisplayVersion")
if sngVersion="8.0.0" then
objShell.run "msiexec /p AcrobatUpd810_euro_incr.msp /qn /norestart", 0, True
end if


'' Adobe 8.1.0
sngVersion = objShell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-1033-F400-7760-000000000003}\DisplayVersion")
if sngVersion="8.1.0" then
objShell.run "msiexec /p AcrobatUpd811_all_incr.msp /qn /norestart", 0, True
end if

'' Adobe 8.1.0 standard
sngVersion = objShell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-1033-F400-BA7E-000000000003}\DisplayVersion")
if sngVersion="8.1.0" then
objShell.run "msiexec /p AcrobatUpd811_all_incr.msp /qn /norestart", 0, True
end if


'' Adobe 8.1.1
sngVersion = objShell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-1033-F400-7760-000000000003}\DisplayVersion")
if sngVersion="8.1.1" then
objShell.run "msiexec /p AcrobatUpd812_all_incr.msp /qn /norestart", 0, True
end if

'' Adobe 8.1.1 standard
sngVersion = objShell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-1033-F400-BA7E-000000000003}\DisplayVersion")
if sngVersion="8.1.1" then
objShell.run "msiexec /p AcrobatUpd812_all_incr.msp /qn /norestart", 0, True
end if



'' Adobe 8.1.2
sngVersion = objShell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-1033-F400-7760-000000000003}\DisplayVersion")
if sngVersion="8.1.2" then
objShell.run "msiexec /p AcrobatUpd813_all_incr.msp /qn /norestart", 0, True
end if


'' Adobe 8.1.2 standard
sngVersion = objShell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-1033-F400-BA7E-000000000003}\DisplayVersion")
if sngVersion="8.1.2" then
objShell.run "msiexec /p AcrobatUpd813_all_incr.msp /qn /norestart", 0, True
end if


'' Adobe 8.1.3
sngVersion = objShell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-1033-F400-7760-000000000003}\DisplayVersion")
if sngVersion="8.1.3" then
objShell.run "msiexec /p AcrobatUpd814_all_incr.msp /qn /norestart", 0, True
end if


'' Adobe 8.1.3 standard
sngVersion = objShell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-1033-F400-BA7E-000000000003}\DisplayVersion")
if sngVersion="8.1.3" then
objShell.run "msiexec /p AcrobatUpd814_all_incr.msp /qn /norestart", 0, True
end if

'' Adobe 8.1.4
sngVersion = objShell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-1033-F400-7760-000000000003}\DisplayVersion")
if sngVersion="8.1.4" then
objShell.run "msiexec /p AcrobatUpd815.msp /qn /norestart", 0, True
end if

'' Adobe 8.1.4 standard
sngVersion = objShell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-1033-F400-BA7E-000000000003}\DisplayVersion")
if sngVersion="8.1.4" then
objShell.run "msiexec /p AcrobatUpd815.msp /qn /norestart", 0, True
end if


'' Adobe 8.1.5
sngVersion = objShell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-1033-F400-7760-000000000003}\DisplayVersion")
if sngVersion="8.1.5" then
objShell.run "msiexec /p AcrobatUpd816_all_incr.msp /qn /norestart", 0, True
end if


'' Adobe 8.1.5 standard
sngVersion = objShell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-1033-F400-BA7E-000000000003}\DisplayVersion")
if sngVersion="8.1.5" then
objShell.run "msiexec /p AcrobatUpd816_all_incr.msp /qn /norestart", 0, True
end if


'' Adobe 8.1.6
sngVersion = objShell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-1033-F400-7760-000000000003}\DisplayVersion")
if sngVersion="8.1.6" then
objShell.run "msiexec /p AcrobatUpd817_all_incr.msp /qn /norestart", 0, True
end if

'' Adobe 8.1.6 standard
sngVersion = objShell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-1033-F400-BA7E-000000000003}\DisplayVersion")
if sngVersion="8.1.6" then
objShell.run "msiexec /p AcrobatUpd817_all_incr.msp /qn /norestart", 0, True
end if

'' Adobe 8.1.7
sngVersion = objShell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-1033-F400-7760-000000000003}\DisplayVersion")
if sngVersion="8.1.7" then
objShell.run "msiexec /p AcrobatUpd820_all_incr.msp /qn /norestart", 0, True
end if


'' Adobe 8.1.7 standard
sngVersion = objShell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-1033-F400-BA7E-000000000003}\DisplayVersion")
if sngVersion="8.1.7" then
objShell.run "msiexec /p AcrobatUpd820_all_incr.msp /qn /norestart", 0, True
end if


MsgBox "Updates Finished.PC Will Reboot in 5 Minutes",64," Installer"


set objShell = CreateObject("WScript.Shell")
objShell.Run("regedit /s adobe.reg")


objShell.Run "shutdown.exe /R /T 300 /C """ & "Rebooting your computer in 5 minutes.Please save all your work"""


WScript.Quit

0 Comments   [ + ] Show comments

Answers (3)

Posted by: anonymous_9363 14 years ago
Red Belt
0
- First, the duplicate code in the script is a vision to behold. Use variables for your command lines and registry keys.
- Second, the whole process will be LIGHT years more stable if you create an Administrative Installation Point, patch that and deploy from the resulting MSI.

As to why it doesn't work...I can't think, off the top of my head. In your position, I'd install the Microsoft Script Editor (or, at worst, the Microsoft Script Debugger) and add the debug switch to the command line which is launching your script:CSCRIPT //X [script_name.vbs]. That will bring up a window within which you can step line-by-line (F11 in MSE, F8 in MSD). MSE is much easier to use for this, as it will show variable contents in tooltips, whereas in MSD, you'll need to use 'debug.print [variable_name]' in the command window.

Good luck.
Posted by: diaz101 14 years ago
Yellow Belt
0
Thanks for your suggestion, unfortunately this is what I have been given to work with, so no Admin install.I have 3000 machies with varying levls of software on them, so Im trying to script an update that works via SM that will remove adobe reader,reboot and then run the script above.It all has to be hidden from the user as well.
Posted by: anonymous_9363 14 years ago
Red Belt
0
this is what I have been given to work withAs I believe I said yesterday, management knows best, eh?

Part of the packager's job, IMV, is to educate the nay-sayers. Any fool knows that corporate deployments should be done from AIPs when they can be, which is certainly the case here. Find a baseball bat and begin the education process.

Lastly, remember that Adobe AIPs can only be patched with quarterly updates. If they stick to their existing plan, those are ones with evenly-numbered revisions (e.g. 8.1.0, 8.1.2).

EDIT:
If you are forced to go the scripted route, have you seen this?
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ