From 79752b9c0b6bd9b2203ac98d28dd67734050c14a Mon Sep 17 00:00:00 2001 From: Hodlinator <172445034+hodlinator@users.noreply.github.com> Date: Thu, 18 Sep 2025 09:29:44 +0200 Subject: [PATCH] build(windows): Remove lingering registry entries and shortcuts upon install Prior releases installed using these paths. Especially annoying was that the lingering registry entry for the uninstaller would show up as "Bitcoin Core (64-bit)" besides the current "Bitcoin Core" entry in the list of installed programs, and whichever was uninstalled last would fail to work as they would default to the same install directory. --- share/setup.nsi.in | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/share/setup.nsi.in b/share/setup.nsi.in index 2160cc05a12..387d78116b8 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