2010-11-09 196 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