Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,29 @@
<Directory Id="DOTNETHOME" Name="dotnet" />
</Directory>
</Directory>

<?if $(var.Platform) = x64 ?>
<CustomActionRef Id="Set_DOTNETHOME_x64" />
<?endif?>
</Fragment>

<Fragment>
<Property Id="PROCESSOR_ARCHITECTURE">
<RegistrySearch Id="Search_PROCESSOR_ARCHITECTURE"
Root="HKLM"
Key="SYSTEM\CurrentControlSet\Control\Session Manager\Environment"
Name="PROCESSOR_ARCHITECTURE"
Type="raw" />
</Property>

<!-- Identify when installing in emulation as when PROCESSOR_ARCHITECTURE is not AMD64
https://docs.microsoft.com/en-us/windows/win32/winprog64/wow64-implementation-details -->
<SetProperty Id="INSTALLING_IN_EMULATION" Value="true" Before="Set_DOTNETHOME_x64">
NOT PROCESSOR_ARCHITECTURE="AMD64"
</SetProperty>
<!-- When running in x64 emulation and user hasn't specified install directory, install to an x64 subdirectory-->
<SetProperty Action="Set_DOTNETHOME_x64" Id="DOTNETHOME" Value="[$(var.ProgramFilesFolder)]dotnet\x64\" Before="CostFinalize">
INSTALLING_IN_EMULATION AND NOT DOTNETHOME
</SetProperty>
</Fragment>
</Wix>
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ public override bool Execute()
List<string> sourceFiles = new();
string msiSourcePath = Path.Combine(MsiDirectory, $"{nupkg.Id}", $"{nupkg.Version}", platform);
sourceFiles.Add(EmbeddedTemplates.Extract("DependencyProvider.wxs", msiSourcePath));
sourceFiles.Add(EmbeddedTemplates.Extract("Directories.wxs", msiSourcePath));
sourceFiles.Add(EmbeddedTemplates.Extract("ManifestProduct.wxs", msiSourcePath));

string EulaRtfPath = Path.Combine(msiSourcePath, "eula.rtf");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,29 @@
</Directory>
</Directory>
</Directory>

<?if $(var.Platform) = x64 ?>
<CustomActionRef Id="Set_DOTNETHOME_x64" />
<?endif?>
</Fragment>

<Fragment>
<Property Id="PROCESSOR_ARCHITECTURE">
<RegistrySearch Id="Search_PROCESSOR_ARCHITECTURE"
Root="HKLM"
Key="SYSTEM\CurrentControlSet\Control\Session Manager\Environment"
Name="PROCESSOR_ARCHITECTURE"
Type="raw" />
</Property>

<!-- Identify when installing in emulation as when PROCESSOR_ARCHITECTURE is not AMD64
https://docs.microsoft.com/en-us/windows/win32/winprog64/wow64-implementation-details -->
<SetProperty Id="INSTALLING_IN_EMULATION" Value="true" Before="Set_DOTNETHOME_x64">
NOT PROCESSOR_ARCHITECTURE="AMD64"
</SetProperty>
<!-- When running in x64 emulation and user hasn't specified install directory, install to an x64 subdirectory-->
<SetProperty Action="Set_DOTNETHOME_x64" Id="DOTNETHOME" Value="[$(var.ProgramFilesFolder)]dotnet\x64\" Before="CostFinalize">
INSTALLING_IN_EMULATION AND NOT DOTNETHOME
</SetProperty>
</Fragment>
</Wix>
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,13 @@
NOT WIX_DOWNGRADE_DETECTED
</Condition>

<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="$(var.ProgramFilesFolder)">
<Directory Id="DOTNETHOME" Name="dotnet">
<Directory Id="ManifestDir" Name="sdk-manifests">
<Directory Id="VersionDir" Name="$(var.SdkFeatureBandVersion)">
<Directory Id="ManifestIdDir" Name="$(var.ManifestId)" />
</Directory>
</Directory>
<DirectoryRef Id="DOTNETHOME">
<Directory Id="ManifestDir" Name="sdk-manifests">
<Directory Id="VersionDir" Name="$(var.SdkFeatureBandVersion)">
<Directory Id="ManifestIdDir" Name="$(var.ManifestId)" />
</Directory>
</Directory>
</Directory>
</DirectoryRef>

<MediaTemplate CompressionLevel="high" EmbedCab="yes" />

Expand Down