Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 5

Problem with complus and major upgrade

Installscript MSI project with 6 COMplus components. For our next release, one of the complus apps was altered to add a new interface. I 'refreshed' the app in the Component Services view, which resulted in a new GUID for the component in my project. Changing the component guid meant I had to author the setup as a major upgrade (I tried it as a minor upgrade and it didn't work - when I ran the upgrade validation in the IDE it pointed out my mistake).

My problem comes at uninstall. When I run the upgrade, the altered component gets updated and everything seems fine. But when I uninstall, it is being left behind (both the dll and a bunch of registry entries). I verified that it uninstalls properly if I run it as a first-time install on a clean machine, rather than as an upgrade.

Any ideas why this is happening or how I can expose some clues?

Labels (1)
0 Kudos
1 Reply
Level 5

I narrowed down the cause to the shared dll reference count. The two components the IDE automatically created for this complus app were flagged as 'shared', so with the previous release of the product installed, the reference count was at '1' before attempting the upgrade. It ended up at '2' after the upgrade instead of staying at 1 (as I believe it should have). So on uninstall the ref count dropped only back to 1 and the file and its associated registry entries were left behind.

If I change the 'shared' flag to 'no' for these components in the new build I am running as an upgrade, the count ends up as '0' after the upgrade and I end up with a clean uninstall.

This gives me a short-term fix, but there are plans to divide this product into two standalone install packages and this particular complus app would be common to both. Unless I misunderstand the purpose of the flag and the shared dll count, this is going to be a problem for me again very soon.

In my 'future case', wouldn't the matching components in the two packages have to be flagged as 'shared'?
0 Kudos