glumesc

September 13, 2011

Cannot uninstall shared component

Filed under: Development — Tags: , , , — steve @ 9:36 am

Here’s another issue that had me stretching the limits of my google-fu:

Scenario:

  1. Plugin being installed using WIX-generated merge module and installer
  2. Merge module has components that are potentially shared between several other plugins
    • Each component is flagged as < … Shared=”yes” SharedDllRefCount=”yes”> in the merge module WXS file.
  3. At some point in testing, the installer has failed on a particular machine.
  4. When the plugin is uninstalled on that test machine, the shared components are not removed even if there is nothing still referencing them.

To help debug this, I ran a manual uinstall, using msiexec, with verbose logging enabled:

msiexec /x myInstaller.msi /lv c:\uninstall.log

After much wading through the printout, the following line caught my eye:

MSI (s) (BC:B8) [09:41:31:294]: Executing op: UnregisterSharedComponentProvider(Component={F84EDDFB-2E5F-401B-9649-7B7F9CC32AD6},ProductCode={CCD6CBDA-859B-4846-88CC-24F7D64A4BCA})
MSI (s) (BC:B8) [09:41:31:294]: Executing op: ComponentUnregister(ComponentId={F84EDDFB-2E5F-401B-9649-7B7F9CC32AD6},,BinaryType=1,PreviouslyPinned=1)

Specifically, the “PreviouslyPinned” count. This indicates that Windows believes something else is referencing this component.

This led me to the crucial bits of information I was lacking: (a) remembering that at some point the installer had failed, which hinted at that fact that something hadn’t been cleaned up properly, and (b) identifying how Windows keeps a track of the shared components. The latter part was obviously registry related, which led me to the following location: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs

The solution was to manually delete all the relevent shared componenent entries (which are helpfully sorted by location) in that registry key. Once done, the install/uninstall cycle worked as expected.

Advertisement

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Theme: Silver is the New Black. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.