Skip to content

Drop swidtag in correct Program Files folder per-arch#16195

Merged
wtgodbe merged 3 commits intomainfrom
wtgodbe/swidtag
Oct 7, 2025
Merged

Drop swidtag in correct Program Files folder per-arch#16195
wtgodbe merged 3 commits intomainfrom
wtgodbe/swidtag

Conversation

@wtgodbe
Copy link
Member

@wtgodbe wtgodbe commented Oct 6, 2025

In bundles, ProgramFiles6432Folder is resolved based on the machine's architecture. So we need to calculate the folder ourselves.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the software tag installation path in WiX bundle configuration to use architecture-specific Program Files directories instead of relying on the machine's architecture resolution of ProgramFiles6432Folder.

  • Replaces single ProgramFiles6432Folder reference with architecture-specific folder variables
  • Adds conditional logic to handle x64/arm64 vs x86 architectures separately
  • Ensures the swidtag is placed in the correct Program Files directory based on the bundle's target architecture

<?endif?>

<SoftwareTag Regid="microsoft.com" InstallPath="[ProgramFiles6432Folder]dotnet" />
<?if $(var.Platform)=x64?>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think var.Platform will always be x86 for bundles since it's passed in here:

<CandleVariables Include="Platform" Value="$(MsiArch)" />

and MsiArch is set here:

<MsiArch Condition="'$(GenerateExeBundle)' == 'true'">x86</MsiArch>
<MsiArch Condition="'$(GenerateExeBundle)' != 'true'">$(InstallerTargetArchitecture)</MsiArch>

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't that imply we have a bug above on line 18?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we'd want an additional CandleVariable (I assume those translate to DefineConstants?) that carries the .msi arch into bundle.wxs?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea I think it's correct to have Platform always set to InstallerTargetArchitecture. We just need to make sure that we pass in x86 for (1) wix.exe and (2) for wixpack creation. Looking at the usages of var.Platform in bundles, it looks like it should be x64/arm64/x86 instead of always x86.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed 2ffbf59, lemme know if that looks correct/complete

@wtgodbe
Copy link
Member Author

wtgodbe commented Oct 7, 2025

/backport to release/10.0

@github-actions
Copy link
Contributor

github-actions bot commented Oct 7, 2025

Started backporting to release/10.0: https://github.com/dotnet/arcade/actions/runs/18298186157

@github-actions
Copy link
Contributor

github-actions bot commented Oct 7, 2025

@wtgodbe backporting to "release/10.0" failed, the patch most likely resulted in conflicts:

$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch

Applying: Drop swidtag in correct Program Files folder per-arch
Applying: Refactor platform conditionals for SoftwareTag
Applying: Change CandleVariables Platform value to InstallerTargetArchitecture
Using index info to reconstruct a base tree...
M	src/Microsoft.DotNet.Build.Tasks.Installers/build/wix5/wix.targets
Falling back to patching base and 3-way merge...
Auto-merging src/Microsoft.DotNet.Build.Tasks.Installers/build/wix5/wix.targets
CONFLICT (content): Merge conflict in src/Microsoft.DotNet.Build.Tasks.Installers/build/wix5/wix.targets
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0003 Change CandleVariables Platform value to InstallerTargetArchitecture
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants