Skip to content

Commit 7d8a8cc

Browse files
committed
Avoid launching as admin when NSIS installer ends.
The Bitcoin Core NSIS script runs with elevated privileges. Unfortunately, this means that it launches Bitcoin Core itself with elevated privileges when the user chooses to launch Bitcoin Core at the end of the installation procedure. This commit works around the issue by having explorer.exe launch Bitcoin Core. Seems to be a similar approach to what http://nsis.sourceforge.net/ShellExecAsUser_plug-in does, but without a plugin. h/t to "UK" at https://mdb-blog.blogspot.se/2013/01/nsis-lunch-program-as-user-from-uac.html?showComment=1410158039989#c2463780017054126736 for the sample code. Fixes #7990.
1 parent 5f2a399 commit 7d8a8cc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

share/setup.nsi.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ SetCompressor /SOLID lzma
2020
!define MUI_STARTMENUPAGE_REGISTRY_KEY ${REGKEY}
2121
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME StartMenuGroup
2222
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "@PACKAGE_NAME@"
23-
!define MUI_FINISHPAGE_RUN $INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@
23+
!define MUI_FINISHPAGE_RUN "$WINDIR\explorer.exe"
24+
!define MUI_FINISHPAGE_RUN_PARAMETERS $INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@
2425
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
2526
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "@abs_top_srcdir@/share/pixmaps/nsis-wizard.bmp"
2627
!define MUI_UNFINISHPAGE_NOAUTOCLOSE

0 commit comments

Comments
 (0)