[Installer] Fix uninstall failure when cached MSI is missing#48669
[Installer] Fix uninstall failure when cached MSI is missing#48669giruuuuj wants to merge 1 commit into
Conversation
- Extend ForceRemoveOldVersionCA to run during pure uninstall (not just upgrades) - Skip the current product in the enumeration during uninstall to avoid re-entrancy - Force-remove orphaned MSI products with missing cached MSI via MsiConfigureProductExW - Add force_remove_orphaned_msi.cmd for additional cleanup at the bundle level This fixes the 'msi file for v0.86 not found' error during uninstall.
|
@giruuuuj please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
| continue; | ||
| } | ||
|
|
||
| // Skip the current product during uninstall to avoid re-entrancy |
| continue; | ||
| } | ||
|
|
||
| // Skip the current product during uninstall to avoid re-entrancy |
| { | ||
| Logger::info(L"PowerToys MSI source missing for product {}. Force-removing...", productCode); | ||
|
|
||
| UINT result = MsiConfigureProductExW(productCode, INSTALLLEVEL_DEFAULT, INSTALLSTATE_ABSENT, L"MSIFASTINSTALL=7 REMOVE=ALL"); |
@check-spelling-bot Report🔴 Please reviewSee the 📂 files view, the 📜action log, 👼 SARIF report, or 📝 job summary for details.Unrecognized words (2)entrancy To accept these unrecognized words as correct, you could run the following commands... in a clone of the git@github.com:giruuuuj/PowerToys.git repository curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/cfb6f7e75bbfc89c71eaa30366d0c166f1bd9c8c/apply.pl' |
perl - 'https://github.com/microsoft/PowerToys/actions/runs/27597454737/attempts/1' &&
git commit -m 'Update check-spelling metadata'Forbidden patterns 🙅 (1)In order to address this, you could change the content to not match the forbidden patterns (comments before forbidden patterns may help explain why they're forbidden), add patterns for acceptable instances, or adjust the forbidden patterns themselves. These forbidden patterns matched content: Should be
|
| ❌ Errors | Count |
|---|---|
| ❌ forbidden-pattern | 1 |
See ❌ Event descriptions for more information.
If the flagged items are 🤯 false positives
If items relate to a ...
-
binary file (or some other file you wouldn't want to check at all).
Please add a file path to the
excludes.txtfile matching the containing file.File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.
^refers to the file's path from the root of the repository, so^README\.md$would exclude README.md (on whichever branch you're using). -
well-formed pattern.
If you can write a pattern that would match it,
try adding it to thepatterns.txtfile.Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.
Note that patterns can't match multiline strings.
��This PR fixes the 'msi file for v0.86 not found' error during uninstall (issue #48668). When Windows Installer cache is cleaned, the cached MSI file for a previous PowerToys version may be missing, causing uninstall to fail.
Root cause: The ForceRemoveOldVersion custom action only ran during upgrades (WIX_UPGRADE_DETECTED), not during pure uninstall.
Changes:
Product.wxs � Schedule ForceRemoveOldVersion to run during pure uninstall as well:
CustomAction.cpp � ForceRemoveOldVersionCA improvements:
CustomAction.def � Export ForceRemoveOldVersionCA
force_remove_orphaned_msi.cmd � New standalone cleanup script for detecting and force-removing orphaned PowerToys MSI products with missing cached files