Skip to content
Draft
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
7 changes: 7 additions & 0 deletions eng/Versions.props
Original file line number Diff line number Diff line change
@@ -279,5 +279,12 @@
<NodePackageVersion>$(runtimewinx64MicrosoftNETCoreRuntimeWasmNodeTransportPackageVersion)</NodePackageVersion>
<!-- The package path for python in src/mono/mono.proj needs to be updated if this changes-->
<EmsdkVersion>3.1.56</EmsdkVersion>
<!-- WiX 5+ dependencies for MSI generation -->
<MicrosoftWixVersion>5.0.2-dotnet.2729052</MicrosoftWixVersion>
<MicrosoftWixToolsetUIWixextVersion>5.0.2-dotnet.2729052</MicrosoftWixToolsetUIWixextVersion>
<MicrosoftWixToolsetDependencyWixextVersion>5.0.2-dotnet.2729052</MicrosoftWixToolsetDependencyWixextVersion>
<MicrosoftWixToolsetUtilWixextVersion>5.0.2-dotnet.2729052</MicrosoftWixToolsetUtilWixextVersion>
<MicrosoftWixToolsetBalWixextVersion>5.0.2-dotnet.2729052</MicrosoftWixToolsetBalWixextVersion>
<MicrosoftWixToolsetHeatVersion>5.0.2-dotnet.2729052</MicrosoftWixToolsetHeatVersion>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
<PropertyGroup>
<SharedFrameworkName>$(MicrosoftNetCoreAppFrameworkName)</SharedFrameworkName>
<SharedFrameworkFriendlyName>.NET Runtime</SharedFrameworkFriendlyName>
<UseWix5>true</UseWix5>
</PropertyGroup>

<!--
Original file line number Diff line number Diff line change
@@ -4,6 +4,15 @@

<ItemGroup Condition="'$(RuntimeFlavor)' == '$(PrimaryRuntimeFlavor)' and '$(TargetsMobile)' != 'true'">
<PackageReference Condition="'$(SkipInstallersPackageReference)' != 'true'" Include="Microsoft.DotNet.Build.Tasks.Installers" Version="$(MicrosoftDotNetBuildTasksInstallersVersion)" />

<!-- Microsoft.Wix is a dotnet tool package, so exlude its assets. -->
<PackageReference Include="Microsoft.Wix" Version="$(MicrosoftWixVersion)" ExcludeAssets="all" />
<!-- Installers needs the $(PkgMicrosoftWixToolsetUIwixext) property to locate the extension. -->
<PackageReference Include="Microsoft.WixToolset.UI.wixext" Version="$(MicrosoftWixToolsetUIWixextVersion)" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.WixToolset.Dependency.wixext" Version="$(MicrosoftWixToolsetDependencyWixextVersion)" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.WixToolset.Util.wixext" Version="$(MicrosoftWixToolsetUtilWixextVersion)" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.WixToolset.Bal.wixext" Version="$(MicrosoftWixToolsetBalWixextVersion)" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.WixToolset.Heat" Version="$(MicrosoftWixToolsetHeatVersion)" />
</ItemGroup>

<Target Name="AddLongNameDacToPlatformManifest" DependsOnTargets="GetAssemblyVersion" BeforeTargets="GetFilesToPackage">
Original file line number Diff line number Diff line change
@@ -15,9 +15,18 @@
<MacOSBundleTemplate>$(MSBuildProjectDirectory)/shared-framework-distribution-template-$(TargetArchitecture).xml</MacOSBundleTemplate>
<MacOSBundleIdentifierName>com.microsoft.dotnet.Microsoft.NETCore.App.$(ProductVersion).osx.$(TargetArchitecture)</MacOSBundleIdentifierName>
<MacOSBundleResourcesPath>osx_resources</MacOSBundleResourcesPath>
<UseWix5>true</UseWix5>
</PropertyGroup>

<ItemGroup>
<!-- Microsoft.Wix is a dotnet tool package, so exlude its assets. -->
<PackageReference Include="Microsoft.Wix" Version="$(MicrosoftWixVersion)" ExcludeAssets="all" />
<!-- Installers needs the $(PkgMicrosoftWixToolsetUIwixext) property to locate the extension. -->
<PackageReference Include="Microsoft.WixToolset.UI.wixext" Version="$(MicrosoftWixToolsetUIWixextVersion)" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.WixToolset.Dependency.wixext" Version="$(MicrosoftWixToolsetDependencyWixextVersion)" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.WixToolset.Util.wixext" Version="$(MicrosoftWixToolsetUtilWixextVersion)" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.WixToolset.Bal.wixext" Version="$(MicrosoftWixToolsetBalWixextVersion)" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.WixToolset.Heat" Version="$(MicrosoftWixToolsetHeatVersion)" />
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Installers" Version="$(MicrosoftDotNetBuildTasksInstallersVersion)" />
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Archives" Version="$(MicrosoftDotNetBuildTasksArchivesVersion)" />
</ItemGroup>
1 change: 1 addition & 0 deletions src/installer/pkg/sfx/installers/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -4,5 +4,6 @@
<PropertyGroup>
<BuildDebPackage Condition="'$(TargetsLinuxGlibc)' == 'true'">true</BuildDebPackage>
<BuildRpmPackage Condition="'$(TargetsLinuxGlibc)' == 'true'">true</BuildRpmPackage>
<UseWix5>true</UseWix5>
</PropertyGroup>
</Project>
11 changes: 11 additions & 0 deletions src/installer/pkg/sfx/installers/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -2,6 +2,17 @@
<ItemGroup>
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Installers" Version="$(MicrosoftDotNetBuildTasksInstallersVersion)" />
</ItemGroup>

<ItemGroup Condition="'$(UseWix5)' == 'true'">
<!-- Microsoft.Wix is a dotnet tool package, so exlude its assets. -->
<PackageReference Include="Microsoft.Wix" Version="$(MicrosoftWixVersion)" ExcludeAssets="all" />
<!-- Installers needs the $(PkgMicrosoftWixToolsetUIwixext) property to locate the extension. -->
<PackageReference Include="Microsoft.WixToolset.UI.wixext" Version="$(MicrosoftWixToolsetUIWixextVersion)" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.WixToolset.Dependency.wixext" Version="$(MicrosoftWixToolsetDependencyWixextVersion)" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.WixToolset.Util.wixext" Version="$(MicrosoftWixToolsetUtilWixextVersion)" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.WixToolset.Bal.wixext" Version="$(MicrosoftWixToolsetBalWixextVersion)" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.WixToolset.Heat" Version="$(MicrosoftWixToolsetHeatVersion)" />
</ItemGroup>

<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets, $(MSBuildThisFileDirectory)..))" />
</Project>
94 changes: 54 additions & 40 deletions src/installer/pkg/sfx/installers/host.wxs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util">

<?include "$(var.SharedWixDir)\variables.wxi" ?>

@@ -20,38 +20,48 @@
1. the legacy SDK can be subsequently installed
2. the user runs 'dotnet' commands directly against 'ProgramFiles'\dotnet\dotnet.exe -->

<Component Id="cmpCoreHost" Directory="DOTNETHOME" Guid="{45399BBB-DDA5-4386-A2E9-618FB3C54A18}" >
<Component Id="cmpCoreHost" Directory="DOTNETHOME" Guid="{45399BBB-DDA5-4386-A2E9-618FB3C54A18}">
<File Id="fileCoreHostExe" KeyPath="yes" Source="$(var.HostSrc)\dotnet.exe">
<CopyFile Id="copyFileCoreHostExe" DestinationDirectory="PROGRAMFILES_DOTNET" />
</File>
</Component>

<Component Id="cmpSharedHostVersionRegistry" Directory="DOTNETHOME" Guid="*">
<Component Id="cmpSharedHostVersionRegistry" Directory="DOTNETHOME">
<RegistryKey Root="HKLM" Key="SOFTWARE\dotnet\Setup\InstalledVersions\$(var.Platform)\sharedhost">
<RegistryValue KeyPath="yes" Action="write" Name="Version" Type="string" Value="$(var.NugetVersion)"/>
</RegistryKey>
</Component>

<Component Id="cmpInstallLocation" Directory="TARGETDIR" Guid="*" Win64="no">
<Component Id="cmpInstallLocation" Directory="TARGETDIR" Bitness="always32">
<RegistryKey Root="HKLM" Key="SOFTWARE\dotnet\Setup\InstalledVersions\$(var.Platform)">
<RegistryValue Action="write" Name="InstallLocation" Type="string" Value="[DOTNETHOME]" KeyPath="yes"/>
</RegistryKey>
</Component>

<Component Id="cmpPath" Directory="DOTNETHOME" Guid="*">
<?if $(var.Platform)~=x64 ?>
<?if $(var.Platform)~=x64 ?>
<!-- For x64 installer, only add the sharedhost key when actually on native architecture. -->
<Condition>NOT NON_NATIVE_ARCHITECTURE</Condition>
<?elseif $(var.Platform)~=x86 ?>
<Component Id="cmpPath" Directory="DOTNETHOME" Condition="NOT NON_NATIVE_ARCHITECTURE">
<!-- A stable keypath with the right SxS characteristics for our PATH entry-->
<RegistryKey Root="HKLM" Key="SOFTWARE\dotnet\Setup\InstalledVersions\$(var.Platform)\sharedhost">
<RegistryValue KeyPath="yes" Action="write" Name="Path" Type="string" Value="[DOTNETHOME]"/>
</RegistryKey>
</Component>
<?elseif $(var.Platform)~=x86 ?>
<!-- For x86 installer, only add the key when not on 64-bit platform. -->
<Condition>NOT VersionNT64</Condition>
<?endif?>

<!-- A stable keypath with the right SxS characteristics for our PATH entry-->
<RegistryKey Root="HKLM" Key="SOFTWARE\dotnet\Setup\InstalledVersions\$(var.Platform)\sharedhost">
<RegistryValue KeyPath="yes" Action="write" Name="Path" Type="string" Value="[DOTNETHOME]"/>
</RegistryKey>
</Component>
<Component Id="cmpPath" Directory="DOTNETHOME" Condition="NOT VersionNT64">
<!-- A stable keypath with the right SxS characteristics for our PATH entry-->
<RegistryKey Root="HKLM" Key="SOFTWARE\dotnet\Setup\InstalledVersions\$(var.Platform)\sharedhost">
<RegistryValue KeyPath="yes" Action="write" Name="Path" Type="string" Value="[DOTNETHOME]"/>
</RegistryKey>
</Component>
<?else?>
<Component Id="cmpPath" Directory="DOTNETHOME">
<!-- A stable keypath with the right SxS characteristics for our PATH entry-->
<RegistryKey Root="HKLM" Key="SOFTWARE\dotnet\Setup\InstalledVersions\$(var.Platform)\sharedhost">
<RegistryValue KeyPath="yes" Action="write" Name="Path" Type="string" Value="[DOTNETHOME]"/>
</RegistryKey>
</Component>
<?endif?>

<Component Id="cmpLicenseFiles" Directory="DOTNETHOME" Guid="{A61CBE5B-1282-4F29-90AD-63597AA2372E}">
<File Id="fileLicenseTxt" KeyPath="yes" Source="$(var.HostSrc)\LICENSE.txt">
@@ -68,9 +78,9 @@
<Property Id="ProductCPU" Value="$(var.Platform)" />
<Property Id="RTM_ProductVersion" Value="$(var.Dotnet_ProductVersion)" />

<DirectoryRef Id="$(var.Program_Files)">
<StandardDirectory Id="ProgramFiles6432Folder">
<Directory Id="PROGRAMFILES_DOTNET" Name="dotnet" />
</DirectoryRef>
</StandardDirectory>

<?if $(var.Platform)~=x64 ?>
<CustomActionRef Id="Set_PROGRAMFILES_DOTNET_NON_NATIVE_ARCHITECTURE" />
@@ -79,34 +89,38 @@

<Fragment>
<Property Id="DISABLE_SETTING_HOST_PATH" Secure="yes">
<RegistrySearch Id="DisableSettingHostPathSearch" Root="HKLM" Key="SOFTWARE\Microsoft\.NET" Type="raw" Name="DisableSettingHostPath"/>
<RegistrySearch Id="DisableSettingHostPathSearch" Root="HKLM" Key="SOFTWARE\Microsoft\.NET" Type="raw" Name="DisableSettingHostPath" />
</Property>

<Component Id="cmpSetPath" Guid="{0B910ED8-0877-473D-8658-647382324433}" Directory="DOTNETHOME">
<CreateFolder />
<!-- Always set the SYSTEM PATH, unless DisableSettingHostPath is 1. -->
<?if $(var.Platform)~=x64 ?>
<!-- For x64 installer, only add to PATH when actually on native architecture. -->
<Condition><![CDATA[DISABLE_SETTING_HOST_PATH <> "#1" AND NOT NON_NATIVE_ARCHITECTURE]]></Condition>
<?elseif $(var.Platform)~=x86 ?>
<!-- For x86 installer, only add to PATH when not on 64-bit platform. -->
<Condition><![CDATA[DISABLE_SETTING_HOST_PATH <> "#1" AND NOT VersionNT64]]></Condition>
<?endif?>
<Environment Id="E_PATH" Name="PATH" Value="[DOTNETHOME]" Part="last" Action="set" System="yes" />
</Component>
<?if $(var.Platform)~=x64 ?>
<Component Id="cmpSetPath" Guid="{0B910ED8-0877-473D-8658-647382324433}" Directory="DOTNETHOME" Condition="DISABLE_SETTING_HOST_PATH &lt;&gt; &quot;#1&quot; AND NOT NON_NATIVE_ARCHITECTURE">
<CreateFolder />
<Environment Id="E_PATH" Name="PATH" Value="[DOTNETHOME]" Part="last" Action="set" System="yes" />
</Component>
<?elseif $(var.Platform)~=x86 ?>
<Component Id="cmpSetPath" Guid="{0B910ED8-0877-473D-8658-647382324433}" Directory="DOTNETHOME" Condition="DISABLE_SETTING_HOST_PATH &lt;&gt; &quot;#1&quot; AND NOT VersionNT64">
<CreateFolder />
<Environment Id="E_PATH" Name="PATH" Value="[DOTNETHOME]" Part="last" Action="set" System="yes" />
</Component>
<?else?>
<Component Id="cmpSetPath" Guid="{0B910ED8-0877-473D-8658-647382324433}" Directory="DOTNETHOME">
<CreateFolder />
<Environment Id="E_PATH" Name="PATH" Value="[DOTNETHOME]" Part="last" Action="set" System="yes" />
</Component>
<?endif?>

<util:BroadcastEnvironmentChange Condition="DISABLE_SETTING_HOST_PATH &lt;&gt; &quot;#1&quot;" />

<!-- TODO change t something like: -->
<!-- <util:BroadcastEnvironmentChange Action="set" Sequence="afterInstallFinalize" />

<InstallExecuteSequence>
<!-- Only broadcast the change if the component is enabled. -->
<Custom Action="WixBroadcastEnvironmentChange" After="InstallFinalize">
<![CDATA[DISABLE_SETTING_HOST_PATH <> "#1"]]>
</Custom>
</InstallExecuteSequence>
<Custom Action="override Wix4BroadcastEnvironmentChange_X86" After="InstallFinalize" Condition="FOO"/>
</InstallExecuteSequence> -->
</Fragment>

<Fragment>
<!-- Unlike DOTNETHOME which gives precedence to a user specified value over an x64 suffix, here we always want the suffixed path -->
<SetProperty Action="Set_PROGRAMFILES_DOTNET_NON_NATIVE_ARCHITECTURE" Id="PROGRAMFILES_DOTNET" Value="[$(var.Program_Files)]dotnet\x64\" After="Set_NON_NATIVE_ARCHITECTURE">
NON_NATIVE_ARCHITECTURE
</SetProperty>
<SetProperty Action="Set_PROGRAMFILES_DOTNET_NON_NATIVE_ARCHITECTURE" Id="PROGRAMFILES_DOTNET" Value="[$(var.Program_Files)]dotnet\x64\" After="Set_NON_NATIVE_ARCHITECTURE" Condition="NON_NATIVE_ARCHITECTURE" />
</Fragment>
</Wix>