-
Notifications
You must be signed in to change notification settings - Fork 4.4k
windows installer: handle missing uninstaller #13637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 addresses issue #13615 by adding logic to handle cases where the Windows uninstaller executable is missing despite registry entries still existing. The installer now checks if the uninstaller file exists before attempting to run it, and cleans up orphaned registry keys if the file is not found.
Key Changes:
- Added
checkUninstallersection to verify uninstaller file existence before execution - Implemented quote removal logic to extract the file path from the UninstallString registry value
- Added
cleanupOrphanedRegistrysection to delete orphaned registry keys when uninstaller is missing
| StrCpy $R1 $R0 "" 1 ; Skip first quote | ||
| StrLen $R2 $R1 | ||
| IntOp $R2 $R2 - 1 ; Remove last quote | ||
| StrCpy $R1 $R1 $R2 |
Copilot
AI
Nov 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The quote removal logic assumes the UninstallString always has quotes, but doesn't verify this assumption. If the registry value lacks quotes (e.g., from a corrupted registry or different installer version), this code will incorrectly trim the first and last characters of the actual path.
Consider using a defensive approach that checks for quotes before removing them:
StrCpy $R1 $R0 1 ; Get first character
StrCmp $R1 '"' +1 +4 ; If it's a quote, remove quotes
StrCpy $R1 $R0 "" 1 ; Skip first quote
StrLen $R2 $R1
IntOp $R2 $R2 - 1 ; Remove last quote
StrCpy $R1 $R1 $R2
Goto +2
StrCpy $R1 $R0 ; No quotes, use path as-is| StrCpy $R1 $R0 "" 1 ; Skip first quote | |
| StrLen $R2 $R1 | |
| IntOp $R2 $R2 - 1 ; Remove last quote | |
| StrCpy $R1 $R1 $R2 | |
| StrCpy $R1 $R0 1 ; Get first character | |
| StrCmp $R1 '"' +1 +4 ; If it's a quote, remove quotes | |
| StrCpy $R1 $R0 "" 1 ; Skip first quote | |
| StrLen $R2 $R1 | |
| IntOp $R2 $R2 - 1 ; Remove last quote | |
| StrCpy $R1 $R1 $R2 | |
| Goto +2 | |
| StrCpy $R1 $R0 ; No quotes, use path as-is |
|
|
||
| cleanupOrphanedRegistry: | ||
| DetailPrint "Previous uninstaller not found, cleaning up orphaned registry keys..." | ||
| SetRegView 64 |
Copilot
AI
Nov 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The SetRegView 64 call is redundant here as it was already set at line 64 before reading the registry. This line can be removed to avoid unnecessary duplication.
| SetRegView 64 |
|
Did this end up working out? |




Attempt at fixing #13615