5
5
6
6
<Fragment >
7
7
8
- <ComponentGroup Id =" InstallSharedHostandDetectionKeys" >
8
+ <ComponentGroup Id =" InstallSharedHostandDetectionKeys" Directory = " DOTNETHOME " >
9
9
10
10
<!-- When installing the SharedHost; copy all files to the traditional default install location: 'ProgramFiles'\dotnet even when installing into a custom location.
11
11
20
20
1. the legacy SDK can be subsequently installed
21
21
2. the user runs 'dotnet' commands directly against 'ProgramFiles'\dotnet\dotnet.exe -->
22
22
23
- <Component Id =" cmpCoreHost" Directory = " DOTNETHOME " Guid =" {45399BBB-DDA5-4386-A2E9-618FB3C54A18}" >
23
+ <Component Id =" cmpCoreHost" Guid =" {45399BBB-DDA5-4386-A2E9-618FB3C54A18}" >
24
24
<File Id =" fileCoreHostExe" KeyPath =" yes" Source =" $(var.HostSrc)\dotnet.exe" >
25
25
<CopyFile Id =" copyFileCoreHostExe" DestinationDirectory =" PROGRAMFILES_DOTNET" />
26
26
</File >
27
+ </Component >
28
+
29
+ <Component Id =" cmpSharedHostVersionRegistry" Guid =" *" >
27
30
<RegistryKey Root =" HKLM" Key =" SOFTWARE\dotnet\Setup\InstalledVersions\$(var.Platform)\sharedhost" >
28
- <RegistryValue Action =" write" Name =" Version" Type =" string" Value =" $(var.NugetVersion)" />
31
+ <RegistryValue KeyPath =" yes" Action =" write" Name =" Version" Type =" string" Value =" $(var.NugetVersion)" />
32
+ </RegistryKey >
33
+ </Component >
34
+
35
+ <Component Id =" cmdPath" Guid =" *" >
36
+ <?if $(var.Platform)~=x64 ?>
37
+ <!-- For x64 installer, only add to PATH when actually on native architecture -->
38
+ <Condition >NOT NON_NATIVE_ARCHITECTURE</Condition >
39
+ <?endif ?>
40
+
41
+ <!-- A stable keypath with the right SxS characteristics for our PATH entry-->
42
+ <RegistryKey Root =" HKLM" Key =" SOFTWARE\dotnet\Setup\InstalledVersions\$(var.Platform)\sharedhost" >
43
+ <RegistryValue KeyPath =" yes" Action =" write" Name =" Path" Type =" string" Value =" [DOTNETHOME]" />
29
44
</RegistryKey >
30
45
<Environment Id =" E_PATH" Name =" PATH" Value =" [DOTNETHOME]" Part =" last" Action =" set" System =" yes" />
31
46
</Component >
32
47
33
- <Component Id =" cmpLicenseFiles" Directory = " DOTNETHOME " Guid =" {A61CBE5B-1282-4F29-90AD-63597AA2372E}" >
48
+ <Component Id =" cmpLicenseFiles" Guid =" {A61CBE5B-1282-4F29-90AD-63597AA2372E}" >
34
49
<File Id =" fileLicenseTxt" KeyPath =" yes" Source =" $(var.HostSrc)\LICENSE.txt" >
35
50
<CopyFile Id =" copyFileLicenseTxt" DestinationDirectory =" PROGRAMFILES_DOTNET" />
36
51
</File >
47
62
<DirectoryRef Id =" $(var.Program_Files)" >
48
63
<Directory Id =" PROGRAMFILES_DOTNET" Name =" dotnet" />
49
64
</DirectoryRef >
65
+
66
+ <?if $(var.Platform)~=x64 ?>
67
+ <CustomActionRef Id =" Set_PROGRAMFILES_DOTNET_NON_NATIVE_ARCHITECTURE" />
68
+ <?endif ?>
50
69
</Fragment >
51
-
52
- </Wix >
70
+
71
+ <Fragment >
72
+ <!-- Unlike DOTNETHOME which gives precedence to a user specified value over an x64 suffix, here we always want the suffixed path -->
73
+ <SetProperty Action =" Set_PROGRAMFILES_DOTNET_NON_NATIVE_ARCHITECTURE" Id =" PROGRAMFILES_DOTNET" Value =" [$(var.Program_Files)]dotnet\x64\" After =" Set_NON_NATIVE_ARCHITECTURE" >
74
+ NON_NATIVE_ARCHITECTURE
75
+ </SetProperty >
76
+ </Fragment >
77
+ </Wix >
0 commit comments