Page 1 of 1 1
Topic Options
#175002 - 2007-03-27 08:47 PM check if a Windows/Office updating was previously installed
Adolfo Offline
Fresh Scripter
*****

Registered: 2007-01-25
Posts: 49
Loc: Cali, CO
How can I check if a Windows/Office updating was previously installed.

Thanks.

Top
#175011 - 2007-03-27 10:49 PM Re: check if a Windows/Office updating was previously installed [Re: Adolfo]
Mart Moderator Online   content
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4642
Loc: The Netherlands
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
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#175083 - 2007-03-29 08:33 PM Re: check if a Windows/Office updating was previously installed [Re: Mart]
Adolfo Offline
Fresh Scripter
*****

Registered: 2007-01-25
Posts: 49
Loc: Cali, CO
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

Top
#175084 - 2007-03-29 08:38 PM Re: check if a Windows/Office updating was previously installed [Re: Adolfo]
Mart Moderator Online   content
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4642
Loc: The Netherlands
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.


Edited by Mart (2007-03-29 08:39 PM)
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#175086 - 2007-03-29 08:58 PM Re: check if a Windows/Office updating was previously installed [Re: Adolfo]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4285
Loc: New Jersey
"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
_________________________
Actually I am a Rocket Scientist! \:D

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 36 anonymous users online.
Newest Members
thequeen, ameliaryan, shalomsalami, dkdssdk, Vroon
17639 Registered Users

Generated in 0.039 seconds in which 0.019 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org