Drop swidtag in correct Program Files folder per-arch#16195
Conversation
There was a problem hiding this comment.
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
ProgramFiles6432Folderreference 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?> |
There was a problem hiding this comment.
I think var.Platform will always be x86 for bundles since it's passed in here:
and MsiArch is set here:
There was a problem hiding this comment.
Wouldn't that imply we have a bug above on line 18?
There was a problem hiding this comment.
I guess we'd want an additional CandleVariable (I assume those translate to DefineConstants?) that carries the .msi arch into bundle.wxs?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
I pushed 2ffbf59, lemme know if that looks correct/complete
|
/backport to release/10.0 |
|
Started backporting to release/10.0: https://github.com/dotnet/arcade/actions/runs/18298186157 |
|
@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 128Please backport manually! |
In bundles,
ProgramFiles6432Folderis resolved based on the machine's architecture. So we need to calculate the folder ourselves.