WelshBoyZz
WelshBoyZz

Reputation: 84

Wix VersionNT64 not working

I am installing some drivers along with a program using wix (WiX v3.10.3 (Stable)). The drivers installed depend on the machine being 32 or 64 bit.

I have been following a tutorial i found that uses

<Condition Level="1"><![CDATA[Not VersionNT64]]></Condition>

and

<Condition Level="1"><![CDATA[VersionNT64]]></Condition>

These dont seem to work as i expected so i created a basic message to test them.

    <Condition Message="32 bit"><![CDATA[Not VersionNT64]]></Condition>

This should display "32 bit" in a message if the installer is run on a 32 bit machine, which i does not. It does however display it on a 64 bit machine.

also,

<Condition Message="64 bit"><![CDATA[VersionNT64]]></Condition>

does not work on either 32 or 64 bit.

Any ideas? thanks

Upvotes: 2

Views: 2900

Answers (2)

Aaron
Aaron

Reputation: 21

followed

https://www.advancedinstaller.com/user-guide/qa-OS-dependent-install.html#VersionNT64

VersionNT64 stores the number of the version same as VersionNT, so to check for x64 of the a specific version you can do

(VersionNT=501) AND (VersionNT64<>501)

which is checking for XP but only 32bit

Might have to list out each version:

(VersionNT=600) AND (VersionNT64<>600)
(VersionNT=601) AND (VersionNT64<>601)

ect.

If you only care about x64

(VersionNT=VersionNT64)

Will be true of x64

Upvotes: 2

Michael Urman
Michael Urman

Reputation: 15905

Note that Condition/@Message results in an inverted test to behavior relationship from Condition/@Level. The resulting LaunchCondition entry from @Message contains a condition described as:

Expression that must evaluate to True for installation to begin.

As the condition Not VersionNT64 is true on 32-bit systems so the installation is allowed to continue. It's false on 64-bit systems, so the installation is blocked and the message should be shown. The condition VersionNT64 is true only on 64-bit systems, so should have the reverse behavior; it's unclear what you meant by "does not work".

Upvotes: 0

Related Questions