I have a Wix Setup msi for both 32 bit and 64 bit platform.
I want to prevent it to install 32 bit msi on 64 bit OS and 64 bit msi on 32 bit OS.
Although WIX prevent to install 64 bit msi on 32 bit msi but i want to achieve reverse also.
I was using the below code :-
<?if $(var.Platform)=x86 ?>
<Condition Message="Setup can not be installed on x64 machine.">
<![CDATA[Installed OR Not VersionNT64]]>
</Condition>
<?endif?>
but it display at the welcome page of my msi.
I want to display the message same as i get when i install 64 bit msi on 32 bit os such as
The Installation Package is not supported by this processor type.Contact your support personnel
How can i achieve this?
That condition should work! I'm thinking maybe the variable Platform is not being set properly.
You could also try this (which is pretty much the same as yours):
<?if $(var.Platform) = x86 ?>
<Condition Message="Setup can not be installed on x64 machine.">
<![CDATA[Not VersionNT64]]>
</Condition>
<?endif?>
Edit: I removed the Platform=x64 condition after @Christopher Painter comment because you get that for free on x64 msis. I also tried the code above and it works.
I don't believe you can get the exact same behavior as running the x64 MSI on an x86 system. In that case, Windows itself is checking the MSI architecture before it tries to run it and displaying the message. You've invented your own unnecessary restriction so you can't use the exact same method as Windows.
However I don't know why you are seeing your message on your welcome page. All the launch conditions I have seen are a dialog box that Windows supplies (where you click OK) and then you usually see a dialog saying that the install failed (but again, that failure dialog is up to you). So you should be able to get something close to what Windows does.