使用 WIX 安装 Windows 服务

发布于 2024-10-01 04:23:36 字数 977 浏览 0 评论 0原文

我在使用 WIX 服务时遇到一些问题。我的 msi 安装程序可以创建服务,但创建后安装程序无法启动它。这是我的代码,我将其用于服务。

<Component Id="borland_comp" Guid="{6F723B32-E95A-4545-87FD-0B5F7B114FCA}" DiskId="1">
        <File Id="server_ScktSrvr.exe" Name="ScktSrvr.exe"  KeyPath="yes"/>
        <ServiceInstall Id="BORLAND_Socket"
                            Name="Borland Socket Server"
                            DisplayName="Borland Socket Server"
                            Type="shareProcess"
                            Start="auto"
                            ErrorControl="normal"
                            Description="Borland Socket Server" />

        <ServiceControl Id="StartWixServiceInstaller"
                        Name="Borland Socket Server" Start="install" Wait="no" />

        <ServiceControl Id="StopWixServiceInstaller" Name="Borland Socket Server"
                        Stop="both" Wait="yes" Remove="uninstall"/>

      </Component>

I have some troubles with WIX Services. My msi installer can create Service, but after creation installer can't start it. There is my code, which I use for Service.

<Component Id="borland_comp" Guid="{6F723B32-E95A-4545-87FD-0B5F7B114FCA}" DiskId="1">
        <File Id="server_ScktSrvr.exe" Name="ScktSrvr.exe"  KeyPath="yes"/>
        <ServiceInstall Id="BORLAND_Socket"
                            Name="Borland Socket Server"
                            DisplayName="Borland Socket Server"
                            Type="shareProcess"
                            Start="auto"
                            ErrorControl="normal"
                            Description="Borland Socket Server" />

        <ServiceControl Id="StartWixServiceInstaller"
                        Name="Borland Socket Server" Start="install" Wait="no" />

        <ServiceControl Id="StopWixServiceInstaller" Name="Borland Socket Server"
                        Stop="both" Wait="yes" Remove="uninstall"/>

      </Component>

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

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

发布评论

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

评论(1

残疾 2024-10-08 04:23:36

我会将两个服务控制元素组合起来:

  <ServiceControl Id="scBSS" Name="Borland Socket Server" Stop="both" Start="install" Wait="yes" Remove="uninstall"/> 

尽管这可能不是您的问题。安装程序是否在安装过程中尝试启动它?您收到错误消息吗?如果您在安装后尝试启动它,是否会收到错误消息?您是否对服务本身进行了分析/调试,以确保没有丢失依赖项或配置数据或在代码中抛出任何异常?

I would combine the two Service Control elements to become:

  <ServiceControl Id="scBSS" Name="Borland Socket Server" Stop="both" Start="install" Wait="yes" Remove="uninstall"/> 

Although that probably isn't your problem. Does the installer attempt to start it during the install? Do you get an error message? If you try to start it after the install do you get an error message? Have you profiled / debug the service itself to make sure you aren't missing and dependencies or configuration data or throwing any exceptions in the code?

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