4

アンインストール(またはアップグレード)するときに、再起動マネージャーが使用中のファイルについて不平を言っているため、再起動を強制しているという問題があります。

RESTART MANAGER: Detected that application with id 7000, friendly name 'javaw.exe', of type RmCritical and status 1 holds file[s] in use.
RESTART MANAGER: Did detect that a critical application holds file[s] in use, so a reboot will be necessary.

RESTART MANAGER が訴えているサービスは、Java ベースのサービスです。サービス (ここでは myservice.exe と呼ばれます) は、Java 子プロセスを再帰的に開始しています。

  myservice.exe --run
   ↳ javaw.exe --someArguments
      ↳ someother.exe --someArguments
         ↳ javaw.exe --someMoreArguments

サービス定義の Wix スニペット:

<DirectoryRef Id="BINDIR">
        <Component Id="myservice.exe" Guid="PUT-GUID-HERE">
            <File Id="myservice.exe" KeyPath="yes" Vital="yes"
                  Source="SourceDir\bin\myservice.exe"/>
            <ServiceInstall Id="MyService" Type="ownProcess"
                            Vital="yes" Name="MyService" DisplayName="My Service"
                            Description="My Service" Start="auto" Account=".\LocalSystem"
                            ErrorControl="normal" Interactive="no" Arguments="--run"/>
            <ServiceControl Id="MyService" Name="MyService" Wait="yes" Remove="uninstall" Stop="uninstall" Start="install"/>
        </Component>
</DirectoryRef>

さて、興味深い部分:

  • インストール時にサービスを開始できました

アンインストール時:

  • 実行されていない場合は削除されます
  • 実行中の場合、再起動に同意するだけ
    • 実際、約2〜3秒以内に停止します(StopServicesアクションによると思います)
    • 正常に削除されました (RemoveServices アクションによって)

Service* Tables のエントリは、これまでのところ良いようです。

ServiceControl-Table:
ServiceControl  Name       Event  Arguments  Wait  Component_
MyService       MyService  161               1     myservice.exe

ServiceInstall-Table:
ServiceInstall  Name       DisplayName  ServiceType StartType ErrorControl LoadOrderGroup Dependencies StartName Password Arguments Component_     Description
MyService       MyService  My Service   16          2         32769        .\LocalSystem                                  --run     myservice.exe  My Service


したがって、すべてを 分析すると、Restart Manager は Java プロセスが子プロセスであり、StopServices アクションによって停止されることを認識していないようです。

ここで同様の問題をいくつか見つけました: https
://www.mail-archive.com/wix-users@lists.sourceforge.net/msg57924.html

この問題を解決するための助けを事前にありがとう!

4

2 に答える 2