|
5 | 5 | <?define Platform = "$(sys.BUILDARCH)"?>
|
6 | 6 | <?endif?>
|
7 | 7 |
|
8 |
| - <!-- InstallerArchitecture matches the expected values for PROCESSOR_ARCHITECTURE |
9 |
| - https://docs.microsoft.com/en-us/windows/win32/winprog64/wow64-implementation-details --> |
| 8 | + <!-- InstallerNativeMachine matches the expected values for image file machine constants |
| 9 | + https://docs.microsoft.com/en-us/windows/win32/sysinfo/image-file-machine-constants --> |
10 | 10 | <?if $(var.Platform)~=x86?>
|
11 |
| - <?define InstallerArchitecture="X86"?> |
| 11 | + <?define InstallerNativeMachine=332?> |
12 | 12 | <?elseif $(var.Platform)~=x64?>
|
13 |
| - <?define InstallerArchitecture="AMD64"?> |
| 13 | + <?define InstallerNativeMachine=34404?> |
14 | 14 | <?elseif $(var.Platform)~=arm64?>
|
15 |
| - <?define InstallerArchitecture="ARM64"?> |
| 15 | + <?define InstallerNativeMachine=43620?> |
16 | 16 | <?else?>
|
17 |
| - <?error Unknown platform, $(var.Platform) ?>? |
| 17 | + <?error Unknown platform, $(var.Platform) ?> |
18 | 18 | <?endif?>
|
19 | 19 |
|
20 | 20 | <Fragment>
|
21 |
| - <!-- Identify when installing in emulation as when PROCESSOR_ARCHITECTURE does not match the installer architecture |
22 |
| - https://docs.microsoft.com/en-us/windows/win32/winprog64/wow64-implementation-details --> |
| 21 | + <!-- Identify when installing in emulation as when WIX_NATIVE_MACHINE does not match the installer |
| 22 | + native machine (where supported). Also detect running under WOW on x86 using VersionNT64, |
| 23 | + since WIX_NATIVE_MACHINE cannot be retrieved on older Windows builds. --> |
| 24 | + <PropertyRef Id="WIX_NATIVE_MACHINE" /> |
23 | 25 | <SetProperty Action="Set_NON_NATIVE_ARCHITECTURE" Id="NON_NATIVE_ARCHITECTURE" Value="true" Before="CostFinalize">
|
24 |
| - NOT %PROCESSOR_ARCHITECTURE="$(var.InstallerArchitecture)" |
| 26 | + <?if $(var.Platform)~=x86?> |
| 27 | + VersionNT64 OR |
| 28 | + <?endif?> |
| 29 | + WIX_NATIVE_MACHINE AND NOT WIX_NATIVE_MACHINE="$(var.InstallerNativeMachine)" |
25 | 30 | </SetProperty>
|
26 | 31 | </Fragment>
|
27 | 32 |
|
|
0 commit comments