#130795 - 2004-12-07 11:02 PM
Check if MSI installed???
|
sliver
Getting the hang of it
Registered: 2002-09-05
Posts: 94
|
Anyone know of an easy way using kix to check if an MSI is installed on a machine or not. I looked in the UDF's but didn't see andything pertaining to an MSI. I know about the: HKCU\Software\Microsoft\Installer\Products\Productcode and HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\UserData\UserSID\Products\ProductCode
but the productcode seems to be a randomly generated number so I would have to parse through all productcodes to find the correct one (kinda bulky). Anyone else know of an easier way?? I actually want to install an msi and then check something to make sure it was installed correctly.
Thanks in advance
|
Top
|
|
|
|
#130797 - 2004-12-07 11:21 PM
Re: Check if MSI installed???
|
sliver
Getting the hang of it
Registered: 2002-09-05
Posts: 94
|
I'm sorry...not the version of msiexec but if an actual msi is installed on a machine or not.
Ex.-
Shell "c:\winnt\system32\msiexec.exe /i c:\test.msi /qn-"
Is there a way to check if an msi installed correctly after you run the command above?? Or you only want to install said msi if it has not already been installed.
|
Top
|
|
|
|
#130801 - 2004-12-08 04:41 PM
Re: Check if MSI installed???
|
sliver
Getting the hang of it
Registered: 2002-09-05
Posts: 94
|
Yes closer to what I want...i can use that uninstall location to do what I need. The problem is we have a custom install that uses kix as a wrapper to kick off multiple self-made msi's. Some users already have certain msi's installed and for some unknown reason it is causing errors if we try to reinstall...I wanted to check machine before each msi in the kix package is installed to make sure that the msi was not installed already and either install it or uninstall it based on this. Thanks for your help!!
|
Top
|
|
|
|
#130803 - 2004-12-09 09:53 AM
Re: Check if MSI installed???
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11623
Loc: CA
|
Okay Silver, Here is some 95% SILVER-PLATTER code ... give this a try. Simply find/locate the names of the applications you want to check for and edit the $Installs array var to include those names exactly as they are in the Registry. This script should then show any of your custom installed applications.
Then add / edit for the rest of what you're looking to do like launching or not launching code based upon the results.
The ArrayEnumKey UDF was written by Sealeopard. This and 490+ other UDFs can easily be searched/found here
USA
http://www.kixhelp.com/udfs/
Finland
http://www.gwspikval.com/jooel/UDF/
Code:
Break On
Dim $SO
$SO=SetOption('Explicit','On')
$SO=SetOption('NoVarsInStrings','On')
$SO=SetOption('WrapAtEOL','On')
Dim $HKLMSCIP,$HKLMSCIPDATA,$Entry,$HKLMSCIPAPP,$Installs
$HKLMSCIP='HKLM\SOFTWARE\Classes\Installer\Products'
$HKLMSCIPDATA=ArrayEnumKey($HKLMSCIP)
$Installs='MSI Custom 1','MSI Custom 2','MSI Custom 3'
For Each $Entry In $HKLMSCIPDATA
If $Entry
$HKLMSCIPAPP=ReadValue($HKLMSCIP+'\'+$Entry,'ProductName')
If AScan ($Installs, $HKLMSCIPAPP)>=0
? $HKLMSCIPAPP
EndIf
EndIf
Next
Function ArrayEnumKey($regsubkey)
dim $retcode, $subkeycounter, $currentsubkey, $subkeyarray
if not keyexist($regsubkey)
exit 87
endif
$subkeycounter=0
do
$currentsubkey=enumkey($regsubkey,$subkeycounter)
if not @ERROR
redim preserve $subkeyarray[$subkeycounter]
$subkeyarray[$subkeycounter]=$currentsubkey
$subkeycounter=$subkeycounter+1
endif
until @ERROR
$arrayenumkey=$subkeyarray
exit 0
EndFunction
|
Top
|
|
|
|
#130806 - 2004-12-11 12:05 AM
Re: Check if MSI installed???
|
sliver
Getting the hang of it
Registered: 2002-09-05
Posts: 94
|
Geez...i was actually signing off in that last post and you guys just kept giving me better stuff. Thats why I love this sight...you guys really are the best!! Anyway...before I saw what you guys wrote I actually just starting checking for the presence of the MSI GUID (in the uninstall key...I knew what all the GUIDs were because I created the MSI's. ) Everything worked out great with that but I will mess with the MSI UDF...that looks nice too. Does that actually just look for the name of the MSI when it was installed???
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(Allen)
and 382 anonymous users online.
|
|
|