views:

181

answers:

2

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?

+1  A: 

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.
JaredPar
Thanks. I used this tool to remove product entry. Problem solved.
Micke
A: 

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.

David Hodgson