由于用户混淆,我们的应用程序需要单独的安装程序,用于32位和64位版本的Windows.虽然32位安装程序在win64上运行良好,但它有可能造成支持问题,我们希望防止这种情况发生.
我想阻止32位MSI安装程序在64位Windows机器上运行.为此,我有以下条件:
<Condition Message="You are attempting to run the 32-bit installer on a 64-bit version of Windows.">
<![CDATA[Msix64 AND (NOT Win64)]]>
</Condition>
Run Code Online (Sandbox Code Playgroud)
使用Win64定义如下:
<?if $(var.Platform) = "x64"?>
<?define PlatformString = "64-bit"?>
<?define Win64 ?>
<?else?>
<?define PlatformString = "32-bit"?>
<?endif?>
Run Code Online (Sandbox Code Playgroud)
事实是,我无法使这项检查工作正常.无论是一直开火,还是一无所有.目标是检查运行时msix64变量是否存在于编译时Win64变量中,如果这些变量没有排列则抛出错误,但逻辑不起作用我打算如何操作.有没有人想出更好的解决方案?