Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions src/Common/wix/dotnethome_x64.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,27 @@
<?define Platform = "$(sys.BUILDARCH)"?>
<?endif?>

<!-- InstallerArchitecture matches the expected values for PROCESSOR_ARCHITECTURE
https://docs.microsoft.com/en-us/windows/win32/winprog64/wow64-implementation-details -->
<!-- InstallerNativeMachine matches the expected values for image file machine constants
https://docs.microsoft.com/en-us/windows/win32/sysinfo/image-file-machine-constants -->
<?if $(var.Platform)~=x86?>
<?define InstallerArchitecture="X86"?>
<?define InstallerNativeMachine=332?>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably define these constants so that everyone can use them eventually. For now we do have the link, but something like <?define NativeMachine_ARM64=43620?> in a shared include or lib would be nice for 7.0

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm doing that in installer where we need all the values in the bundle. Here we need the value for a single arch.

Yeah consolidating more would be nice.

<?elseif $(var.Platform)~=x64?>
<?define InstallerArchitecture="AMD64"?>
<?define InstallerNativeMachine=34404?>
<?elseif $(var.Platform)~=arm64?>
<?define InstallerArchitecture="ARM64"?>
<?define InstallerNativeMachine=43620?>
<?else?>
<?error Unknown platform, $(var.Platform) ?>?
<?error Unknown platform, $(var.Platform) ?>
<?endif?>

<Fragment>
<!-- Identify when installing in emulation as when PROCESSOR_ARCHITECTURE does not match the installer architecture
https://docs.microsoft.com/en-us/windows/win32/winprog64/wow64-implementation-details -->
<!-- Identify when installing in emulation as when WIX_NATIVE_MACHINE does not match the installer
native machine (where supported). Also detect running under WOW on x86 using VersionNT64,
since WIX_NATIVE_MACHINE cannot be retrieved on older Windows builds. -->
<SetProperty Action="Set_NON_NATIVE_ARCHITECTURE" Id="NON_NATIVE_ARCHITECTURE" Value="true" Before="CostFinalize">
NOT %PROCESSOR_ARCHITECTURE="$(var.InstallerArchitecture)"
<?if $(var.Platform)~=x86?>
VersionNT64 OR
<?endif?>
WIX_NATIVE_MACHINE AND NOT WIX_NATIVE_MACHINE="$(var.InstallerNativeMachine)"
</SetProperty>
</Fragment>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ public override bool Execute()
// Add WiX extensions
light.Extensions.Add("WixDependencyExtension");
light.Extensions.Add("WixUIExtension");
light.Extensions.Add("WixUtilExtension");

if (!light.Execute())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ protected IEnumerable<ITaskItem> Generate(string sourcePackage, string swixPacka
// Add WiX extensions
light.Extensions.Add("WixDependencyExtension");
light.Extensions.Add("WixUIExtension");
light.Extensions.Add("WixUtilExtension");

if (!light.Execute())
{
Expand Down