Micke
Micke

Reputation: 21

Can't uninstall a service developed in Visual Studio

I have a Visual Studio project consisting of a service and an installer for it. During the development I have installed and uninstalled the msi-package at least fifty times but last time I tried to uninstall it I got an error message saying "the installed product does not match the installation source" and if I click "Ok" on that message i get the following: "The path xxxxxx.msi cannot be found." So, first it doesn't match and then cannot be found. Or something. The msi-package do exist on the path given in error message (I have replaced the real path and package name by xxxxx).

What I mean by installing the service is double clicking the msi-package that the "Build Solution" function creates and by uninstalling I mean Control Panel -> Add or Remove Programs.

I use Windows XP and Visual Studio 2003 in this particular project.

I have installed and uninstalled this and other visual studio developed services hundreds or thousands of times but have never had this problem before.

What should I do?

Upvotes: 2

Views: 1654

Answers (3)

yvoloshin
yvoloshin

Reputation: 378

I had a problem just like this one, where a service in Visual Studio somehow became corrupted and could be neither fully uninstalled nor installed. I managed to fully uninstall it using an online tool at https://support.microsoft.com/en-us/help/17588/fix-problems-that-block-programs-from-being-installed-or-removed.

Upvotes: 0

David Hodgson
David Hodgson

Reputation: 10344

Another utility I've used to get rid of a Windows service is sc.exe. You can do something like: sc.exe delete "Service name". Restarting the machine also helps sometimes.

Upvotes: 0

JaredPar
JaredPar

Reputation: 754585

I've seen this happen before. Essentially the installer (.msi) windows wants to use is not available where it believes it should be stored. Why this happens I'm not entirely sure but to fix it you have a couple of options.

  1. Put your MSI in the place where windows is looking for it
  2. Forcefully remove your product entry from the MSI catalog using MsiZap. This option is a bit riskier since it's deleting all references to your service vs actually uninstalling it. However the risk is low if it's a service you've developed and it's just your dev machine.

Upvotes: 1

Related Questions