66

Wixで以下のコードを使ってみました。

しかし、インストール時に、インストーラーのステータスが3分間フリーズしていました:サービスを開始すると、「サービスジョブサービスを開始できませんでした。システムサービスを開始するための十分な権限があることを確認してください」というメッセージが表示されました。私のコードに何か問題がありますか?また、インストール中にWindowsシステムのユーザー名とパスワードを入力して「特権」を取得するようにユーザーに依頼することはできますか?

どうもありがとう!

    <File Id='JobServiceEXE' Name='JobService.exe' DiskId='1'
        Source='JobService.exe' Vital='yes' KeyPath='yes'/>         
    <ServiceInstall Id="ServiceInstaller" Type="ownProcess" Vital="yes"
        Name="JobService" DisplayName="123 Co. JobService"
        Description="Monitoring and management Jobs" Start="auto"
        Account="LocalSystem" ErrorControl="ignore" Interactive="no" />
    <ServiceControl Id="StartService"  Stop="both" Remove="uninstall"
        Name="JobService" Wait="yes" />
</Component>
4

4 に答える 4

17

このページの解決策はサービスを正しくインストールしますが、ServiceControl 要素がサービスを開始しないことがわかりました。

wix インストール済みサービスと手動インストール済みサービス (「JobService.exe /install」) を比較すると、「実行可能ファイルへのパス」フィールドに開始スイッチがありませんでした。ServiceInstall の引数属性を使用して wix でこれを修正しました。

<File Id='JobServiceEXE' Name='JobService.exe' DiskId='1' Source='JobService.exe'  KeyPath='yes'/>         
  <ServiceInstall
  Id="ServiceInstaller"
  Type="ownProcess"
  Name="JobService"
  DisplayName="123 Co. JobService"
  Description="Monitoring and management Jobs"
  Start="auto"
  Account="[SERVICEACCOUNT]"
  Password="[SERVICEPASSWORD]"
  ErrorControl="normal"
  Arguments=" /start JobService"
  />
  <ServiceControl Id="StartService" Start="install" Stop="both" Remove="uninstall" Name="JobService" Wait="yes" />
</Component>

長い間潜んでいた、これが私の最初の投稿です。誰かの役に立てば幸いです。

于 2011-04-12T23:58:56.727 に答える
6

WiX のバージョン 3.x のユーザー向けの更新。次のコードは、ローカル アカウントでサービスをインストールして開始します。ServiceInstall タグの Arguments プロパティに注意してください。

<File Source="$(var.MyService.TargetPath)" />
<ServiceInstall Id="ServiceInstaller" Name="MyService" Type="ownProcess" Vital="yes" DisplayName="My Service" Description="My Service Description" Start="auto" Account="LocalSystem" ErrorControl="normal" Arguments=" /start MyService" Interactive="no" />
<ServiceControl Id="StartService" Name="MyService" Stop="both" Start="install" Remove="uninstall" Wait="yes" />
于 2018-07-26T19:29:09.777 に答える