/build/static/layout/Breadcrumb_cap_w.png

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.

0 Comments   [ + ] Show comments

Answers (31)

Posted by: pjgeutjens 14 years ago
Red Belt
1
All "kidding" aside with scripting languages and what not, I'll try to answer the OP's original question:

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
Purple Belt
0
Agathorn,
Are you using wise or installshield.
Wise we can write wise script and for installshield i know VB script for registry removal.
Posted by: mekaywe 14 years ago
Brown Belt
0
Are you trying to delete just the UninstallKey and not the application ?
Posted by: Agathorn 14 years ago
Senior Purple Belt
0
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 :)
Posted by: mekaywe 14 years ago
Brown Belt
0
I believe you are trying to uninstall older version of your application before the higher version insalls.... is that your task?
Posted by: Agathorn 14 years ago
Senior Purple Belt
0
Yes my plan is to delete a folder and delete the registry key and then install the new application afterwards. Doing it all in one .mst to "attach" to the new msi file from the vendor.
Posted by: mekaywe 14 years ago
Brown Belt
0
you can use a Vbscript which will perform those actions and sequence it before InstallInitialize
Posted by: Agathorn 14 years ago
Senior Purple Belt
0
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.
Posted by: mekaywe 14 years ago
Brown Belt
0
Hey Prabas..., thats not the way how UninstallStrings are handled.
Your Vbscirpt shouldn't be used [:(]
Posted by: ekniranjan 14 years ago
Purple Belt
0
mekaywe,
I used this script to uninstall Reg and files which remain during uninstall ?
Is something wrong ?
Posted by: mekaywe 14 years ago
Brown Belt
0
The context in which you used is right.
but OP is trying to delete UninstallString and files of an applicaiton manually and install higher version which is not recommended.
Instead, older version has to be uninstalled before next version of app installs
Posted by: ekniranjan 14 years ago
Purple Belt
0
ok got it.
Posted by: anonymous_9363 14 years ago
Red Belt
0
WiseScript, VBScript....Have you guys not heard of the RemoveRegistry table? Check it out on MSDN.
Posted by: anonymous_9363 14 years ago
Red Belt
0
Notwithstanding what the OP wants to delete, what's all this nonsense with WiseScript, VBScript....have you guys not heard of the RemoveRegistry table? Check it out on MSDN.
Posted by: mekaywe 14 years ago
Brown Belt
0
of coz.. , there are many ways to delete a registry.
But what do you say friends..., is it good idea to delete Uninstall key and files of an application ( imagining the application got uninstalled ) and install higher version of an application?
Posted by: Agathorn 14 years ago
Senior Purple Belt
0
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.
Posted by: Agathorn 14 years ago
Senior Purple Belt
0
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?
Posted by: pjgeutjens 14 years ago
Red Belt
0
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
Posted by: Agathorn 14 years ago
Senior Purple Belt
0
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?
Posted by: pjgeutjens 14 years ago
Red Belt
0
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
Red Belt
0
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.
Posted by: pjgeutjens 14 years ago
Red Belt
0
Ian,

reading that second article about the Registry Table, the entry that has me wondering is:


- The key is to be deleted, if present, with all of its values and subkeys, when the component is uninstalled.
Posted by: anonymous_9363 14 years ago
Red Belt
0
Wondering what, Pieter?
Posted by: pjgeutjens 14 years ago
Red Belt
0
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
Senior Purple Belt
0
I use AdminStudio/InstallShield. Ill try to create a new component and link it to a feature. First I have to figure out how though :)
Posted by: anonymous_9363 14 years ago
Red Belt
0
Wondering if that's trueInteresting...! I don't know, is the honest answer. I was thinking more along the lines of it being the actions' execution rather than whether one was installing or uninstalling. So, the results of an experiment are eagerly awaited!
Posted by: Agathorn 14 years ago
Senior Purple Belt
0
I cant seem to figure out how to create an empty component and link it to a feature in InstallShield. Tried it in Orca but ... Well Orca isn´t really that user friendly now is it? :)
Posted by: pjgeutjens 14 years ago
Red Belt
0
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
Posted by: Agathorn 13 years ago
Senior Purple Belt
0
Thanks pjgeutjens,

I didn´t get it to work and I had to prioritize other packages where I work. But I´ll give it another try when I have the time. We are going to package 180 applications in 3 months so ... hehe. The Uninstall value will have to remain for now.
Posted by: mekaywe 14 years ago
Brown Belt
-1
Comeon.., this is UninstallString of an application. You shouldn't delete it directly.. like any other registry key.
It should be handled using "Upgrades" ..... add appropriate entries in your Upgrade Table
Posted by: ekniranjan 14 years ago
Purple Belt
-2
ss
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ