1

WCF (selfhost) サービス (いくつかの dll ファイルと app.config) を含む Windows サービス プロジェクトがあります。これは Wix でインストールされます。

Wix セットアップ パッケージへの参照を追加しました。Product.wxs ファイルは次のようになります。

<?xml version="1.0" encoding="UTF-8"?>

<Directory Id="TARGETDIR" Name="SourceDir">
    <Directory Id="MyAppINSTALLDIR" Name="MyApp 5Service">
        <Component Id="SampleServiceComponent" DiskId="1" Guid="6f51c0f3-776c-4aec-a200-1f199352c6c3" Win64="yes">
          <File Id="MyApp.WindowsService.exe" Name="MyApp.WindowsService.exe" Source="$(var.MyApp .WindowsService.TargetDir)\MyApp.WindowsService.exe"/>
          <ServiceInstall Id="InstallMyAppService" DisplayName="MyAppService" Name="MyApp .WindowsService.exe" Description="MyApp 5 Service - För effektivare och enklare operationsplanering" Account="NetworkService" ErrorControl="normal" Start="demand" Type="ownProcess" Vital="yes" />
          <ServiceControl Id="ControlMyAppService" Name="MyApp5.WindowsService.exe" Stop="uninstall" Remove="uninstall" />
        </Component>
    </Directory>
</Directory>

<Property Id="WIXUI_INSTALLDIR" Value="MyAppINSTALLDIR" />
<UIRef Id="WixUI_InstallDir" />

<Feature Id="ProductFeature" Title="Wix_MyApp.WindowsService" Level="1">
  <ComponentRef Id="SampleServiceComponent" />
</Feature>
<Media Id="1" Cabinet="SampleServiceComponent.cab" EmbedCab="yes" />
</Product>

そして、これはある程度機能し、いくつかの質問がありました:

  1. 現在、メインの Windows サービス exe ファイルのみが含まれていますか? Selfhost のすべての出力を含める必要があります
  2. インストールする前に Windows サービス プロジェクトの app.config を設定できるようにする必要があります (インストールされるサービスの名前を決定します)、圧縮を使用せずにセットアップを実行する前にファイルを設定することは可能ですか、それともセットアップ中に情報を取得しやすいですか?インストールして app.config に設定しますか?

編集1:

出力からすべてのファイルを取得するには、これに変更しましたが、機能しませんか? :

      <File Id="MyApp.WindowsService.Output"
        Name="$(var.MyApp.WindowsService.TargetFileName)"
        Source="$(var.MyApp.WindowsService.TargetPath)"
        KeyPath="yes" />

      <ServiceInstall Id="InstallMyAppService" DisplayName="MyAppService" Name="MyApp.WindowsService.exe" Description="MyApp 5 Service - För effektivare och enklare operationsplanering" Account="NetworkService" ErrorControl="normal" Start="demand" Type="ownProcess" Vital="yes" />
      <ServiceControl Id="ControlMyAppService" Name="MyApp.WindowsService.exe" Stop="uninstall" Remove="uninstall" />


    </Component>
4

1 に答える 1

1
  1. インストーラーに別のファイルを追加するには、インストーラーに新しいファイルを追加し、<Component>その中に を配置します<File><ComponentRef>また、にそのコンポーネントを配置する必要があります<Feature>
  2. <XmlConfig>または要素を使用<XmlFile>して、インストール中に app.config を変更できます。
于 2012-12-19T12:45:56.393 に答える