Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

How to remove old registry entries.


4 replies to this topic

AlexLX

AlexLX
  • Full Members
  • 27 posts

Posted 20 March 2012 - 08:16

Hi,

I want to remove old registry entries which were added by older releases.
Let me explain my issue with example.
There was one build say 1 in which there was a registry entry "[HKEY_LOCAL_MACHINE\SOFTWARE\ABC\{99C41FDE-98E8-4608-8ECC-BE1940916AA7}]" in component say "Component1"..

A patch was created say 2 and under that patch the value of registry in"Component1". was changed to "[HKEY_LOCAL_MACHINE\SOFTWARE\XYZ\{99C41FDE-98E8-4608-8ECC-BE1940916AA7}]"

Now we have created a major upgrade say 3 and have removed "Component1" and hence the whole registry entry.

There is no registry entries if we install 3 .
However if we upgrade 1->2->3 and then uninstall the whole build the registry entries which were created while installing 1 still remains.

Do I have to write a script to remove this registry entry.(I tried using RemoveRegistry table but nothing worked).

Thanks,
Alex

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 22 March 2012 - 11:40

Your change from version 1 to version 2 orphaned the ABC entry. I think it would have been best to use RemoveRegistry in version 2.
BTW: the registry entry isn't the key path of the component I hope.

But RemoveRegistry should work even in version 3 if it is populated properly. Plase post your settings.

AlexLX

AlexLX
  • Full Members
  • 27 posts

Posted 29 March 2012 - 08:01

Hi Stefan,

Sorry for the late reply.
Following are the settings that I used in RemoveRegistry after deleting NewComponent1 from Version 3(which is a major upgrade)

RemoveRegistry: HKEY_LOCAL_MACHINE

Root: 2

Key: SOFTWARE\ABC\{<CLSID value>}

Name: "-"

Component: NewComponent1

Note:
NewComponent1 was the component which was having the registry file in version 1 and version 2 and which was removed in version 3.

So in minor upgrade even if we modify the component value(without deleting them), it will make the original value orphaned?
what should have i done in version 2: Created a new component to have the new registry entry and removed the registry entry in NewComponent1 or should I have used RemoveRegistry

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 29 March 2012 - 20:05

QUOTE
Note:
NewComponent1 was the component which was having the registry file in version 1 and version 2 and which was removed in version 3.
I guess that's the problem. The RemoveRegistry will delete the entry, if the specified component get *installed*, so you need to specify some component here that is actually being installed.

QUOTE
So in minor upgrade even if we modify the component value(without deleting them), it will make the original value orphaned?
Modifying the value shouldn't be a problem, but changing the name or the key is a problem.
If you had removed the old registry entry from the component this wouldn't have removed it. Components should be treated as atoms - don't split them or remove parts of it. If you must, use the RemoveRegistry table.

AlexLX

AlexLX
  • Full Members
  • 27 posts

Posted 30 March 2012 - 05:56

I thought under Component i should put the name of the component which was having the registry entry(which was eventually removed in version 3).

Thanks for clearing my doubt.