Skip to content

Commit df101c9

Browse files
committed
Merge bitcoin/bitcoin#33422: build: Remove lingering Windows registry & shortcuts (#32132 follow-up)
79752b9 build(windows): Remove lingering registry entries and shortcuts upon install (Hodlinator) Pull request description: ### Problem Prior to fb2b05b / #32132 we installed using paths with an extra " (64-bit)"-suffix. Installing a version including that commit on top of a version that does not results in 2 entries in the "Installed apps" list. Both of them end up running the same `C:\Program Files\Bitcoin\uninstall.exe`. However, only one of the entries is removed by the uninstaller. The left over registry entry will now point to an executable that no longer exists and fail to work. Removing the left over "Installed apps" entry on master currently requires the user to manually remove the Windows Registry entries (or run the correct old/new installer to ensure the uninstaller exists again). ### Solution This PR automates removal of old entries (& shortcuts) when installing the new version. ### Disclaimer Not an NSIS expert - confirmed that added deletion commands work without causing any visible errors both when prior items exist and when they don't. ACKs for top commit: achow101: ACK 79752b9 hebasto: ACK 79752b9. Tree-SHA512: d23bd2e8f035ca93c3bd6187b3e5545c89c541b51d7b2b91b79bae1ebe328cd08c38b57e75a39bb376771fc85a537fe1d628903b9eadd32d04c3eb976c2e6d87
2 parents 56c6daa + 79752b9 commit df101c9

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

share/setup.nsi.in

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,19 @@ Section -post SEC0001
113113
WriteRegStr HKCR "@CLIENT_TARNAME@" "" "URL:Bitcoin"
114114
WriteRegStr HKCR "@CLIENT_TARNAME@\DefaultIcon" "" $INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@
115115
WriteRegStr HKCR "@CLIENT_TARNAME@\shell\open\command" "" '"$INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@" "%1"'
116+
117+
# Lingering since fb2b05b1259d3e69e6e675adfa30b429424c7625 which removed the suffix
118+
DeleteRegValue HKCU "${REGKEY} (64-bit)\Components" Main
119+
DeleteRegKey HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name) (64-bit)"
120+
Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Uninstall $(^Name) (64-bit).lnk"
121+
Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\$(^Name) (64-bit).lnk"
122+
DeleteRegValue HKCU "${REGKEY} (64-bit)" StartMenuGroup
123+
DeleteRegValue HKCU "${REGKEY} (64-bit)" Path
124+
DeleteRegKey /IfEmpty HKCU "${REGKEY} (64-bit)\Components"
125+
DeleteRegKey /IfEmpty HKCU "${REGKEY} (64-bit)"
126+
127+
# Lingering since 77b2923f87131a407f7d4193c54db22375130403
128+
Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Bitcoin Core (testnet, 64-bit).lnk"
116129
SectionEnd
117130

118131
# Macro for selecting uninstaller sections

0 commit comments

Comments
 (0)