WIX安装的程序没有正确卸载

时间:2009-07-15 20:03:54

标签: windows-services wix

这是我的情况。

我有两个程序。让我们称他们为程序A和程序B. 他们都使用WIX来创建MSI包。

A是WindowsService,B是Windows WCF服务

安装服务时,A和B安装没有问题。 没有打开服务..

当我尝试卸载A或B时(顺序无关紧要),安装的信息不会从注册表中删除,服务仍显示在服务管理控制台上。但是,目录中的文件将被删除。

我必须转到命令提示符并手动输入“sc delete A.exe(或B.exe)”,以便从注册表和服务管理控制台中删除该服务。

完成此操作后,第二个要卸载的程序将毫无问题地卸载。

我首先尝试卸载哪个程序无关紧要,结果是一样的。

我不知道导致卸载过程的依赖项或其他因素无法完全卸载第一个程序..

如果你们有任何想法,请帮助..疯了...... !!!

巴库

4 个答案:

答案 0 :(得分:0)

  1. 您在设置中是否有重复的GUID?检查组件guids是否唯一,并且在两个设置中都没有使用guid。
  2. 您是否在卸载时使用ServiceInstall删除服务?

答案 1 :(得分:0)

以下是相应部分在我的WiX文件中的显示方式:

<ServiceInstall Arguments="CdiTranIdSvc" Account="$(var.SvcUserDomain)\$(var.SvcUserLogin)" Password="$(var.SvcUserPassword)" Id="ServiceInstallTranIdentification" Name="CdiTranIdSvc" Type="ownProcess" Start="auto" ErrorControl="normal" DisplayName="CDI Transactions Identification">

<ServiceControl Id="ServiceControlTranIdentification" Name="CdiTranIdSvc" Start="install" Stop="uninstall" Remove="uninstall">

答案 2 :(得分:0)

我知道这是一篇很老的帖子,但是当我遇到这个问题时我就到了这里,这就是我发现的对我有用的。

Plain Old Stan有一篇关于此的短篇博文: http://plainoldstan.blogspot.com/2010/11/wix-installing-and-uninstalling-windows.html

它解决了我从注册表中卸载服务的问题。我认为它归结为删除=“两个”。

这是节点:

<ServiceControl Id='ControlStansWinService' Remove='both' Name='StansWinService' 
                        Start='install' Stop='both' Wait='yes' />

您可能需要清理以前的安装,然后才能重新安装,最好在命令提示符下使用“sc delete [service name]”。另外,请注意,但您可以在“HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services”下的注册表中找到服务

希望这有助于某人。 WIX安装程序很棒!

答案 3 :(得分:-2)

之前我不得不使用Microsoft Windows Installer CleanUp Utility。 可以找到here.