WiXにいくつかの追加ファイルを含むサービスをインストールし、実際のサービスEXEファイルを定義するにはどうすればよいですか?
シナリオ:単一のEXEファイルであるサービスがあり、次のコードを使用してWiXにWindowsNTサービスとしてインストールしました。
<Component Id='InstallMyServiceComponent' Guid='{....}' DiskId='1'>
<File Id='InstallMyServiceEXEFile' LongName='MyService.exe'
Name='MyServ.exe' src='MyService/bin/release/MyService.exe' KeyPath='yes'/>
<ServiceInstall Id='InstallMyService' Name='MyService' Description='My Service'
ErrorControl='normal' Start='auto' Type='ownProcess' Vital='yes' />
<ServiceControl Id='UninstallMyService' Name='MyService' Remove='uninstall'
Wait='yes' />
</Component>
<Component Id='RunMyServiceComponent' Guid='.......'>
<ServiceControl Id='RunMyService' Name='MyService' Start='install'
Stop='uninstall' Wait='no' />
</Component>
そして、このサービスをインストールしてオプションで開始できる機能がありました。
今、私の問題は-今私のサービスは成長し、単一のEXEはもはや単一のEXEではありません-それは複数のファイル、EXE、DLL、およびいくつかのサポートファイルです。
しかし、どうすれば今それをインストールできますか?
すべてのファイルを含むコンポーネントを作成しようとしました
<Component Id="MyService" Guid="......" DiskId="1">
<File Id="fileMyService_framework_dll" LongName="Framework.dll"
Name="Framewrk.DLL" src="MyService\Framework.dll" />
<File Id="fileMyService_dal_dll" LongName="MyServiceDAL.dll"
Name="SrvcDAL.DLL" src="MyService\ServiceDAL.dll" />
<File Id="fileMyService_helpers_dll" LongName="Helpers.dll"
Name="Helpers.DLL" src="MyService\Helpers.dll" />
<File Id="fileMyService_exe" LongName="MyService.exe"
Name="MySrv.EXE" src="MyService\MyService.exe" />
</Component>
まず、ServiceInstallタグとServiceControlタグをこのコンポーネントに追加しようとしました。
<Component Id="MyService" Guid="......" DiskId="1">
<File Id="fileMyService_framework_dll" LongName="Framework.dll"
Name="Framewrk.DLL" src="MyService\Framework.dll" />
<File Id="fileMyService_dal_dll" LongName="MyServiceDAL.dll"
Name="SrvcDAL.DLL" src="MyService\ServiceDAL.dll" />
<File Id="fileMyService_helpers_dll" LongName="Helpers.dll"
Name="Helpers.DLL" src="MyService\Helpers.dll" />
<File Id="fileMyService_exe" LongName="MyService.exe"
Name="MySrv.EXE" src="MyService\MyService.exe" />
<ServiceInstall Id='InstallMyService' Name='MyService'
Description='My Service' ErrorControl='normal' Start='auto'
Type='ownProcess' Vital='yes' />
<ServiceControl Id='UninstallMyService' Name='MyService'
Remove='uninstall' Wait='yes' />
</Component>
しかし、その後、私の「Framework.dll」が作成中のサービスのソースパスとして設定されます.......。
そのため、ServiceInstallを使用して実際にサービスをインストールするための2番目のコンポーネントを作成し、FileRefを使用してそのサービスEXEファイルを参照するだけだと思いましたが、(少なくともWix2では)存在しないようです。
<Component Id='InstallMyServiceComponent' Guid='{....}' DiskId='1'>
<FileRef Id='fileMyService_exe' KeyPath='yes'/>
<ServiceInstall Id='InstallMyService' Name='MyService'
Description='My Service' ErrorControl='normal' Start='auto'
Type='ownProcess' Vital='yes' />
<ServiceControl Id='UninstallMyService' Name='MyService'
Remove='uninstall' Wait='yes' />
</Component>
だから-必要なすべてのファイルをインストールし、NTサービスのインストールで正しいEXEファイル(コンポーネントのファイルリストから任意のファイルだけでなく)を取得するために、貧弱なWiX作成者は何をしなければなりませんか?
マーク