Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

64 bit OS required install condition not failing on 32 bit Windows OS

I am building 32 and 64 bit versions of my installer using a single wix project (specifying the -arch candle parameter)

I want to avoid customer confusion and only allow 32 bit installs on a 32 OS and vice versa on 64 bit. Trust me, for my purposes this makes sense.

The following branching condition fails correctly when running the 32 bit installer on the 64 bit OS.

<?if $(sys.BUILDARCH) = x64 ?>
    <Condition Message="You are attempting to run the 64-bit installer on a 32-bit version of Windows.">
        <![CDATA[VersionNT64]]>
    </Condition>
<?else?>
    <Condition Message="You are attempting to run the 32-bit installer on a 64-bit version of Windows.">
        <![CDATA[NOT VersionNT64]]>
    </Condition>
<?endif ?>      

However I get an Windows Installer error when running the 64 bit installer on a 32 bit OS. The error is this:

An error occured installing the package. Windows Installer returned '1633'

Searching for this error gets what you would expect:

This installation package is not supported on this platform. Contact your application vendor.

So it appears I am hitting the standard (very poor) windows installer error for "you are using the wrong installer".

Is there any way to get my condition to correctly fire or is this just an impossibility?

like image 515
KevM Avatar asked Jan 18 '26 09:01

KevM


1 Answers

MSI won't even open a 64-bit package on a 32-bit OS, so LaunchConditions are never even evaluated. In short, no, nothing you can do.

like image 80
Bob Arnson Avatar answered Jan 20 '26 03:01

Bob Arnson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!