0

製品に対応するデバッグ インストーラーを使用してデバッグ ビルドを作成しようとしています。私は Wix を初めて使用するので、ここに含まれる素朴な表現をお許しください。私のプロジェクトのデバッグ DLL は、VS2008 と VS2008SP1 デバッグ ランタイムの両方に依存しています。これらのランタイムをインストーラーにバンドルするために、wix でマージ モジュール機能を作成しました。

<Include xmlns="http://schemas.microsoft.com/wix/2006/wi">


  <!-- Include our 'variables' file -->
  <!--<?include variables.wxi ?>-->

  <!--<Fragment>-->

    <DirectoryRef Id="TARGETDIR">

      <!-- Always install the 32 bit ATL/CRT libraries, but only install the 64 bit ones on a 64 bit build -->

      <Merge Id="AtlFiles_x86"
             SourceFile="$(env.CommonProgramFiles)\Merge Modules\Microsoft_VC90_ATL_x86.msm"
             DiskId="1"
             Language="1033"/>
      <Merge Id="AtlPolicy_x86"
             SourceFile="$(env.CommonProgramFiles)\Merge Modules\policy_9_0_Microsoft_VC90_ATL_x86.msm"
             DiskId="1"
             Language="1033"/>

      <Merge Id="CrtFiles_x86"
             SourceFile="$(env.CommonProgramFiles)\Merge Modules\Microsoft_VC90_DebugCRT_x86.msm"
             DiskId="1"
             Language="1033"/>
      <Merge Id="CrtPolicy_x86"
             SourceFile="$(env.CommonProgramFiles)\Merge Modules\policy_9_0_Microsoft_VC90_DebugCRT_x86.msm"
             DiskId="1"
             Language="1033"/>

      <Merge Id="MfcFiles_x86"
             SourceFile="$(env.CommonProgramFiles)\Merge Modules\Microsoft_VC90_DebugMFC_x86.msm"
             DiskId="1"
             Language="1033"/>
      <Merge Id="MfcPolicy_x86"
             SourceFile="$(env.CommonProgramFiles)\Merge Modules\policy_9_0_Microsoft_VC90_DebugMFC_x86.msm"
             DiskId="1"
             Language="1033"/>


      <!-- If this is a 64 bit build, install the relevant modules -->
      <?if $(env.Platform) = "x64" ?>

      <Merge Id="AtlFiles_x64"
            SourceFile="$(env.CommonProgramFiles)\Merge Modules\Microsoft_VC90_ATL_x86_x64.msm"
            DiskId="1"
            Language="1033"/>
      <Merge Id="AtlPolicy_x64"
             SourceFile="$(env.CommonProgramFiles)\Merge Modules\policy_9_0_Microsoft_VC90_ATL_x86_x64.msm"
             DiskId="1"
             Language="1033"/>

      <Merge Id="CrtFiles_x64"
             SourceFile="$(env.CommonProgramFiles)\Merge Modules\Microsoft_VC90_DebugCRT_x86_x64.msm"
             DiskId="1"
             Language="1033"/>
      <Merge Id="CrtPolicy_x64"
             SourceFile="$(env.CommonProgramFiles)\Merge Modules\policy_9_0_Microsoft_VC90_DebugCRT_x86_x64.msm"
             DiskId="1"
             Language="1033"/>

      <Merge Id="MfcFiles_x64"
             SourceFile="$(env.CommonProgramFiles)\Merge Modules\Microsoft_VC90_DebugMFC_x86_x64.msm"
             DiskId="1"
             Language="1033"/>
      <Merge Id="MfcPolicy_x64"
             SourceFile="$(env.CommonProgramFiles)\Merge Modules\policy_9_0_Microsoft_VC90_DebugMFC_x86_x64.msm"
             DiskId="1"
             Language="1033"/>

      <?endif?>

    </DirectoryRef>

    <Feature Id="MS2008_SP1_DbgRuntime"
             Title="VC2008 Debug Runtimes"
             AllowAdvertise="no"
             Display="hidden"
             Level="1">
      <!-- 32 bit libraries -->
      <MergeRef Id="AtlFiles_x86"/>
      <MergeRef Id="AtlPolicy_x86"/>
      <MergeRef Id="CrtFiles_x86"/>
      <MergeRef Id="CrtPolicy_x86"/>
      <MergeRef Id="MfcFiles_x86"/>
      <MergeRef Id="MfcPolicy_x86"/>

      <!-- 64 bit libraries -->
      <?if $(env.Platform) = "x64" ?>
        <MergeRef Id="AtlFiles_x64"/>
        <MergeRef Id="AtlPolicy_x64"/>
        <MergeRef Id="CrtFiles_x64"/>
        <MergeRef Id="CrtPolicy_x64"/>
        <MergeRef Id="MfcFiles_x64"/>
        <MergeRef Id="MfcPolicy_x64"/>
      <?endif?>

    </Feature>

  <!--</Fragment>-->
</Include> 

インストーラーのデバッグ ビルドを行っている場合は、次のようにその機能を含めます。

<!-- The 'Feature' that contains the debug CRT/ATL libraries -->
<?if $(var.Configuration) = "Debug"?>
  <?include ..\includes\MS2008_SP1_DbgRuntime.wxi?>
<?endif?>

唯一の問題は、私のインストーラーには、デバッグ ランタイムにも依存するカスタム アクションも含まれていることです。

<!-- Private key installer -->
<Binary Id="InstallPrivateKey" SourceFile="..\InstallPrivateKey\win32\$(var.Configuration)\InstallPrivateKey.dll"></Binary>
<CustomAction Id='InstallKey' BinaryKey='InstallPrivateKey' DllEntry='InstallPrivateKey'/>

では、カスタム アクションもデバッグ ランタイムにアクセスできるように、デバッグ ランタイムをパッケージ化するにはどうすればよいでしょうか。

4

1 に答える 1

2

できません。これらのランタイムの多くは、インストールの最後に発生する InstallFinalize でのみコミットされます。代わりに、CRT/ATL ライブラリをカスタム アクションに静的にリンクして、カスタム アクションが完全に自己完結するようにすることを強くお勧めします。

于 2010-05-01T22:31:28.957 に答える