According to the LaunchCondition table :
An expression that must be evaluated in True to begin the installation.
Your condition consists of two parts: the first is evaluated during installation, the other is evaluated during assembly. Thus, for the x86 package, the second part of the condition will evaluate the value "no" = "no" during the build, which obviously gives True during installation. And the first part - VersionNT64 - is defined (and therefore True) on x64 machines. That is why the whole condition is True and the installation begins.
You can rewrite your condition as follows:
<Condition Message="64-bit operating system was detected, please use the 64-bit installer."> <?if $(var.Win64) = "yes" ?> VersionNT64 <?else?> NOT VersionNT64 <?endif?> </Condition>
Therefore, in a 64-bit package, the condition will be just VersionNT64 , and it will pass and begin the installation. Form x86 package will be NOT VersionNT64 , which will obviously fail on 64-bit, but will start from 32-bit.
Yan sklyarenko
source share