2017-09-26 10 views
0

設定ファイルのxmlノードを変更しています。私がそれをした後、サービスは自動的に開始しません。設定ファイルを変更すると、サービスが起動せず、インストーラの実行中に特権エラーが発生します

Service component

<Component Id="cmp1" Guid="{guid1}"> 
      <File Id="fil1" KeyPath="yes" Source="$(var.SourceDir)\Service1.exe" /> 
      <ServiceInstall Id="ServiceInstall1" 
          Type="ownProcess" 
          Name="SCService1" 
          DisplayName="xyz" 
          Description="abc" 
          Start="auto" 
          Account="NT Authority\NetworkService" 
          ErrorControl="normal" 
          Vital="yes" > 
      <util:ServiceConfig FirstFailureActionType="restart" SecondFailureActionType="restart" ThirdFailureActionType="none" ResetPeriodInDays="1" /> 
      <ServiceConfig DelayedAutoStart="yes" OnInstall="yes" OnReinstall="yes" /> 
      </ServiceInstall> 
      <ServiceControl Id="ServiceControl1" Name="SCService1" Start="install" Stop="uninstall" Remove="uninstall" Wait="no" /> 

Config Component

<Component Id="cmp2" Guid="{guid2}"> 
    <File Id="fil2" KeyPath="yes" Source="$(var.SourceDir)\Service1.exe.config"/> 
</Component> 


<!--XML config file upgrade change--> 
<Component Id="ServiceConfigUpgrades" Guid="{guid3}"> 
        <Condition><![CDATA[(INSTALLDIR <> "") AND NOT REMOVE]]></Condition> 
        <CreateFolder /> 
        <util:XmlFile Id="UpdateServiceVersion" 
          File="[#fil2]" 
          Action="setValue" 
          Name="sku" 
          Value=".NETFramework,Version=v4.6.2"         
          ElementPath="configuration/startup/supportedRuntime" /> 
</Component> 

私は、ログに次のエラーメッセージと同じを取得:Error 1920. Service 'Service' (ServiceSvc) failed to start. Verify that you have sufficient privileges to start system services. MSI (s) (B4:18) [14:59:16:380]: Product: XYZ -- Error 1920. Service 'Service' (ServiceSvc) failed to start. Verify that you have sufficient privileges to start system services.

私はこのケースでは、サービスを手動で開始する必要があり、違うインストーラが単独でサービスを開始できる理想的なケースです。また、これは新しくインストールしたもので、アップグレード時ではなくこのエラーが発生します。

+0

"NT AUTHORITY \ NetworkService"を試してみてください。ここからhttps://msdn.microsoft.com/en-us/library/windows/desktop/ms684272%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396 "アカウント名はNT AUTHORITYでなければなりません\ NetworkService "この質問から2番目の回答https://stackoverflow.com/questions/1606361/wix-serviceinstall-setting-the-service-to-run-under-the-networkservice-account –

+0

あなたのServiceInstallとServiceControlはSCService1を参照しています表示名はxyzです。メッセージは「Service」と「ServiceSvc」を参照していますので、名前を変更しましたか?または、あなたが始めようとしている別のサービスがありますか? – PhilDW

+0

@PhilDWええ、私は名前を変えました、すべて同じサービスを指しています。変更中にエラーが発生しました。 – Atihska

答えて

0

この問題は、INSTALLDIRではなくINSTALDIRを使用して解決しました。私はそれを間違って綴った。

関連する問題