Tom*_*lis 17 installation platform windows-installer wix wix3
由于用户混淆,我们的应用程序需要单独的安装程序,用于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
变量中,如果这些变量没有排列则抛出错误,但逻辑不起作用我打算如何操作.有没有人想出更好的解决方案?
Bob*_*son 15
仅在您的32位软件包中包含Condition元素(即,使用?if?预处理程序语句).条件将是"NOT Msix64":启动条件必须为true,因此如果设置了Msix64,则启动条件将失败,这意味着它是x64操作系统和32位软件包,正确的做法是块.
我们使用以下......
<?if $(var.ProcessorArchitecture)=x86 ?>
<Condition Message="!(loc.LaunchCondition_Error64)">
<![CDATA[Installed OR Not VersionNT64]]>
</Condition>
<?endif?>
Run Code Online (Sandbox Code Playgroud)