我试图用相应的调试安装程序为我们的产品建立一个调试版本。我是新来的维克斯所以请原谅所有的天真所包含。在我的项目调试DLL是依赖于两个VS2008和VS2008SP1调试运行时。我在威克斯捆绑的运行时间与我的安装程序创建一个合并模块的功能。

<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'/>

我那么怎样才能打包调试运行时,以这样的方式自定义操作也有访问它?

有帮助吗?

解决方案

您不能。其中许多运行时的InstallFinalize恰好在安装结束时只承诺。相反,它是强烈建议您静态链接的CRT / ATL库到自定义操作,以便自包含的自定义操作完全。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top