views:

335

answers:

1

Using VS2008 TFS I have created a setup application that installs two Window Services. The first service is always installed and uninstalled (and works fine--I'm using the installer class). The second service is optional. Depending a custom condition I set up determines whether the 2nd service is installed. If requested the install works fine (using the installer class also). However, I cannot get the service to uninstalled during the uninstall process. The service exe is deleted, but the uninstall fails to uninstall the service. I have set the Condition property on my assembly file (in the File System) and on all the custom actions associated with this assembly. I suspect it is the custom action on the uninstall that is incorrect. I am unable to remove the condition on the uninstall custom action--I get an error if I do (Unable to build custom action name because it uses a conditionally installed file.) I have tried other conditions but they too fail to uninstall the service.

To ensure my installer class is working okay, as a test, I removed all conditions and forced the 2nd service to install. The install and uninstalled worked fine in this case. Hope someone can help. Thanks in advance.

+1  A: 

Perhaps you can add an additional check in your condition, so that it only evaluates to true if the product is installed. There is an Installed property that might give you what you need.

Richard Hein
Thanks. Tried INSTALLED, but this did work for me. Forcing the condition to true appears to have done the trick. Not being sure what value to get it I tried the numeric value of 1. This worked. Install and Uninstall processes are working as planned whether the 2nd service was installed or not. Thank you.
clsturgeon
previous comment should have said... "Tried INSTALLED, but this did NOT work for me."
clsturgeon

related questions