Skip to content

Commit 13aa853

Browse files
Revert conditionally setting SYSTEM PATH in host install (#118092) (#120567)
Co-authored-by: Pranav Senthilnathan <pranav.senthilnathan@live.com>
1 parent d321bc6 commit 13aa853

File tree

2 files changed

+7
-45
lines changed

2 files changed

+7
-45
lines changed

src/installer/pkg/sfx/installers/dotnet-host.proj

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@
1313
<WixDependencyKeyName>Dotnet_CLI_SharedHost</WixDependencyKeyName>
1414
<OutputFilesCandleVariable>HostSrc</OutputFilesCandleVariable>
1515

16-
<!-- Scheduling RemoveExistingProducts after InstallInitialize will remove the previous install first
17-
before installing the new version. This allows compositional changes in major upgrades
18-
and supports rollback, provided it is not turned off using machine policies (DisableRollback is not set to 1). -->
19-
<MajorUpgradeSchedule>afterInstallInitialize</MajorUpgradeSchedule>
16+
<MajorUpgradeSchedule>afterInstallExecute</MajorUpgradeSchedule>
2017
<VersionInstallerName>false</VersionInstallerName>
2118
<UseBrandingNameInLinuxPackageDescription>true</UseBrandingNameInLinuxPackageDescription>
2219
<MacOSComponentNamePackType>sharedhost</MacOSComponentNamePackType>
@@ -30,7 +27,7 @@
3027
<ItemGroup>
3128
<WixSrcFile Include="host.wxs" />
3229
<WixExtraComponentGroupRefId Include="InstallSharedHostandDetectionKeys" />
33-
<CandleVariables Include="ExtraPropertyRefIds" Value="ProductCPU;RTM_ProductVersion;DISABLE_SETTING_HOST_PATH" />
30+
<CandleVariables Include="ExtraPropertyRefIds" Value="ProductCPU;RTM_ProductVersion" />
3431
<!-- Enables stable provider key - do not change -->
3532
<CandleVariables Include="DependencyKey" Value="$(WixDependencyKeyName)_$(MajorVersion).$(MinorVersion)_$(TargetArchitecture)" />
3633
</ItemGroup>

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

Lines changed: 5 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -39,27 +39,30 @@
3939
</Component>
4040

4141
<?if $(var.Platform)~=x64 ?>
42-
<!-- For x64 installer, only add the sharedhost key when actually on native architecture. -->
42+
<!-- For x64 installer, only add to PATH when actually on native architecture. -->
4343
<Component Id="cmpPath" Directory="DOTNETHOME" Condition="NOT NON_NATIVE_ARCHITECTURE">
4444
<!-- A stable keypath with the right SxS characteristics for our PATH entry-->
4545
<RegistryKey Root="HKLM" Key="SOFTWARE\dotnet\Setup\InstalledVersions\$(var.Platform)\sharedhost">
4646
<RegistryValue KeyPath="yes" Action="write" Name="Path" Type="string" Value="[DOTNETHOME]"/>
4747
</RegistryKey>
48+
<Environment Id="E_PATH" Name="PATH" Value="[DOTNETHOME]" Part="last" Action="set" System="yes" />
4849
</Component>
4950
<?elseif $(var.Platform)~=x86 ?>
50-
<!-- For x86 installer, only add the key when not on 64-bit platform. -->
51+
<!-- For x86 installer, only add to PATH when not on 64-bit platform. -->
5152
<Component Id="cmpPath" Directory="DOTNETHOME" Condition="NOT VersionNT64">
5253
<!-- A stable keypath with the right SxS characteristics for our PATH entry-->
5354
<RegistryKey Root="HKLM" Key="SOFTWARE\dotnet\Setup\InstalledVersions\$(var.Platform)\sharedhost">
5455
<RegistryValue KeyPath="yes" Action="write" Name="Path" Type="string" Value="[DOTNETHOME]"/>
5556
</RegistryKey>
57+
<Environment Id="E_PATH" Name="PATH" Value="[DOTNETHOME]" Part="last" Action="set" System="yes" />
5658
</Component>
5759
<?else?>
5860
<Component Id="cmpPath" Directory="DOTNETHOME">
5961
<!-- A stable keypath with the right SxS characteristics for our PATH entry-->
6062
<RegistryKey Root="HKLM" Key="SOFTWARE\dotnet\Setup\InstalledVersions\$(var.Platform)\sharedhost">
6163
<RegistryValue KeyPath="yes" Action="write" Name="Path" Type="string" Value="[DOTNETHOME]"/>
6264
</RegistryKey>
65+
<Environment Id="E_PATH" Name="PATH" Value="[DOTNETHOME]" Part="last" Action="set" System="yes" />
6366
</Component>
6467
<?endif?>
6568

@@ -72,7 +75,6 @@
7275
</File>
7376
</Component>
7477

75-
<ComponentRef Id="cmpSetPath" />
7678
</ComponentGroup>
7779

7880
<Property Id="ProductCPU" Value="$(var.Platform)" />
@@ -86,43 +88,6 @@
8688
<CustomActionRef Id="Set_PROGRAMFILES_DOTNET_NON_NATIVE_ARCHITECTURE" />
8789
<?endif?>
8890
</Fragment>
89-
90-
<Fragment>
91-
<Property Id="DISABLE_SETTING_HOST_PATH" Secure="yes">
92-
<RegistrySearch Id="DisableSettingHostPathSearch" Root="HKLM" Key="SOFTWARE\Microsoft\.NET" Type="raw" Name="DisableSettingHostPath" />
93-
</Property>
94-
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 Action="set" Sequence="afterInstallFinalize" />
113-
114-
<InstallExecuteSequence>
115-
<?if $(var.Platform)~=x64 ?>
116-
<Custom Action="override Wix4BroadcastEnvironmentChange_X64" After="InstallFinalize" Condition="DISABLE_SETTING_HOST_PATH &lt;&gt; &quot;#1&quot;"/>
117-
<?elseif $(var.Platform)~=x86 ?>
118-
<Custom Action="override Wix4BroadcastEnvironmentChange_X86" After="InstallFinalize" Condition="DISABLE_SETTING_HOST_PATH &lt;&gt; &quot;#1&quot;"/>
119-
<?elseif $(var.Platform)~=arm64 ?>
120-
<Custom Action="override Wix4BroadcastEnvironmentChange_A64" After="InstallFinalize" Condition="DISABLE_SETTING_HOST_PATH &lt;&gt; &quot;#1&quot;"/>
121-
<?else?>
122-
<?error Unknown platform, $(var.Platform) ?>
123-
<?endif?>
124-
</InstallExecuteSequence>
125-
</Fragment>
12691

12792
<Fragment>
12893
<!-- Unlike DOTNETHOME which gives precedence to a user specified value over an x64 suffix, here we always want the suffixed path -->

0 commit comments

Comments
 (0)