我正在使用WiX 3.6爲Windows服務創建安裝程序。我有解決方案的建設,並能夠在我的開發機器上安裝服務,服務開始就像我想要的。由Wix安裝的Windows服務
當我將msi(Build或Release)複製到服務將運行的Windows Server 2003 R2計算機時,出現問題。
我能夠安裝服務,但是當我嘗試啓動服務,我得到一個錯誤
「服務啓動失敗。請確認您有足夠的權限 啓動系統服務。」
現在我可以安裝並啓動我創建的其他服務,因此我現在可以對服務器有權限。以下是我的服務安裝元素。
我的問題是,我錯過服務在開發機器上而不是服務器上啓動?
<File Id="CopyService.exe" Name="CopyService.exe" Source="..\CopyService\bin\$(var.CopyService.Configuration)\CopyService.exe" Vital="yes" KeyPath="yes" DiskId="1"/>
<File Id="App.config" Name="CopyService.exe.config" Source="..\CopyService\bin\$(var.CopyService.Configuration)\CopyService.exe.config" Vital="yes" KeyPath="no" DiskId="1"/>
<ServiceInstall
Id="ServiceInstaller"
Type="ownProcess"
Vital="yes"
Name="ACSIAccountingReports"
DisplayName="ACSI Accounting Reports"
Description="Service copies accounting reports from NetForum into an ACSI network folder."
Start="auto"
Account="LocalSystem"
ErrorControl="ignore"
Interactive="no">
</ServiceInstall>
<ServiceControl Id="StartService" Name="ACSIAccountingReports" Start="install" Wait="yes" />
<ServiceControl Id="StopService" Name="ACSIAccountingReports" Stop="both" Wait="yes" Remove="uninstall" />
應該指出,這是我的第一個WiX項目。我爲其他服務創建的安裝程序是VS 2010安裝項目。 – Sean
夫婦觀察,而不是答案。 1.根據我的經驗,您不能爲一個服務擁有兩個ServiceControl元素,我發現只有一個會運行,哪一個不清楚。 2.您是否在GAC中使用組件?如果是這樣,他們不會安裝,直到服務開始調用後,這往往會產生你所看到的錯誤。 – Neil