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.
使用VS2008 TFS我创建了一个安装两个Window Services的安装应用程序。始终安装和卸载第一个服务(并且工作正常 - 我使用的是安装程序类)。第二项服务是可选的。根据我设置的自定义条件,确定是否安装了第二个服务。如果请求安装正常(也使用安装程序类)。但是,我无法在卸载过程中卸载服务。服务exe已删除,但卸载无法卸载该服务。我在我的程序集文件(在文件系统中)和与此程序集关联的所有自定义操作上设置了Condition属性。我怀疑卸载的自定义操作是不正确的。我无法删除卸载自定义操作的条件 - 如果我这样做,我会收到错误(无法构建自定义操作名称,因为它使用有条件安装的文件。)我尝试了其他条件,但他们也无法卸载服务。
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 个解决方案
#1
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.
也许您可以在条件中添加额外的检查,以便在安装产品时仅评估为true。有一个Installed属性可能会提供您所需的。
#1
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.
也许您可以在条件中添加额外的检查,以便在安装产品时仅评估为true。有一个Installed属性可能会提供您所需的。