Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
43 changes: 43 additions & 0 deletions src/Common/wix/dotnethome_x64.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. -->
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<?ifndef Platform?>
<?define Platform = "$(sys.BUILDARCH)"?>
<?endif?>

<!-- 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 InstallerNativeMachine=332?>
<?elseif $(var.Platform)~=x64?>
<?define InstallerNativeMachine=34404?>
<?elseif $(var.Platform)~=arm64?>
<?define InstallerNativeMachine=43620?>
<?else?>
<?error Unknown platform, $(var.Platform) ?>
<?endif?>

<Fragment>
<!-- 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. -->
<PropertyRef Id="WIX_NATIVE_MACHINE" />
<SetProperty Action="Set_NON_NATIVE_ARCHITECTURE" Id="NON_NATIVE_ARCHITECTURE" Value="true" Before="CostFinalize">
<?if $(var.Platform)~=x86?>
VersionNT64 OR
<?endif?>
WIX_NATIVE_MACHINE AND NOT WIX_NATIVE_MACHINE="$(var.InstallerNativeMachine)"
</SetProperty>
</Fragment>

<?if $(var.Platform)~=x64?>
<Fragment>
<!-- When running in a non-native architecture and user hasn't specified install directory,
install to an x64 subdirectory.
This is only define for x64, since x86 has redirection and no other native architecture can install ARM64 today -->
<SetProperty Action="Set_DOTNETHOME_NON_NATIVE_ARCHITECTURE" Id="DOTNETHOME" Value="[ProgramFiles64Folder]dotnet\x64\" After="Set_NON_NATIVE_ARCHITECTURE">
NON_NATIVE_ARCHITECTURE AND NOT DOTNETHOME
</SetProperty>
</Fragment>
<?endif?>
</Wix>
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<None Include="targets/**/*.*" Pack="true">
<PackagePath>targets/%(RecursiveDir)%(Filename)%(Extension)</PackagePath>
</None>
<None Include="..\Common\wix\dotnethome_x64.wxs" Link="targets\windows\product\dotnethome_x64.wxs" PackagePath="%(Link)" Pack="true" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@
<PayloadGroupRef Id="DotnetCoreBAPayloads" />
</BootstrapperApplicationRef>

<swid:Tag Regid="microsoft.com" InstallPath="[DOTNETHOME]" />

<Variable Name="DOTNETHOME" Type="string" Value="[$(var.Program_Files)]dotnet" bal:Overridable="no" />
<swid:Tag Regid="microsoft.com" InstallPath="[$(var.Program_Files)]dotnet" />

<!-- Variables used solely for localization. -->
<Variable Name="BUNDLEMONIKER" Type="string" Value="$(var.ProductMoniker) ($(var.TargetArchitectureDescription))" bal:Overridable="no" />
Expand All @@ -54,9 +52,7 @@

<Chain DisableSystemRestore="yes" ParallelCache="yes">
<?foreach chainedFile in $(var.ChainedDotNetPackageFiles)?>
<MsiPackage SourceFile="$(var.chainedFile)">
<MsiProperty Name="DOTNETHOME" Value="[DOTNETHOME]" />
</MsiPackage>
<MsiPackage SourceFile="$(var.chainedFile)" />
<?endforeach?>
</Chain>
</Bundle>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. -->
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">

<?include "..\variables.wxi" ?>
Expand Down Expand Up @@ -51,6 +52,10 @@
<Directory Id="DOTNETHOME" Name="dotnet" />
</Directory>
</Directory>

<?if $(var.Platform)~=x64?>
<CustomActionRef Id="Set_DOTNETHOME_NON_NATIVE_ARCHITECTURE" />
<?endif?>
</Fragment>

</Wix>
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
Text="IntermediateOutputRootPath not specified" />

<PropertyGroup>
<WixVersion>3.14.0.4118</WixVersion>
<WixVersion>1.0.0-v3.14.0.5722</WixVersion>
<WixToolsDir>$(IntermediateOutputRootPath)WixTools.$(WixVersion)/</WixToolsDir>
<!-- Used in WiX targets to locate files. -->
<WixInstallPath>$(WixToolsDir)</WixInstallPath>
Expand All @@ -46,10 +46,10 @@
<MsiArch>$(TargetArchitecture)</MsiArch>

<AcquireWixProjectFile>$(PackagingToolsDir)acquire-wix\acquire-wix.proj</AcquireWixProjectFile>
<WixDownloadFilename>wix.$(WixVersion).zip</WixDownloadFilename>
<WixDownloadUrl>https://dotnetcli.azureedge.net/build/wix/$(WixDownloadFilename)</WixDownloadUrl>
<WixDownloadFilename>Microsoft.Signed.Wix-$(WixVersion).zip</WixDownloadFilename>
<WixDownloadUrl>https://netcorenativeassets.blob.core.windows.net/resource-packages/external/windows/wix/$(WixDownloadFilename)</WixDownloadUrl>
<WixDestinationPath>$(WixToolsDir)$(WixDownloadFilename)</WixDestinationPath>
<WixDownloadSentinel>$(WixToolsDir)WixDownload.$(WixVersion).sentinel</WixDownloadSentinel>
<WixDownloadSentinel>$(WixToolsDir)$(WixDownloadFilename).sentinel</WixDownloadSentinel>
</PropertyGroup>
</Target>

Expand Down Expand Up @@ -92,6 +92,7 @@
<WixExtensions Include="WixUtilExtension.dll" />

<WixSrcFile Include="$(MSBuildThisFileDirectory)product/product.wxs" />
<WixSrcFile Include="$(MSBuildThisFileDirectory)product/dotnethome_x64.wxs" />
<WixSrcFile Include="$(MSBuildThisFileDirectory)product/provider.wxs" />
</ItemGroup>
</Target>
Expand Down