Delete old registryvalues
Hi,
I´m working on a .mst file which will manually delete registry values and files from an old version of a program, at the same time as it installs the new version of the program.
First I tried to use a custom action but later on I found out that I could/should use the RemoveRegistry table. I don´t get it to work however. I have read the help file and the microsoft pages about it but I fail nonetheless.
I would highly appreciate if someone could tell me what to write in the different columns:
RemoveRegistry (s72)
Root (i2)
Key (l255)
Name (L255)
Component_ (s72)
It´s a single registrykey (the old programs uninstall key) that I want to remove during the installation of the new version of the program.
I´m working on a .mst file which will manually delete registry values and files from an old version of a program, at the same time as it installs the new version of the program.
First I tried to use a custom action but later on I found out that I could/should use the RemoveRegistry table. I don´t get it to work however. I have read the help file and the microsoft pages about it but I fail nonetheless.
I would highly appreciate if someone could tell me what to write in the different columns:
RemoveRegistry (s72)
Root (i2)
Key (l255)
Name (L255)
Component_ (s72)
It´s a single registrykey (the old programs uninstall key) that I want to remove during the installation of the new version of the program.
0 Comments
[ + ] Show comments
Answers (31)
Please log in to answer
Posted by:
pjgeutjens
14 years ago
All "kidding" aside with scripting languages and what not, I'll try to answer the OP's original question:
RemoveRegistry (s72)
Unique name to define the entry (you can choose this)
Root (i2)
numeric value defining the registry hive you'll be deleting from
0 = HKCR
1 = HKCU
2 = HKLM
3 = HKU
Key (l255)
The rest of the key name, like SOFTWARE\MyProduct\
Name (L255)
Name of the Registry Value, like UninstallString and the like
Component_ (s72)
Here you should put the name of a component from the component table, so a value that matches one of the Component table's first column values. Basically this is the component you want to link your RemoveRegistry operation to
Hope this helps you along.
PJ
I would highly appreciate if someone could tell me what to write in the different columns:
RemoveRegistry (s72)
Unique name to define the entry (you can choose this)
Root (i2)
numeric value defining the registry hive you'll be deleting from
0 = HKCR
1 = HKCU
2 = HKLM
3 = HKU
Key (l255)
The rest of the key name, like SOFTWARE\MyProduct\
Name (L255)
Name of the Registry Value, like UninstallString and the like
Component_ (s72)
Here you should put the name of a component from the component table, so a value that matches one of the Component table's first column values. Basically this is the component you want to link your RemoveRegistry operation to
Hope this helps you along.
PJ
Posted by:
ekniranjan
14 years ago
Posted by:
mekaywe
14 years ago
Posted by:
Agathorn
14 years ago
Sorry I forgot. I use InstallShield and I try to delete the uninstallkey. I.E the registryvalue and not the application itself (well next step is to remove the files etc, but I haven´t gotten to that yet).
ekniranjan can I see the VBScript that can remove the registry value? Would be very nice :)
ekniranjan can I see the VBScript that can remove the registry value? Would be very nice :)
Posted by:
mekaywe
14 years ago
Posted by:
Agathorn
14 years ago
Posted by:
mekaywe
14 years ago
Posted by:
Agathorn
14 years ago
I have tried but the registry value doesn´t get removed.
I used this script:
Set WshShell = Wscript.CreateObject("Wscript.Shell")
key = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{27625A79-D272-41EF-844B-6EAC87D4A51E}\"
WshShell.RegDelete key
And these values in the Custom Action:
Return Processing: Synchronous (ignores exit code)
In-Script Execution: Deferred Execution in System Context
Then I have tried to put it everywhere in the install sequence. no difference where I put it. The registry value isn´t removed.
I used this script:
Set WshShell = Wscript.CreateObject("Wscript.Shell")
key = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{27625A79-D272-41EF-844B-6EAC87D4A51E}\"
WshShell.RegDelete key
And these values in the Custom Action:
Return Processing: Synchronous (ignores exit code)
In-Script Execution: Deferred Execution in System Context
Then I have tried to put it everywhere in the install sequence. no difference where I put it. The registry value isn´t removed.
Posted by:
mekaywe
14 years ago
Posted by:
ekniranjan
14 years ago
Posted by:
mekaywe
14 years ago
Posted by:
anonymous_9363
14 years ago
Posted by:
anonymous_9363
14 years ago
Posted by:
mekaywe
14 years ago
Posted by:
Agathorn
14 years ago
Thanks for the reply pjgeutjens! I will try this as soon as I get InstallShild running again (license issue).
To further explain/excuse my wish to delete the uninstall registry key. I´m going to upgrade a software that was installed 4 years ago with Novell Snapshot ("just place a bunch of files in a location" type of packaging. I´m unable to uninstall the application but it seems as if I install the new one it works. And frankly I´m happy with that since we are in the making of upgrading out entire farm of clients anyway. So every installation on every machine will be "clean" so to speak.
To further explain/excuse my wish to delete the uninstall registry key. I´m going to upgrade a software that was installed 4 years ago with Novell Snapshot ("just place a bunch of files in a location" type of packaging. I´m unable to uninstall the application but it seems as if I install the new one it works. And frankly I´m happy with that since we are in the making of upgrading out entire farm of clients anyway. So every installation on every machine will be "clean" so to speak.
Posted by:
Agathorn
14 years ago
I tried to follow your directions pjgeutjens but I can´t get rid of the old uninstall string in the registry.
This is what I have entered in the RemoveRegistry table:
RemoveREgistry (s72): RemoveEndNote
Root (i2): 2
Key (l255): SOFTWARE\...\Uninstall\
Name: {1231-1234-1234-1234-1234}
Component_ (s72): EndNote.exe
I have checked that EndNote.exe is a component and it holds the executable for the program so this one has to be installed. Or am I wrong?
I have also tried to enter this (because it I press "help" in the window where I enter this I can read about "-" in the name indicated that the value should be removed. However I assume they are reffering to the "Registry" table.
RemoveREgistry (s72): RemoveEndNote
Root (i2): 2
Key (l255): SOFTWARE\...\Uninstall\{1231-1234-1234-1234-1234}
Name: -
Component_ (s72): EndNote.exe
Any tips what I could try next? Or what I´m doing wrong?
This is what I have entered in the RemoveRegistry table:
RemoveREgistry (s72): RemoveEndNote
Root (i2): 2
Key (l255): SOFTWARE\...\Uninstall\
Name: {1231-1234-1234-1234-1234}
Component_ (s72): EndNote.exe
I have checked that EndNote.exe is a component and it holds the executable for the program so this one has to be installed. Or am I wrong?
I have also tried to enter this (because it I press "help" in the window where I enter this I can read about "-" in the name indicated that the value should be removed. However I assume they are reffering to the "Registry" table.
RemoveREgistry (s72): RemoveEndNote
Root (i2): 2
Key (l255): SOFTWARE\...\Uninstall\{1231-1234-1234-1234-1234}
Name: -
Component_ (s72): EndNote.exe
Any tips what I could try next? Or what I´m doing wrong?
Posted by:
pjgeutjens
14 years ago
David,
I did some "product testing" [;)], the following entry in the RemoveRegistry table will uninstall the MyValue value in HKLM\SOFTWARE\MyKey\MySubKey. Only that value will be deleted. However it seems that if the HKLM\SOFTWARE\MyKey\MySubKey key is empty after this operation, it too will get deleted
The one below will delete the complete MySubKey key
Make sure the entries in the Key column do not begin or end with a slash.
Hope this helps
PJ
I did some "product testing" [;)], the following entry in the RemoveRegistry table will uninstall the MyValue value in HKLM\SOFTWARE\MyKey\MySubKey. Only that value will be deleted. However it seems that if the HKLM\SOFTWARE\MyKey\MySubKey key is empty after this operation, it too will get deleted
The one below will delete the complete MySubKey key
Make sure the entries in the Key column do not begin or end with a slash.
Hope this helps
PJ
Posted by:
Agathorn
14 years ago
Pjgeutjens,
Very grateful for your reply and effort to help me! However I can´t get it to work. I do exactly as you tell me (example 2 that you have, to uninstall the entire key). I have also tried to just create another key on the client and add a value to delete that one as well.
They only variable in this equation that I don´t really grasp is the component value. I have a drop down menu and I have tried 4 components now without result. The only important thing about which component to link to is that the component must be a component that gets installed, right? So if there is a file in the component and that file ends up on the target system after the package is installed, that component should be a good candidate to link to. Right?
Well if that same file isn´t in more then 1 component I guess and only one of the component is used.
And just to make things clear: This table is suppose to uninstall a registry key when the msi-package is installed, right?
Very grateful for your reply and effort to help me! However I can´t get it to work. I do exactly as you tell me (example 2 that you have, to uninstall the entire key). I have also tried to just create another key on the client and add a value to delete that one as well.
They only variable in this equation that I don´t really grasp is the component value. I have a drop down menu and I have tried 4 components now without result. The only important thing about which component to link to is that the component must be a component that gets installed, right? So if there is a file in the component and that file ends up on the target system after the package is installed, that component should be a good candidate to link to. Right?
Well if that same file isn´t in more then 1 component I guess and only one of the component is used.
And just to make things clear: This table is suppose to uninstall a registry key when the msi-package is installed, right?
Posted by:
pjgeutjens
14 years ago
They only variable in this equation that I don´t really grasp is the component value. I have a drop down menu and I have tried 4 components now without result. The only important thing about which component to link to is that the component must be a component that gets installed, right?
Yep, that's the way I see it too
You could try making a new component specifically for this operation, and linking it to a feature you're sure will be installed. Not sure what tools you have available, since exactly how hard this is depends on that
And just to make things clear: This table is suppose to uninstall a registry key when the msi-package is installed, right?
Yes, that's what the RemoveRegistry table does, you can do registry cleanup at uninstall time too, but for that you use the Registry table
a final thing you might want to verify is wether there's a RemoveRegistryValues action in the installation sequence (InstallExecuteSequence table). You might need to add it (again, difficulty of that depends on available tools [;)])
Hope you get somewhere
PJ
Posted by:
anonymous_9363
14 years ago
To clarify, the two tables get read by their respective actions, WriteRegistryValues and RemoveRegistryValues. The Registry table gets read by both actions. Thus, it may not depend on whether you're installing or uninstalling.
In general terms, I tend to view the use of the RemoveRegistry table as a means to remove registry entries which are not part of the installation, i.e. which aren't in the Registry table.
See this MSDN article and this one.
In general terms, I tend to view the use of the RemoveRegistry table as a means to remove registry entries which are not part of the installation, i.e. which aren't in the Registry table.
See this MSDN article and this one.
Posted by:
pjgeutjens
14 years ago
Posted by:
pjgeutjens
14 years ago
it may not depend on whether you're installing or uninstalling
Wondering if that's true. If I interpret that correctly you're saying that entries in the Registry Table that have a - in the Value column get uninstalled both when installing, and when uninstalling. Or am I reading that wrong?
EDIT: I know, I could just go ahead and test it, but I'm lazy like that [:D]
Posted by:
Agathorn
14 years ago
Posted by:
anonymous_9363
14 years ago
Posted by:
Agathorn
14 years ago
Posted by:
pjgeutjens
14 years ago
David,
I don't think the component is really that important. Anyway, to add a component in InstallShield, go to Setup Design, right-click a feature and select "new component", give it a name and off you go, the new component should automatically be linked to the feature.
For the RemoveRegistryValues action, go to Custom Actions and Sequences, Sequences-Installation-Execute. right-click ->Insert...
Choose Standard Actions instead of Custom Actions, RemoveRegistryValues should be there.
PJ
I don't think the component is really that important. Anyway, to add a component in InstallShield, go to Setup Design, right-click a feature and select "new component", give it a name and off you go, the new component should automatically be linked to the feature.
For the RemoveRegistryValues action, go to Custom Actions and Sequences, Sequences-Installation-Execute. right-click ->Insert...
Choose Standard Actions instead of Custom Actions, RemoveRegistryValues should be there.
PJ
Posted by:
Agathorn
14 years ago
Posted by:
mekaywe
14 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.