0

I have a Wix xml for creating a msi setup. I want a curtain component to be installed from a location based on the current Windows version - x86 or x64, and not based on the current $(var.Platform), i.e. setup configuration.

How Can I do it? The best way I can think about is defining a variable, based on the Windows version:

  <?if %PROCESSOR_ARCHITECTURE~="amd64" OR %PROCESSOR_ARCHITEW6432~="amd64"?>
  <?define InstallationFolder = "x86" ?>
  <?else ?>
  <?define InstallationFolder = "x64" ?>
  <?endif ?>

And using it by the source path for the required component files.

The issue is that the boolean expression above has problems and doesn't detect the OS, it detects the proccess. I though about using the VersionNT64, but I didn't see a way of how to use it in the <?if> boolean expression.

  • This appears to be a build issue, yes? If so VersionNT64 is irrelevant because it's a Windows Installer install-time property. For builds it looks like you need var.Platform as in this answer. http://stackoverflow.com/questions/471424/wix-tricks-and-tips/577793#577793 and this http://stackoverflow.com/questions/6231950/using-wix-to-create-32bit-and-64bit-installers-from-one-wxs-file – PhilDW Feb 22 '17 at 19:39

1 Answers1

0

How about using a C# custom action to detect the 64 or 32 bit and just override the value from there?

Writing custom action: http://wixtoolset.org/documentation/manual/v3/wixdev/extensions/authoring_custom_actions.html

How to pass parameters to the custom action?

Community
  • 1
  • 1
TeaHoney
  • 150
  • 11