build(windows): Remove lingering registry entries and shortcuts upon install
What changed, and why it matters
This change updates the Windows installer so that when a new version of Bitcoin Core is installed, it cleans up leftover registry entries and Start Menu shortcuts from older releases. Previously, old uninstaller entries could remain in Windows' list of installed programs, causing confusion and making whichever entry was uninstalled last fail to remove the software properly. There is no security vulnerability here; it is a cleanup fix for a user-experience issue on Windows.
No security action required. This is a routine installer cleanup improvement. Users installing new Windows releases will benefit from cleaner registry state automatically.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies share/setup.nsi.in, the NSIS installer script for Windows. It adds deletion commands in the post-install section to remove stale registry keys and Start Menu shortcuts left behind by prior Bitcoin Core installers that used a ‘(64-bit)’ suffix or a ‘testnet, 64-bit’ label. Specifically, it deletes uninstaller registry entries under HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, component tracking keys, and associated .lnk shortcuts. The change prevents duplicate ‘Bitcoin Core’ and ‘Bitcoin Core (64-bit)’ entries in Windows’ installed programs list and avoids the scenario where uninstalling one breaks the other because both reference the same install directory.
Changed components
Windows installer (share/setup.nsi.in)Inspect captured patch +13 / −0
diff --git a/share/setup.nsi.in b/share/setup.nsi.in
index 2160cc05..387d7811 100644
--- a/share/setup.nsi.in
+++ b/share/setup.nsi.in
@@ -113,6 +113,19 @@ Section -post SEC0001
WriteRegStr HKCR "@CLIENT_TARNAME@" "" "URL:Bitcoin"
WriteRegStr HKCR "@CLIENT_TARNAME@\DefaultIcon" "" $INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@
WriteRegStr HKCR "@CLIENT_TARNAME@\shell\open\command" "" '"$INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@" "%1"'
+
+ # Lingering since fb2b05b1259d3e69e6e675adfa30b429424c7625 which removed the suffix
+ DeleteRegValue HKCU "${REGKEY} (64-bit)\Components" Main
+ DeleteRegKey HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name) (64-bit)"
+ Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Uninstall $(^Name) (64-bit).lnk"
+ Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\$(^Name) (64-bit).lnk"
+ DeleteRegValue HKCU "${REGKEY} (64-bit)" StartMenuGroup
+ DeleteRegValue HKCU "${REGKEY} (64-bit)" Path
+ DeleteRegKey /IfEmpty HKCU "${REGKEY} (64-bit)\Components"
+ DeleteRegKey /IfEmpty HKCU "${REGKEY} (64-bit)"
+
+ # Lingering since 77b2923f87131a407f7d4193c54db22375130403
+ Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Bitcoin Core (testnet, 64-bit).lnk"
SectionEnd
# Macro for selecting uninstaller sections
Why this scored 21/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.