Add / Remove Programs "Repair" function causes services error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've created a Windows Service and Installer using the MSDN Walkthrough
article. However, if I select "Change" then "Repair" out of the Add / Remove
Programs list then I get the error "The specified service already exists"

Anyone know how to fix this error or disable the Repair function?

Thanks!
 
You get this because a repair is a reinstall, and a reinstall includes
running custom actions, and so the Installer class tries to reinstall the
Service.
You can correct this by adding a Condition of NOT REINSTALL on the Installer
class Install and Commit custom actions so that they don't get called during
a repair, when the Windows Installer REINSTALL property is set.
 
Adding the "NOT REINSTALL" to the Condition property of the Custom Action
solved the problem.

Thanks for the tip Phil! I'll have to take a look at that book of yours!
 
Back
Top