windows: delete lightning URI hooks on uninstall
What changed, and why it matters
This commit fixes the Windows uninstaller so it removes leftover registry entries for Lightning payment links (lightning, lnurlp, lnurlw), not just Bitcoin links. Before the fix, uninstalling Electrum left these entries behind, which could make Windows still think Electrum was the program to handle those links even after the software was gone.
No immediate security response required. Treat as a normal bug fix and include in the next release. Users who previously uninstalled Electrum on Windows may wish to manually remove leftover HKCU\Software\Classes\lightning, lnurlp, and lnurlw keys if they experience unexpected URI handling behavior.
Security signals we found
Residual URI handler registration after uninstall
Registry cleanup inconsistency between install and uninstall
Potential broken protocol handler behavior post-uninstall
Evidence from the diff
The NSIS installer script (contrib/build-wine/electrum.nsi) now deletes the HKCU\Software\Classes registry keys for ‘bitcoin’, ‘lightning’, ‘lnurlp’, and ‘lnurlw’ during uninstall. Previously only the ‘bitcoin’ key was removed. This is a cleanup bug: residual URI handler registrations could cause Windows to invoke a no-longer-present Electrum executable for lightning: and lnurl: style URLs, leading to broken behavior or potential confusion about which application handles those schemes.
Changed components
Windows installer/uninstaller (contrib/build-wine/electrum.nsi)Windows registry URI handler registration for lightning, lnurlp, lnurlwInspect captured patch +3 / −0
diff --git a/contrib/build-wine/electrum.nsi b/contrib/build-wine/electrum.nsi
index 3eeab10..23111d5 100644
--- a/contrib/build-wine/electrum.nsi
+++ b/contrib/build-wine/electrum.nsi
@@ -237,6 +237,9 @@ Section "Uninstall"
RMDir "$SMPROGRAMS\${PRODUCT_NAME}"
DeleteRegKey HKCU "Software\Classes\bitcoin"
+ DeleteRegKey HKCU "Software\Classes\lightning"
+ DeleteRegKey HKCU "Software\Classes\lnurlp"
+ DeleteRegKey HKCU "Software\Classes\lnurlw"
DeleteRegKey HKCU "Software\${PRODUCT_NAME}"
DeleteRegKey HKCU "${PRODUCT_UNINST_KEY}"
SectionEnd
Why this scored 28/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.