Skip to content

Commit f86064a

Browse files
sfx proj use wix5
1 parent 4c2a221 commit f86064a

File tree

3 files changed

+57
-41
lines changed

3 files changed

+57
-41
lines changed

src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<PropertyGroup>
66
<SharedFrameworkName>$(MicrosoftNetCoreAppFrameworkName)</SharedFrameworkName>
77
<SharedFrameworkFriendlyName>.NET Runtime</SharedFrameworkFriendlyName>
8+
<UseWix5>true</UseWix5>
89
</PropertyGroup>
910

1011
<!--

src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.targets

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44

55
<ItemGroup Condition="'$(RuntimeFlavor)' == '$(PrimaryRuntimeFlavor)' and '$(TargetsMobile)' != 'true'">
66
<PackageReference Condition="'$(SkipInstallersPackageReference)' != 'true'" Include="Microsoft.DotNet.Build.Tasks.Installers" Version="$(MicrosoftDotNetBuildTasksInstallersVersion)" />
7+
8+
<!-- Microsoft.Wix is a dotnet tool package, so exlude its assets. -->
9+
<PackageReference Include="Microsoft.Wix" Version="$(MicrosoftWixVersion)" ExcludeAssets="all" />
10+
<!-- Installers needs the $(PkgMicrosoftWixToolsetUIwixext) property to locate the extension. -->
11+
<PackageReference Include="Microsoft.WixToolset.UI.wixext" Version="$(MicrosoftWixToolsetUIWixextVersion)" GeneratePathProperty="true" />
12+
<PackageReference Include="Microsoft.WixToolset.Dependency.wixext" Version="$(MicrosoftWixToolsetDependencyWixextVersion)" GeneratePathProperty="true" />
13+
<PackageReference Include="Microsoft.WixToolset.Util.wixext" Version="$(MicrosoftWixToolsetUtilWixextVersion)" GeneratePathProperty="true" />
14+
<PackageReference Include="Microsoft.WixToolset.Bal.wixext" Version="$(MicrosoftWixToolsetBalWixextVersion)" GeneratePathProperty="true" />
15+
<PackageReference Include="Microsoft.WixToolset.Heat" Version="$(MicrosoftWixToolsetHeatVersion)" />
716
</ItemGroup>
817

918
<Target Name="AddLongNameDacToPlatformManifest" DependsOnTargets="GetAssemblyVersion" BeforeTargets="GetFilesToPackage">

src/installer/pkg/sfx/installers/host.wxs

Lines changed: 47 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
1+
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
2+
xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util">
23

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

@@ -19,7 +20,7 @@
1920
1. the legacy SDK can be subsequently installed
2021
2. the user runs 'dotnet' commands directly against 'ProgramFiles'\dotnet\dotnet.exe -->
2122

22-
<Component Id="cmpCoreHost" Directory="DOTNETHOME" Guid="{45399BBB-DDA5-4386-A2E9-618FB3C54A18}" >
23+
<Component Id="cmpCoreHost" Directory="DOTNETHOME" Guid="{45399BBB-DDA5-4386-A2E9-618FB3C54A18}">
2324
<File Id="fileCoreHostExe" KeyPath="yes" Source="$(var.HostSrc)\dotnet.exe">
2425
<CopyFile Id="copyFileCoreHostExe" DestinationDirectory="PROGRAMFILES_DOTNET" />
2526
</File>
@@ -38,29 +39,28 @@
3839
</Component>
3940

4041
<?if $(var.Platform)~=x64 ?>
41-
<!-- For x64 installer, only add the sharedhost key when actually on native architecture. -->
42-
<Component Id="cmpPath" Directory="DOTNETHOME" Guid="*" Condition="NON_NATIVE_ARCHITECTURE">
43-
<!-- A stable keypath with the right SxS characteristics for our PATH entry-->
44-
<RegistryKey Root="HKLM" Key="SOFTWARE\dotnet\Setup\InstalledVersions\$(var.Platform)\sharedhost">
45-
<RegistryValue KeyPath="yes" Action="write" Name="Path" Type="string" Value="[DOTNETHOME]"/>
46-
</RegistryKey>
47-
</Component>
42+
<!-- For x64 installer, only add the sharedhost key when actually on native architecture. -->
43+
<Component Id="cmpPath" Directory="DOTNETHOME" Condition="NOT NON_NATIVE_ARCHITECTURE">
44+
<!-- A stable keypath with the right SxS characteristics for our PATH entry-->
45+
<RegistryKey Root="HKLM" Key="SOFTWARE\dotnet\Setup\InstalledVersions\$(var.Platform)\sharedhost">
46+
<RegistryValue KeyPath="yes" Action="write" Name="Path" Type="string" Value="[DOTNETHOME]"/>
47+
</RegistryKey>
48+
</Component>
4849
<?elseif $(var.Platform)~=x86 ?>
49-
<!-- For x86 installer, only add the key when not on 64-bit platform. -->
50-
<Component Id="cmpPath" Directory="DOTNETHOME" Guid="*" Condition="NOT VersionNT64">
51-
<!-- A stable keypath with the right SxS characteristics for our PATH entry-->
52-
<RegistryKey Root="HKLM" Key="SOFTWARE\dotnet\Setup\InstalledVersions\$(var.Platform)\sharedhost">
53-
<RegistryValue KeyPath="yes" Action="write" Name="Path" Type="string" Value="[DOTNETHOME]"/>
54-
</RegistryKey>
55-
</Component>
50+
<!-- For x86 installer, only add the key when not on 64-bit platform. -->
51+
<Component Id="cmpPath" Directory="DOTNETHOME" Condition="NOT VersionNT64">
52+
<!-- A stable keypath with the right SxS characteristics for our PATH entry-->
53+
<RegistryKey Root="HKLM" Key="SOFTWARE\dotnet\Setup\InstalledVersions\$(var.Platform)\sharedhost">
54+
<RegistryValue KeyPath="yes" Action="write" Name="Path" Type="string" Value="[DOTNETHOME]"/>
55+
</RegistryKey>
56+
</Component>
5657
<?else?>
57-
<!-- TODO Is this case needed? -->
58-
<Component Id="cmpPath" Directory="DOTNETHOME" Guid="*">
59-
<!-- A stable keypath with the right SxS characteristics for our PATH entry-->
60-
<RegistryKey Root="HKLM" Key="SOFTWARE\dotnet\Setup\InstalledVersions\$(var.Platform)\sharedhost">
61-
<RegistryValue KeyPath="yes" Action="write" Name="Path" Type="string" Value="[DOTNETHOME]"/>
62-
</RegistryKey>
63-
</Component>
58+
<Component Id="cmpPath" Directory="DOTNETHOME">
59+
<!-- A stable keypath with the right SxS characteristics for our PATH entry-->
60+
<RegistryKey Root="HKLM" Key="SOFTWARE\dotnet\Setup\InstalledVersions\$(var.Platform)\sharedhost">
61+
<RegistryValue KeyPath="yes" Action="write" Name="Path" Type="string" Value="[DOTNETHOME]"/>
62+
</RegistryKey>
63+
</Component>
6464
<?endif?>
6565

6666
<Component Id="cmpLicenseFiles" Directory="DOTNETHOME" Guid="{A61CBE5B-1282-4F29-90AD-63597AA2372E}">
@@ -89,28 +89,34 @@
8989

9090
<Fragment>
9191
<Property Id="DISABLE_SETTING_HOST_PATH" Secure="yes">
92-
<RegistrySearch Id="DisableSettingHostPathSearch" Root="HKLM" Key="SOFTWARE\Microsoft\.NET" Type="raw" Name="DisableSettingHostPath"/>
92+
<RegistrySearch Id="DisableSettingHostPathSearch" Root="HKLM" Key="SOFTWARE\Microsoft\.NET" Type="raw" Name="DisableSettingHostPath" />
9393
</Property>
9494

95-
<Component Id="cmpSetPath" Guid="{0B910ED8-0877-473D-8658-647382324433}" Directory="DOTNETHOME">
96-
<CreateFolder />
97-
<!-- Always set the SYSTEM PATH, unless DisableSettingHostPath is 1. -->
98-
<?if $(var.Platform)~=x64 ?>
99-
<!-- For x64 installer, only add to PATH when actually on native architecture. -->
100-
<Condition><![CDATA[DISABLE_SETTING_HOST_PATH <> "#1" AND NOT NON_NATIVE_ARCHITECTURE]]></Condition>
101-
<?elseif $(var.Platform)~=x86 ?>
102-
<!-- For x86 installer, only add to PATH when not on 64-bit platform. -->
103-
<Condition><![CDATA[DISABLE_SETTING_HOST_PATH <> "#1" AND NOT VersionNT64]]></Condition>
104-
<?endif?>
105-
<Environment Id="E_PATH" Name="PATH" Value="[DOTNETHOME]" Part="last" Action="set" System="yes" />
106-
</Component>
95+
<?if $(var.Platform)~=x64 ?>
96+
<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">
97+
<CreateFolder />
98+
<Environment Id="E_PATH" Name="PATH" Value="[DOTNETHOME]" Part="last" Action="set" System="yes" />
99+
</Component>
100+
<?elseif $(var.Platform)~=x86 ?>
101+
<Component Id="cmpSetPath" Guid="{0B910ED8-0877-473D-8658-647382324433}" Directory="DOTNETHOME" Condition="DISABLE_SETTING_HOST_PATH &lt;&gt; &quot;#1&quot; AND NOT VersionNT64">
102+
<CreateFolder />
103+
<Environment Id="E_PATH" Name="PATH" Value="[DOTNETHOME]" Part="last" Action="set" System="yes" />
104+
</Component>
105+
<?else?>
106+
<Component Id="cmpSetPath" Guid="{0B910ED8-0877-473D-8658-647382324433}" Directory="DOTNETHOME">
107+
<CreateFolder />
108+
<Environment Id="E_PATH" Name="PATH" Value="[DOTNETHOME]" Part="last" Action="set" System="yes" />
109+
</Component>
110+
<?endif?>
111+
112+
<util:BroadcastEnvironmentChange Condition="DISABLE_SETTING_HOST_PATH &lt;&gt; &quot;#1&quot;" />
113+
114+
<!-- TODO change t something like: -->
115+
<!-- <util:BroadcastEnvironmentChange Action="set" Sequence="afterInstallFinalize" />
107116
108117
<InstallExecuteSequence>
109-
<!-- Only broadcast the change if the component is enabled. -->
110-
<Custom Action="WixBroadcastEnvironmentChange" After="InstallFinalize">
111-
<![CDATA[DISABLE_SETTING_HOST_PATH <> "#1"]]>
112-
</Custom>
113-
</InstallExecuteSequence>
118+
<Custom Action="override Wix4BroadcastEnvironmentChange_X86" After="InstallFinalize" Condition="FOO"/>
119+
</InstallExecuteSequence> -->
114120
</Fragment>
115121

116122
<Fragment>

0 commit comments

Comments
 (0)