2010-11-09 198 views
3

我在WIX服务中遇到了一些麻烦。我的msi安装程序可以创建Service,但创建后安装程序无法启动它。有我的代码,我用于服务。使用WIX安装Windows服务

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

回答

3

我将结合这两个服务控制元素成为:

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

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

+0

是的,我收到“错误1053:服务没有及时响应启动或控制请求”。但我可以使用CMD安装和运行此服务。 – 2010-11-09 14:18:46

+0

尝试取出ServiceControl元素并在isntall完成后手动启动服务(net start)。这是否工作或失败? – 2010-11-09 16:28:39