Adolfo
(Fresh Scripter)
2007-03-27 08:47 PM
check if a Windows/Office updating was previously installed

How can I check if a Windows/Office updating was previously installed.

Thanks.


Mart
(KiX Supporter)
2007-03-27 10:49 PM
Re: check if a Windows/Office updating was previously installed

You could check the registry for installed apps and updates.

Have a look at this registry key.

 Quote:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall


Adolfo
(Fresh Scripter)
2007-03-29 08:33 PM
Re: check if a Windows/Office updating was previously installed

I have used this code in a batch file

 Code:
 
SET APP="MS07-013"
REG QUERY HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall /s | FinD /i %APP%

IF %ERRORLEVEL%=0 GOTO FOUND
GOTO NOFOUND

:FOUND
ECHO. UPDATE/APP INSTALLED
GOTO END

:NOFOUND
ECHO. UPDATE/APP NO INSTALLED

:END


I want to use a kix script but when i use the next line it doesn't work, I have used chr() function too

 Code:
 
shell "cmd /c REG QUERY HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall /s | FinD /i $APP"



Thanks


Mart
(KiX Supporter)
2007-03-29 08:38 PM
Re: check if a Windows/Office updating was previously installed

You cannot just copy stuff from a batch script to a kix script.

Have a look at ReadValue in the KiXtart manual that comes with every download.

 Quote:

READVALUE
Action: Reads a registry value and returns it as an ASCII string.


Glenn BarnasAdministrator
(KiX Supporter)
2007-03-29 08:58 PM
Re: check if a Windows/Office updating was previously installed

"Find" requires the use of double-qoutes around the find string, thus your
 Code:
 
shell "cmd /c REG QUERY HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall /s | FinD /i $APP"

will not work. Try
 Code:
 
shell '%COMSPEC% /c REG QUERY HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall /s | Find /i "' + $APP + '"'

This also fixes the hardcoded CMD issue.

I'd still rewrite the entire thing to run in kix, since you're only able now to know IF it was found, not WHAT. Look at trying
 Code:
If KeyExist('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall')

directly in Kix.

Glenn