Skip to content

Commit 26880c3

Browse files
committed
build: Use PACKAGE_TARNAME and new bin names in NSIS script.
Replaces the hardcoded string "bitcoin" with the autoconf variable PACKAGE_TARNAME; fixes #7265. Places where I chose not to replace: 1. bitcoin.ico wasn't replaced because it doesn't seem to be relevant to the build system and its filename never affects the end user. 2. InstallDir wasn't replaced because the current text has an uppercase B, and I'm not sure of a good way to capitalize the result of PACKAGE_TARNAME. 3. A comment in the Main Installer section wasn't replaced because comments don't ever face the end user. 4. The registry value "URL:Bitcoin" wasn't replaced for the same reason as InstallDir. 5. Startup shortcut wasn't replaced for the same reason as InstallDir. All other appearances of "bitcoin" were replaced with PACKAGE_TARNAME, except for the bin names, which were instead replaced with the new bin name autoconf variables.
1 parent 0dbf6e4 commit 26880c3

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

share/setup.nsi.in

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ 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-qt.exe
23+
!define MUI_FINISHPAGE_RUN $INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@
2424
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
2525
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "@abs_top_srcdir@/share/pixmaps/nsis-wizard.bmp"
2626
!define MUI_UNFINISHPAGE_NOAUTOCLOSE
@@ -48,7 +48,7 @@ Var StartMenuGroup
4848
!insertmacro MUI_LANGUAGE English
4949

5050
# Installer attributes
51-
OutFile @abs_top_srcdir@/bitcoin-${VERSION}-win@[email protected]
51+
OutFile @abs_top_srcdir@/@PACKAGE_TARNAME@-${VERSION}-win@[email protected]
5252
!if "@WINDOWS_BITS@" == "64"
5353
InstallDir $PROGRAMFILES64\Bitcoin
5454
!else
@@ -73,19 +73,19 @@ ShowUninstDetails show
7373
Section -Main SEC0000
7474
SetOutPath $INSTDIR
7575
SetOverwrite on
76-
File @abs_top_srcdir@/release/bitcoin-qt.exe
76+
File @abs_top_srcdir@/release/@BITCOIN_GUI_NAME@@EXEEXT@
7777
File /oname=COPYING.txt @abs_top_srcdir@/COPYING
7878
File /oname=readme.txt @abs_top_srcdir@/doc/README_windows.txt
7979
SetOutPath $INSTDIR\daemon
80-
File @abs_top_srcdir@/release/bitcoind.exe
81-
File @abs_top_srcdir@/release/bitcoin-cli.exe
80+
File @abs_top_srcdir@/release/@BITCOIN_DAEMON_NAME@@EXEEXT@
81+
File @abs_top_srcdir@/release/@BITCOIN_CLI_NAME@@EXEEXT@
8282
SetOutPath $INSTDIR\doc
8383
File /r @abs_top_srcdir@/doc\*.*
8484
SetOutPath $INSTDIR
8585
WriteRegStr HKCU "${REGKEY}\Components" Main 1
8686

8787
# Remove old wxwidgets-based-bitcoin executable and locales:
88-
Delete /REBOOTOK $INSTDIR\bitcoin.exe
88+
Delete /REBOOTOK $INSTDIR\@PACKAGE_TARNAME@.exe
8989
RMDir /r /REBOOTOK $INSTDIR\locale
9090
SectionEnd
9191

@@ -95,7 +95,7 @@ Section -post SEC0001
9595
WriteUninstaller $INSTDIR\uninstall.exe
9696
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
9797
CreateDirectory $SMPROGRAMS\$StartMenuGroup
98-
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\$(^Name).lnk" $INSTDIR\bitcoin-qt.exe
98+
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\$(^Name).lnk" $INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@
9999
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Uninstall $(^Name).lnk" $INSTDIR\uninstall.exe
100100
!insertmacro MUI_STARTMENU_WRITE_END
101101
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayName "$(^Name)"
@@ -106,10 +106,10 @@ Section -post SEC0001
106106
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" UninstallString $INSTDIR\uninstall.exe
107107
WriteRegDWORD HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoModify 1
108108
WriteRegDWORD HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoRepair 1
109-
WriteRegStr HKCR "bitcoin" "URL Protocol" ""
110-
WriteRegStr HKCR "bitcoin" "" "URL:Bitcoin"
111-
WriteRegStr HKCR "bitcoin\DefaultIcon" "" $INSTDIR\bitcoin-qt.exe
112-
WriteRegStr HKCR "bitcoin\shell\open\command" "" '"$INSTDIR\bitcoin-qt.exe" "%1"'
109+
WriteRegStr HKCR "@PACKAGE_TARNAME@" "URL Protocol" ""
110+
WriteRegStr HKCR "@PACKAGE_TARNAME@" "" "URL:Bitcoin"
111+
WriteRegStr HKCR "@PACKAGE_TARNAME@\DefaultIcon" "" $INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@
112+
WriteRegStr HKCR "@PACKAGE_TARNAME@\shell\open\command" "" '"$INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@" "%1"'
113113
SectionEnd
114114

115115
# Macro for selecting uninstaller sections
@@ -127,7 +127,7 @@ done${UNSECTION_ID}:
127127

128128
# Uninstaller sections
129129
Section /o -un.Main UNSEC0000
130-
Delete /REBOOTOK $INSTDIR\bitcoin-qt.exe
130+
Delete /REBOOTOK $INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@
131131
Delete /REBOOTOK $INSTDIR\COPYING.txt
132132
Delete /REBOOTOK $INSTDIR\readme.txt
133133
RMDir /r /REBOOTOK $INSTDIR\daemon
@@ -147,7 +147,7 @@ Section -un.post UNSEC0001
147147
DeleteRegValue HKCU "${REGKEY}" Path
148148
DeleteRegKey /IfEmpty HKCU "${REGKEY}\Components"
149149
DeleteRegKey /IfEmpty HKCU "${REGKEY}"
150-
DeleteRegKey HKCR "bitcoin"
150+
DeleteRegKey HKCR "@PACKAGE_TARNAME@"
151151
RmDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup
152152
RmDir /REBOOTOK $INSTDIR
153153
Push $R0

0 commit comments

Comments
 (0)