我有两个Windows服务的WIX安装程序。两者都使用相同的凭据安装,但一个工作,而另一个失败,错误“服务”PCP事件处理器-3.9.9.0-wix'(MyServiceExeName)无法安装。验证您是否具有足够的权限来安装系统服务。“。我对具有要使用的凭据的两个项目使用通用的wxi文件,因此它不是帐户名或域名拼写错误AFAICS。唯一的实质性区别是正在安装的两项服务是:
据我所知,两个安装程序的wxs文件之间没有真正的区别(显然GUID不同)。失败的组件具有如下的WIX安装程序代码:
<Component Id="cmpMainExe" Guid="{EXCISED-FOR-CUT-N-PASTERS}">
<File Id="filASJHDJSDJSHGDJH" Source="$(var.EventPollingService.TargetDir)\EventPollingService.exe" />
<ServiceInstall Name="$(var.SVCNAME)-$(var.ProductVersion)-$(var.BranchName)"
DisplayName="PCP $(var.SVCNAME)-$(var.ProductVersion)-$(var.BranchName)"
Type="ownProcess"
Interactive="no"
Start="auto"
Vital="yes"
ErrorControl="normal"
Description="Manages the state model of a user's session by handling incoming events from the dialler"
Account="$(var.ServiceAccountId)"
Password="$(var.ServiceAccountPwd)" />
<ServiceControl Id="StartWixServiceInstaller"
Name="$(var.SVCNAME)-$(var.ProductVersion)-$(var.BranchName)"
Start="install"
Wait="yes" />
<ServiceControl Id="StopWixServiceInstaller"
Name="$(var.SVCNAME)-$(var.ProductVersion)-$(var.BranchName)"
Stop="both" Wait="yes"
Remove="uninstall" />
</Component>
我在VS 2010中使用Wix 3.5和Votive,这两个项目都是.NET 3.5 SP1应用程序。我正在使用Windows 7,UAC已关闭。
有什么想法吗?
答案 0 :(得分:2)
查看ORCA from Windows SDK中的两个构建MSI,并验证ServiceInstall表条目看起来是否相同。
但是,根据我的经验,这不太可能是安装程序问题。这通常是指向应用程序问题的红色鲱鱼,例如缺少依赖项或应用程序异常。排除ServiceInstall条目并验证服务帐户凭据是否正确后,该帐户不会被禁用,并且该帐户有权作为服务登录,然后开始分析您的应用程序。当安装程序挂在错误窗口时,这是最容易做到的。
最后两个想法:
如果一个程序依赖于winsxs或GAC,那么它将无法运行,因为在尝试启动服务之后的Commit执行之前,这些不会安装
如果您需要授予用户LogonAsService权限,请查看WiX中的User元素。