Hi,
During installation I need to be able to check to see if a certain registry value under a key exists 'thevalue' , if it doesn't I will create it, if it does I will create another value 'thevaluetokeep' and give it the data copied from 'thevalue', I will then put new data in 'thevalue', this all works fine.
However I want to reverse this process on an uninstall to put things back as they were. I have tried to do a Write Registry under the Perform Uninstallation region after the Apply Uninstall command which doesn't seem to work.
Is it possible to write to the registry from this region? As I know the syntax is correct.
Thanks
Paul
Write Registry
Hi,
here is some of the script which I've tried to prune down:
[DEFINE REGION: Perform Uninstallation]
Comment: Uninstall product
Comment: TO-DO: Insert any additional uninstall commands here
Set Variable checkoldxvalue to
Check Registry Key HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\oldx into checkoldxvalue
if Variable checkoldxvalue not Equals NO$VALUE
Comment: Value detected, better get it
Set Variable oldxval to
Read Registry Key HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\oldx into oldxval
Write Registry Key HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\val, $oldxkval$ (permanent)
Comment: now delete oldx
Delete Registry VALUE HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\oldx
end
Apply Uninstall (get result into variable SUCCESS)
Set Variable PROGRESS to 100
else
<<Code Folding Region>>
I have stepped through the code and it appears to be doing the correct things but without the results.
here is some of the script which I've tried to prune down:
[DEFINE REGION: Perform Uninstallation]
Comment: Uninstall product
Comment: TO-DO: Insert any additional uninstall commands here
Set Variable checkoldxvalue to
Check Registry Key HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\oldx into checkoldxvalue
if Variable checkoldxvalue not Equals NO$VALUE
Comment: Value detected, better get it
Set Variable oldxval to
Read Registry Key HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\oldx into oldxval
Write Registry Key HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\val, $oldxkval$ (permanent)
Comment: now delete oldx
Delete Registry VALUE HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\oldx
end
Apply Uninstall (get result into variable SUCCESS)
Set Variable PROGRESS to 100
else
<<Code Folding Region>>
I have stepped through the code and it appears to be doing the correct things but without the results.
-
- Posts: 3452
- Joined: Thu Dec 22, 2005 7:17 pm
- Contact:
Please read the help file section titled "Setup Commands Preceding Apply Uninstall". This answers your exact question.
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
-
- Posts: 3452
- Joined: Thu Dec 22, 2005 7:17 pm
- Contact:
If you want to write to the registry, you will need to do so before the Apply Install command, and make sure Apply Install executes. And any time your setup is being uninstalled, i.e. when Apply Uninstall is called, these changes will be removed.
I'm afraid there isn't a way to restore the former registry keys at uninstall time within the confines of Windows Installer. What you can do is use the Call DLL Function command to call a pre-existing DLL you may already have, which would restore those keys. You could call Run Program if you have an EXE that would restore these keys. Alternately, you could write an InstallAware plug-in to save and restore those keys. Whichever way you find easiest...
I'm afraid there isn't a way to restore the former registry keys at uninstall time within the confines of Windows Installer. What you can do is use the Call DLL Function command to call a pre-existing DLL you may already have, which would restore those keys. You could call Run Program if you have an EXE that would restore these keys. Alternately, you could write an InstallAware plug-in to save and restore those keys. Whichever way you find easiest...
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
Who is online
Users browsing this forum: Baidu [Spider] and 80 guests