两个几乎相同的 WIX 项目 - 一个工作正常,另一个因安全问题而失败

发布于 2024-09-16 08:28:46 字数 1726 浏览 3 评论 0原文

我有两个 Windows 服务的 WIX 安装程序。两者均使用相同的凭据进行安装,但其中一个可以运行,而另一个则失败,并出现错误“无法安装 Service "PCP Event Processor-3.9.9.0-wix' (MyServiceExeName)”。验证您是否有足够的权限来安装系统服务。”。我对两个项目使用一个通用的 wxi 文件以及要使用的凭据,因此它不是帐户名或域名拼写错误 AFAICS。正在安装的两个服务是:

  • 失败的项目有一个用于第 3 方组件的 .licx 文件
  • 失败的项目是一个 WinExe 项目 成功的安装是一个 Exe(控制台样式应用程序)

据我所知,没有真正的项目。两个安装程序的 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

有什么想法吗?

I have WIX installers for two windows services. Both are installed using the same credentials, but one works while the other fails with the error "Service "PCP Event Processor-3.9.9.0-wix' (MyServiceExeName) could not be installed. Verify that you have sufficient privileges to install system services.". I use a common wxi file for both projects with the credentials to use, so it's not an account name or domain name typo AFAICS. The only substantial differences between the two services being installed are:

  • The failing project has a .licx file for the 3rd party component.
  • the failing project is a WinExe project. The successful install is an Exe (Console style app)

As far as I can see, there is no real difference (obviously GUIDs are different) between the wxs files for the two installers. The failing component has WIX installer code like this:

<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>

I'm using Wix 3.5 with Votive in VS 2010, and both projects are .NET 3.5 SP1 apps. I'm using Windows 7, with UAC turned off.

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

給妳壹絲溫柔 2024-09-23 08:28:46

查看来自 Windows SDK 的 ORCA 中的两个构建 MSI,并验证ServiceInstall 表条目看起来相同。

但是,根据我的经验,这不太可能是安装程序问题。这通常是一个转移注意力的问题,表明存在应用程序问题,例如缺少依赖项或应用程序异常。排除 ServiceInstall 条目并验证服务帐户凭据正确后,该帐户不会被禁用,并且该帐户有权作为服务登录,然后开始分析您的应用程序。当安装程序挂在错误窗口时,这是最容易做到的。

最后两个想法:

如果程序依赖于winsxs或GAC,它将无法工作,因为在尝试启动服务之后提交执行之前,这些程序不会安装

如果您需要授予用户LogonAsService权限,请查看用户WiX 中的元素。

Look at the two build MSI's in ORCA from Windows SDK and verify the ServiceInstall table entries look the same.

However, in my experience, this is not likely to be an installer issue. This is usually a red herring that points to an application problem such as missing dependencies or application exception. After you rule out the ServiceInstall entries and verify that the service account credentials are correct, the account is not disabled and the account has the authority to logon as a service then start profiling your application. This is easiest to do right when the installer is hung at the error window.

Two last thoughts:

If a program has dependencies on the winsxs or GAC it won't work as these don't get installed until Commit execution which is after trying to start the service

If you need to grant the user LogonAsService rights look at the User element in WiX.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文