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.

Github-Pull: #33422
Rebased-From: 79752b9c0b
This commit is contained in:
Hodlinator
2025-09-18 09:29:44 +02:00
committed by fanquake
parent 1bc3be1962
commit 792a75ac86

View File

@@ -113,6 +113,19 @@ Section -post SEC0001
WriteRegStr HKCR "@CLIENT_TARNAME@" "" "URL:Bitcoin" WriteRegStr HKCR "@CLIENT_TARNAME@" "" "URL:Bitcoin"
WriteRegStr HKCR "@CLIENT_TARNAME@\DefaultIcon" "" $INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@ WriteRegStr HKCR "@CLIENT_TARNAME@\DefaultIcon" "" $INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@
WriteRegStr HKCR "@CLIENT_TARNAME@\shell\open\command" "" '"$INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@" "%1"' 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 SectionEnd
# Macro for selecting uninstaller sections # Macro for selecting uninstaller sections