cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
OneDayBehind
Pilgrim

Windows Service Uninstall Leaves Files Behind

I have a Windows Service that is making me extremely mad. It installs just fine, but when I uninstall it, the main executable (.exe) and assemblies don't get uninstalled and the log file states "Removal completed successfully". I've created MSIs for Windows Services before and this is the first time I haven't been able to get the uninstall to work properly.


  • The Windows Service is a .NET 4.0 WCF service, if that matters.
  • Whether I use InstallShield's "Services" section or a ProjectInstaller.cs class in the service itself, it doesn't matter... neither affect the uninstall.
  • I changed the "Shared" property of all the assemblies to "No"... made no difference.
  • The only InstallShield scripts in the MSI run when the MSI installs via the install condition "(Not Installed) OR REINSTALL", so I don't think they are the issue.


Any tips on what I can try to get this service to uninstall cleanly?

Attached is the unistall log, should one of you be so generous as to help figure-out if there's something obvious that I'm missing :o

Labels (1)
0 Kudos
4 Replies
Highlighted
OneDayBehind
Pilgrim

Re: Windows Service Uninstall Leaves Files Behind

More info...

I have the Control Settings for the service set to stop the service and delete it on Uninstall, yet neither are happening. The Application event log should show an informational message when the service stops, which it doesn't. :mad:

0 Kudos
Highlighted
OneDayBehind
Pilgrim

Re: Windows Service Uninstall Leaves Files Behind

Figured it out (after only about 2 million hours of trying.)

The files that weren't uninstalling were all listed in the server's registry as "SharedDLLs". I had found many references to shared DLLs on this forum, but none of the posts lead me to the right spot in the registry. This is the correct registry path to look... at least for my app:

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\SharedDLLs]

I deleted all the registry keys related to my MSI and made sure that none of the components were marked as "Shared" in InstallShield, and now the MSI uninstalls all files.

Yeah me. :)
0 Kudos
mano_n_s75
Pilgrim

Re: Windows Service Uninstall Leaves Files Behind

Was this issue coming in only one machine ?

when you install the shared component it will have the shared count created in the registry location that you were mentioning. when you uninstall the msi will take care of removing the count and the registry if the component is not used by other products
0 Kudos
Highlighted
StevenEdison
Pilgrim

Thanks, you saved me.

OneDayBehind wrote:
Figured it out (after only about 2 million hours of trying.)

The files that weren't uninstalling were all listed in the server's registry as "SharedDLLs". I had found many references to shared DLLs on this forum, but none of the posts lead me to the right spot in the registry. This is the correct registry path to look... at least for my app:

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\SharedDLLs]

I deleted all the registry keys related to my MSI and made sure that none of the components were marked as "Shared" in InstallShield, and now the MSI uninstalls all files.

Yeah me. :)


I've been trying to figure this out for a couple of days. Who would have thought a service would go to SharedDLLs as default. I'm surprised there's not more places within a search to mention this as a solution. Thanks again!
0 Kudos