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

Uninstall does not remove registy entries


5 replies to this topic

reddygopu

reddygopu
  • Full Members
  • 4 posts

Posted 05 February 2016 - 10:12

 

I have created two MSIs(mypkg1.0.0 & mypkg2.0.0) with different product codes and versions. The two MSIs are creating below registry entries respectively during installation. The component codes of two MSIs which are creating registry keys are same.

mypkg1.0.0

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\{companyname}\1.0

mypkg2.0.0

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\{companyname}\2.0

I have installed two MSIs successfully and above registry entries got created. If I uninstall any of the two installed MSIs , the respective registry key is not getting removed. The registry key is getting removed only for the last uninstalled MSI.

 

Scenario: 1
mypkg2.0.0 uninstall, HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node{companyname}\2.0 => Not removed

mypkg1.0.0 uninstall, HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node{companyname}\1.0 => Removed

 

Scenario: 2
mypkg1.0.0 uninstall, HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node{companyname}\1.0 => Not removed

mypkg2.0.0 uninstall, HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node{companyname}\2.0 => Removed

 

Why the registry key is not removed if two packages are installed. Do we need to change the component code though product code and version are different?


Edited by reddygopu, 05 February 2016 - 11:08.


deramor

deramor
  • Full Members
  • 187 posts

Posted 05 February 2016 - 17:10

What you have described is the method by which Installer packages "Share" files across different installers.  However they don't really share files but rather share components.  In your case, because 2 installation have the same component codes, each component is being marked as shared.  If you review other system changes by other components that share a component code, are they also not removed when you uninstall one version?

 

Also, since you likely have different settings or system changes in each component, I suspect that you also will be left with large % of one of your installer left on the system after you remove both.  This is because package 1.0.0 only understands 1.0.0 system changes.  The same is true for 2.0.0.  Depending on which version you removed second, the system changes of the first would remain.

 

Do you have a need to install these versions side-by-side?  If not, I suggest removing the older version in the newer one.

 

If you do, then there are some things you need to change to support this.

1. You should change the component codes.

2. You should change the upgrade code as well as product and package codes.

 

This is a VBScript that will help you update all the component guids.

 

ISM_FILE_PATH = .\myism.ism

Dim m_ISWiProj
Dim m_Feature
Dim m_Comp

set ism_project = CreateObject("ISWiAuto22.ISWiProject")
ism_project.OpenProject ISM_FILE_PATH, false

set m_Feature = ism_project.ISWiFeatures("Name of feature")

If Not m_Feature Is Nothing Then
    For Each m_Comp In m_Feature.ISWiComponents
        Set TypeLib_project = CreateObject("Scriptlet.TypeLib")
        Builder.LogMessage m_Comp.Name & "   " & TypeLib_project.GUID
        m_Comp.GUID = TypeLib_project.GUID
    Next
end if

ism_project.SaveProject()
ism_project.CloseProject()

 

 

I have some experience with this as I have an installer that has many versions and can co-exist with older versions of itself.

Take care to not have any common shortcuts, registry keys, or folder paths.  It's a good idea to include the major.minor version in any folder paths or shortcut folders to make sure they are unique to only one version.



Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 10 February 2016 - 16:36

Component codes should be identical if the component installs identical resources, like the same file (might be different version) or same registry key. However you have to different registry keys ("1.0" and "2.0") so the component guid should be different - assuming that there are no other shared resources in that component.



reddygopu

reddygopu
  • Full Members
  • 4 posts

Posted 15 February 2016 - 12:49

Thanks Deramor and Kruger. 

 

I need to install those versions side-by-side. I have changed the component code for each component , product code and package code.

Now all the registry entries getting removed successfully.

 

thank you Deramor for providing the code to automatically update all component GUIDs.

 

Is there any way to support side-by-side installation without changing component code?



Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 17 February 2016 - 19:02

Is there any way to support side-by-side installation without changing component code?

No.



deramor

deramor
  • Full Members
  • 187 posts

Posted 18 February 2016 - 01:45

Having the same component code is how Windows Installer handles "Shared files" across 2 or more installations.  Regardless of the files or install location for your components, if 2 components have the same code, they will be treated as shared and all products that installed them would need to get removed.  Having different files and paths or registry values complicates this by creating orphaned files/keys. 

 

Once you implement the code to change the component codes, you shouldn't even notice the changes as your automated process will take care of all that for you.