|
38 | 38 | </RegistryKey>
|
39 | 39 | </Component>
|
40 | 40 |
|
41 |
| - <Component Id="cmdPath" Directory="DOTNETHOME" Guid="*"> |
| 41 | + <Component Id="cmpPath" Directory="DOTNETHOME" Guid="*"> |
42 | 42 | <?if $(var.Platform)~=x64 ?>
|
43 |
| - <!-- For x64 installer, only add to PATH when actually on native architecture --> |
| 43 | + <!-- For x64 installer, only add the sharedhost key when actually on native architecture. --> |
44 | 44 | <Condition>NOT NON_NATIVE_ARCHITECTURE</Condition>
|
45 | 45 | <?elseif $(var.Platform)~=x86 ?>
|
46 |
| - <!-- For x86 installer, only add to PATH when not on 64-bit platform --> |
| 46 | + <!-- For x86 installer, only add the key when not on 64-bit platform. --> |
47 | 47 | <Condition>NOT VersionNT64</Condition>
|
48 | 48 | <?endif?>
|
49 | 49 |
|
50 | 50 | <!-- A stable keypath with the right SxS characteristics for our PATH entry-->
|
51 | 51 | <RegistryKey Root="HKLM" Key="SOFTWARE\dotnet\Setup\InstalledVersions\$(var.Platform)\sharedhost">
|
52 | 52 | <RegistryValue KeyPath="yes" Action="write" Name="Path" Type="string" Value="[DOTNETHOME]"/>
|
53 | 53 | </RegistryKey>
|
54 |
| - <Environment Id="E_PATH" Name="PATH" Value="[DOTNETHOME]" Part="last" Action="set" System="yes" /> |
55 | 54 | </Component>
|
56 | 55 |
|
57 | 56 | <Component Id="cmpLicenseFiles" Directory="DOTNETHOME" Guid="{A61CBE5B-1282-4F29-90AD-63597AA2372E}">
|
|
63 | 62 | </File>
|
64 | 63 | </Component>
|
65 | 64 |
|
| 65 | + <ComponentRef Id="cmpSetPath" /> |
66 | 66 | </ComponentGroup>
|
67 | 67 |
|
68 | 68 | <Property Id="ProductCPU" Value="$(var.Platform)" />
|
|
76 | 76 | <CustomActionRef Id="Set_PROGRAMFILES_DOTNET_NON_NATIVE_ARCHITECTURE" />
|
77 | 77 | <?endif?>
|
78 | 78 | </Fragment>
|
| 79 | + |
| 80 | + <Fragment> |
| 81 | + <Property Id="DISABLE_SETTING_HOST_PATH" Secure="yes"> |
| 82 | + <RegistrySearch Id="DisableSettingHostPathSearch" Root="HKLM" Key="SOFTWARE\Microsoft\.NET" Type="raw" Name="DisableSettingHostPath"/> |
| 83 | + </Property> |
| 84 | + |
| 85 | + <Component Id="cmpSetPath" Guid="{0B910ED8-0877-473D-8658-647382324433}" Directory="DOTNETHOME"> |
| 86 | + <CreateFolder /> |
| 87 | + <!-- Always set the SYSTEM PATH, unless DisableSettingHostPath is 1. --> |
| 88 | + <?if $(var.Platform)~=x64 ?> |
| 89 | + <!-- For x64 installer, only add to PATH when actually on native architecture. --> |
| 90 | + <Condition><![CDATA[DISABLE_SETTING_HOST_PATH <> "#1" AND NOT NON_NATIVE_ARCHITECTURE]]></Condition> |
| 91 | + <?elseif $(var.Platform)~=x86 ?> |
| 92 | + <!-- For x86 installer, only add to PATH when not on 64-bit platform. --> |
| 93 | + <Condition><![CDATA[DISABLE_SETTING_HOST_PATH <> "#1" AND NOT VersionNT64]]></Condition> |
| 94 | + <?endif?> |
| 95 | + <Environment Id="E_PATH" Name="PATH" Value="[DOTNETHOME]" Part="last" Action="set" System="yes" /> |
| 96 | + </Component> |
| 97 | + |
| 98 | + <InstallExecuteSequence> |
| 99 | + <!-- Only broadcast the change if the component is enabled. --> |
| 100 | + <Custom Action="WixBroadcastEnvironmentChange" After="InstallFinalize"> |
| 101 | + <![CDATA[DISABLE_SETTING_HOST_PATH <> "#1"]]> |
| 102 | + </Custom> |
| 103 | + </InstallExecuteSequence> |
| 104 | + </Fragment> |
79 | 105 |
|
80 | 106 | <Fragment>
|
81 | 107 | <!-- Unlike DOTNETHOME which gives precedence to a user specified value over an x64 suffix, here we always want the suffixed path -->
|
|
0 commit comments