使用 WIX 安装 Windows 服务
我在使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我会将两个服务控制元素组合起来:
尽管这可能不是您的问题。安装程序是否在安装过程中尝试启动它?您收到错误消息吗?如果您在安装后尝试启动它,是否会收到错误消息?您是否对服务本身进行了分析/调试,以确保没有丢失依赖项或配置数据或在代码中抛出任何异常?
I would combine the two Service Control elements to become:
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?