为我的服务应用程序安装 Wix 我遇到了这样的麻烦 - 当我选择“修复”选项时,安装后我被提示重新启动我的电脑。实际上我的测试安装只包含两个文件。虽然有一些属性使安装程序停止服务(实际上由于日志而停止并卸载服务),但文件仍然忙于服务的进程。我究竟做错了什么?有什么解决方法吗?在这种情况下,我怎样才能摆脱重启提示?这是安装程序的代码:
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="AGENTFOLD">
<Component Id="WindowsAgent" Guid="*">
<File Id="WinAgent" KeyPath="yes" Source="WindowsAgent.exe"/>
<ServiceInstall Id='WindowsAgentInst' Name='WindowsAgent' DisplayName='WindowsAgent' Type='ownProcess' Account='LocalSystem' Start='auto' ErrorControl='normal'/>
<ServiceControl Id="WindowsAgentControl" Name="WindowsAgent" Stop="both" Start="install" Remove="uninstall" Wait="yes" />
</Component>
<Component Id="cmp2" Guid="GUIDHERE">
<File Id="fil2" KeyPath="yes" Source="mydll.dll" />
</Component>
</ComponentGroup>
</Fragment>
这是日志所说的:
信息 1603。文件 C:\Program Files(x86)\WindowsAgent\mydll.dll 正在使用中。关闭该应用程序并重试。
MSI (s) (88:78) [17:01:50:993]:产品:Setuptest。以下进程正在使用文件 C:\Program Files (x86)\WindowsAgent\mydll.dll:名称:WindowsAgent,ID 3384。
信息 1603。文件 C:\Program Files (x86)\WindowsAgent\WindowsAgent.exe 正在使用中。关闭该应用程序并重试。
MSI (s) (88:78) [17:01:51:182]:产品:Setuptest。以下进程正在使用文件 C:\Program Files(x86)\WindowsAgent\WindowsAgent.exe:名称:WindowsAgent,ID 3384。
请注意,如果我在维修前手动停止服务,一切正常。