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
7 changes: 2 additions & 5 deletions src/installer/pkg/sfx/installers/dotnet-host.proj
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@
<WixDependencyKeyName>Dotnet_CLI_SharedHost</WixDependencyKeyName>
<OutputFilesCandleVariable>HostSrc</OutputFilesCandleVariable>

<!-- Scheduling RemoveExistingProducts after InstallInitialize will remove the previous install first
before installing the new version. This allows compositional changes in major upgrades
and supports rollback, provided it is not turned off using machine policies (DisableRollback is not set to 1). -->
<MajorUpgradeSchedule>afterInstallInitialize</MajorUpgradeSchedule>
<MajorUpgradeSchedule>afterInstallExecute</MajorUpgradeSchedule>
<VersionInstallerName>false</VersionInstallerName>
<UseBrandingNameInLinuxPackageDescription>true</UseBrandingNameInLinuxPackageDescription>
<MacOSComponentNamePackType>sharedhost</MacOSComponentNamePackType>
Expand All @@ -30,7 +27,7 @@
<ItemGroup>
<WixSrcFile Include="host.wxs" />
<WixExtraComponentGroupRefId Include="InstallSharedHostandDetectionKeys" />
<CandleVariables Include="ExtraPropertyRefIds" Value="ProductCPU;RTM_ProductVersion;DISABLE_SETTING_HOST_PATH" />
<CandleVariables Include="ExtraPropertyRefIds" Value="ProductCPU;RTM_ProductVersion" />
<!-- Enables stable provider key - do not change -->
<CandleVariables Include="DependencyKey" Value="$(WixDependencyKeyName)_$(MajorVersion).$(MinorVersion)_$(TargetArchitecture)" />
</ItemGroup>
Expand Down
45 changes: 5 additions & 40 deletions src/installer/pkg/sfx/installers/host.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -39,27 +39,30 @@
</Component>

<?if $(var.Platform)~=x64 ?>
<!-- For x64 installer, only add the sharedhost key when actually on native architecture. -->
<!-- For x64 installer, only add to PATH when actually on native architecture. -->
<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>
<Environment Id="E_PATH" Name="PATH" Value="[DOTNETHOME]" Part="last" Action="set" System="yes" />
</Component>
<?elseif $(var.Platform)~=x86 ?>
<!-- For x86 installer, only add the key when not on 64-bit platform. -->
<!-- For x86 installer, only add to PATH when not on 64-bit platform. -->
<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>
<Environment Id="E_PATH" Name="PATH" Value="[DOTNETHOME]" Part="last" Action="set" System="yes" />
</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>
<Environment Id="E_PATH" Name="PATH" Value="[DOTNETHOME]" Part="last" Action="set" System="yes" />
</Component>
<?endif?>

Expand All @@ -72,7 +75,6 @@
</File>
</Component>

<ComponentRef Id="cmpSetPath" />
</ComponentGroup>

<Property Id="ProductCPU" Value="$(var.Platform)" />
Expand All @@ -86,43 +88,6 @@
<CustomActionRef Id="Set_PROGRAMFILES_DOTNET_NON_NATIVE_ARCHITECTURE" />
<?endif?>
</Fragment>

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

<?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 Action="set" Sequence="afterInstallFinalize" />

<InstallExecuteSequence>
<?if $(var.Platform)~=x64 ?>
<Custom Action="override Wix4BroadcastEnvironmentChange_X64" After="InstallFinalize" Condition="DISABLE_SETTING_HOST_PATH &lt;&gt; &quot;#1&quot;"/>
<?elseif $(var.Platform)~=x86 ?>
<Custom Action="override Wix4BroadcastEnvironmentChange_X86" After="InstallFinalize" Condition="DISABLE_SETTING_HOST_PATH &lt;&gt; &quot;#1&quot;"/>
<?elseif $(var.Platform)~=arm64 ?>
<Custom Action="override Wix4BroadcastEnvironmentChange_A64" After="InstallFinalize" Condition="DISABLE_SETTING_HOST_PATH &lt;&gt; &quot;#1&quot;"/>
<?else?>
<?error Unknown platform, $(var.Platform) ?>
<?endif?>
</InstallExecuteSequence>
</Fragment>

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