Page 1 of 1
Read Registry doesn't work in Win 7 32 bit
Posted: Wed Jun 19, 2013 11:37 am
by mwilner
Hello,
I am trying to search through the registry for an uninstall string of a specific program and it works flawless in Win 7 64 bit but the same process fails to read the UninstallString in 32 bit.
What is going wrong?
Re: Read Registry doesn't work in Win 7 32 bit
Posted: Thu Jun 20, 2013 4:18 am
by FrancescoT
Dear Manfred,
can you try to describe your steps?
Also, are you referring to an 32bit registry entry with a x64 OS target?
Regards
Re: Read Registry doesn't work in Win 7 32 bit
Posted: Thu Jun 20, 2013 6:18 am
by mwilner
The registry key is Software\Microsoft\Windows\CurrentVersion\Uninstall and is the same on a x64 system and a x32 system.
The Key Publisher is getting read properly in both systems but UninstallString is not.
Here is the code snippet:
if Variable ISWIN7 Equals TRUE
Set Variable UNINSTALLKEY to Software\Microsoft\Windows\CurrentVersion\Uninstall
Set Variable UNINSTALLKEYS to
Set Variable UNINSTALLSTRING to
Set Variable FIRSTKEY to
Set Variable PUBLISHER to
Set Variable PROGRAM to
Find All Registry Keys in HKLM\$UNINSTALLKEY$ into UNINSTALLKEYS
Parse String $UNINSTALLKEYS$ into Variables FIRSTKEY and UNINSTALLKEYS (Split at first occurrence of pattern)
while Variable FIRSTKEY not Equals EMPTY loop
Read Registry Key HKLM\$UNINSTALLKEY$\$FIRSTKEY$\Publisher into PUBLISHER
if Variable PUBLISHER Equals Zebra
Read Registry Key HKLM\$UNINSTALKEY$\$FIRSTKEY$\UninstallString into UNINSTALLSTRING
Comment: MessageBox: Uninstall Driver, RegKey $FIRSTKEY$ Uninstall Str $UNINSTALLSTRING$
Parse String $UNINSTALLSTRING$ into Variables PROGRAM and UNINSTALLSTRING (Split at first occurrence of pattern)
Comment: MessageBox: Uninstall Driver, $PROGRAM$ /u $UNINSTALLSTRING$
Run Program $PROGRAM$ /u $UNINSTALLSTRING$ (WAIT, get result into variable SUCCESS)
Break out of Loop
end
Set Variable FIRSTKEY to
Parse String $UNINSTALLKEYS$ into Variables FIRSTKEY and UNINSTALLKEYS (Split at first occurrence of pattern)
wend
MessageBox: Uninstall Driver, Remeber to Uninstall the printer and driver with the Print Management Console.
else
...
end
Re: Read Registry doesn't work in Win 7 32 bit
Posted: Thu Jun 20, 2013 12:49 pm
by FrancescoT
Dear Manfred,
I'm very sorry ... but I'm unable to replicate your issue and with my verifications the READ REGISTRY command works fine.
However, I haven't used the code you supplied because I can't manually re-enter your snippet (It should be posted as InstallAware Clipboard format).
Anyway, I have released a small sample to verify the READ REGISTRY command functionality.
The sample displays with a MessageBox its uninstall string once installed.
To test the project, just build it, install the package and then run the package once again.
It will return the current uninstall string of the package before with proceeding with the maintenance mode.
If you are able to replicate the same with a very minimal project, I'll be happy to verify it.
Hope this helps you.
Regards