7

起動条件はどうですか?x86インストーラーが64ビットシステムで実行されないようにする必要がありますが、効果がないようです。

<!-- Launch Condition to check that x64 installer is used on x64 systems -->
<Condition Message="64-bit operating system was detected, please use the 64-bit installer.">
  <![CDATA[VersionNT64 AND ($(var.Win64) = "no")]]>
</Condition>

var.Win64次のようなMSBuild変数から派生します。

  <!-- Define platform-specific names and locations -->
  <?if $(var.Platform) = x64 ?>
  <?define ProductName = "$(var.InstallName) (x64)" ?>
  <?define Win64 = "yes" ?>
  <?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
  <?define PlatformCommonFilesFolder = "CommonFiles64Folder" ?>
  <?else ?>
  <?define ProductName = "$(var.InstallName) (x86)" ?>
  <?define Win64 = "no" ?>
  <?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
  <?define PlatformCommonFilesFolder = "CommonFilesFolder" ?>
  <?endif ?>

問題を解決したいのですが、この種の問題をトラブルシューティングするための戦略についても知りたいと思います。

4

1 に答える 1

9

LaunchCondition テーブル定義によると:

インストールを開始するために True と評価される必要がある式。

条件は 2 つの部分で構成されています。最初の部分はインストール時に評価され、もう 1 つはビルド時に評価されます。したがって、x86 パッケージの場合、条件の 2 番目の部分はビルド時に "no" = "no" と評価され、インストール時に明らかに True になります。最初の部分である VersionNT64 は、x64 マシンで定義されています (つまり、True です)。そのため、条件全体が True になり、インストールが開始されます。

次のように条件を書き換えることができます。

<Condition Message="64-bit operating system was detected, please use the 64-bit installer.">
  <?if $(var.Win64) = "yes" ?>
    VersionNT64
  <?else?>
    NOT VersionNT64
  <?endif?>
</Condition>

したがって、64 ビット パッケージでは、条件はただVersionNT64, になり、合格してインストールが開始されます。フォーム x86 パッケージの条件は になりますNOT VersionNT64。これは明らかに 64 ビットでは失敗しますが、32 ビットでは開始されます。

于 2011-08-12T07:32:21.297 に答える