2014-01-21 12:01:37 +01:00
|
|
|
Name "@PACKAGE_NAME@ (@WINDOWS_BITS@-bit)"
|
2013-05-28 01:55:01 +02:00
|
|
|
|
|
|
|
RequestExecutionLevel highest
|
|
|
|
SetCompressor /SOLID lzma
|
|
|
|
|
|
|
|
# General Symbol Definitions
|
|
|
|
!define REGKEY "SOFTWARE\$(^Name)"
|
|
|
|
!define VERSION @CLIENT_VERSION_MAJOR@.@CLIENT_VERSION_MINOR@.@CLIENT_VERSION_REVISION@
|
2015-12-09 11:53:12 +01:00
|
|
|
!define COMPANY "@PACKAGE_NAME@ project"
|
2016-01-28 05:37:34 +01:00
|
|
|
!define URL @PACKAGE_URL@
|
2013-05-28 01:55:01 +02:00
|
|
|
|
|
|
|
# MUI Symbol Definitions
|
|
|
|
!define MUI_ICON "@abs_top_srcdir@/share/pixmaps/bitcoin.ico"
|
|
|
|
!define MUI_WELCOMEFINISHPAGE_BITMAP "@abs_top_srcdir@/share/pixmaps/nsis-wizard.bmp"
|
|
|
|
!define MUI_HEADERIMAGE
|
|
|
|
!define MUI_HEADERIMAGE_RIGHT
|
|
|
|
!define MUI_HEADERIMAGE_BITMAP "@abs_top_srcdir@/share/pixmaps/nsis-header.bmp"
|
|
|
|
!define MUI_FINISHPAGE_NOAUTOCLOSE
|
|
|
|
!define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM
|
|
|
|
!define MUI_STARTMENUPAGE_REGISTRY_KEY ${REGKEY}
|
|
|
|
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME StartMenuGroup
|
2014-01-21 18:41:11 +01:00
|
|
|
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "@PACKAGE_NAME@"
|
2016-02-26 01:04:48 +01:00
|
|
|
!define MUI_FINISHPAGE_RUN $INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@
|
2013-05-28 01:55:01 +02:00
|
|
|
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
|
|
|
|
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "@abs_top_srcdir@/share/pixmaps/nsis-wizard.bmp"
|
|
|
|
!define MUI_UNFINISHPAGE_NOAUTOCLOSE
|
|
|
|
|
|
|
|
# Included files
|
|
|
|
!include Sections.nsh
|
|
|
|
!include MUI2.nsh
|
2014-01-21 12:01:37 +01:00
|
|
|
!if "@WINDOWS_BITS@" == "64"
|
|
|
|
!include x64.nsh
|
|
|
|
!endif
|
2013-05-28 01:55:01 +02:00
|
|
|
|
|
|
|
# Variables
|
|
|
|
Var StartMenuGroup
|
|
|
|
|
|
|
|
# Installer pages
|
|
|
|
!insertmacro MUI_PAGE_WELCOME
|
|
|
|
!insertmacro MUI_PAGE_DIRECTORY
|
|
|
|
!insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup
|
|
|
|
!insertmacro MUI_PAGE_INSTFILES
|
|
|
|
!insertmacro MUI_PAGE_FINISH
|
|
|
|
!insertmacro MUI_UNPAGE_CONFIRM
|
|
|
|
!insertmacro MUI_UNPAGE_INSTFILES
|
|
|
|
|
|
|
|
# Installer languages
|
|
|
|
!insertmacro MUI_LANGUAGE English
|
|
|
|
|
|
|
|
# Installer attributes
|
2016-02-26 01:04:48 +01:00
|
|
|
OutFile @abs_top_srcdir@/@PACKAGE_TARNAME@-${VERSION}-win@WINDOWS_BITS@-setup.exe
|
2014-01-21 12:01:37 +01:00
|
|
|
!if "@WINDOWS_BITS@" == "64"
|
2016-07-29 16:05:42 +02:00
|
|
|
InstallDir $PROGRAMFILES64\Lbrycrd
|
2014-01-21 12:01:37 +01:00
|
|
|
!else
|
2016-07-29 16:05:42 +02:00
|
|
|
InstallDir $PROGRAMFILES\Lbrycrd
|
2014-01-21 12:01:37 +01:00
|
|
|
!endif
|
2013-05-28 01:55:01 +02:00
|
|
|
CRCCheck on
|
|
|
|
XPStyle on
|
|
|
|
BrandingText " "
|
|
|
|
ShowInstDetails show
|
|
|
|
VIProductVersion ${VERSION}.@CLIENT_VERSION_BUILD@
|
2015-12-09 11:53:12 +01:00
|
|
|
VIAddVersionKey ProductName "@PACKAGE_NAME@"
|
2013-05-28 01:55:01 +02:00
|
|
|
VIAddVersionKey ProductVersion "${VERSION}"
|
|
|
|
VIAddVersionKey CompanyName "${COMPANY}"
|
|
|
|
VIAddVersionKey CompanyWebsite "${URL}"
|
|
|
|
VIAddVersionKey FileVersion "${VERSION}"
|
|
|
|
VIAddVersionKey FileDescription ""
|
|
|
|
VIAddVersionKey LegalCopyright ""
|
|
|
|
InstallDirRegKey HKCU "${REGKEY}" Path
|
|
|
|
ShowUninstDetails show
|
|
|
|
|
|
|
|
# Installer sections
|
|
|
|
Section -Main SEC0000
|
|
|
|
SetOutPath $INSTDIR
|
|
|
|
SetOverwrite on
|
2016-02-26 01:04:48 +01:00
|
|
|
File @abs_top_srcdir@/release/@BITCOIN_GUI_NAME@@EXEEXT@
|
2013-05-28 01:55:01 +02:00
|
|
|
File /oname=COPYING.txt @abs_top_srcdir@/COPYING
|
|
|
|
File /oname=readme.txt @abs_top_srcdir@/doc/README_windows.txt
|
|
|
|
SetOutPath $INSTDIR\daemon
|
2016-02-26 01:04:48 +01:00
|
|
|
File @abs_top_srcdir@/release/@BITCOIN_DAEMON_NAME@@EXEEXT@
|
|
|
|
File @abs_top_srcdir@/release/@BITCOIN_CLI_NAME@@EXEEXT@
|
2014-01-21 17:12:34 +01:00
|
|
|
SetOutPath $INSTDIR\doc
|
|
|
|
File /r @abs_top_srcdir@/doc\*.*
|
2013-05-28 01:55:01 +02:00
|
|
|
SetOutPath $INSTDIR
|
|
|
|
WriteRegStr HKCU "${REGKEY}\Components" Main 1
|
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
Section -post SEC0001
|
|
|
|
WriteRegStr HKCU "${REGKEY}" Path $INSTDIR
|
|
|
|
SetOutPath $INSTDIR
|
|
|
|
WriteUninstaller $INSTDIR\uninstall.exe
|
|
|
|
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
|
|
|
|
CreateDirectory $SMPROGRAMS\$StartMenuGroup
|
2016-02-26 01:04:48 +01:00
|
|
|
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\$(^Name).lnk" $INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@
|
2014-01-21 18:41:11 +01:00
|
|
|
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Uninstall $(^Name).lnk" $INSTDIR\uninstall.exe
|
2013-05-28 01:55:01 +02:00
|
|
|
!insertmacro MUI_STARTMENU_WRITE_END
|
|
|
|
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayName "$(^Name)"
|
|
|
|
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayVersion "${VERSION}"
|
|
|
|
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" Publisher "${COMPANY}"
|
|
|
|
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" URLInfoAbout "${URL}"
|
|
|
|
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayIcon $INSTDIR\uninstall.exe
|
|
|
|
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" UninstallString $INSTDIR\uninstall.exe
|
|
|
|
WriteRegDWORD HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoModify 1
|
|
|
|
WriteRegDWORD HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoRepair 1
|
2016-02-26 01:04:48 +01:00
|
|
|
WriteRegStr HKCR "@PACKAGE_TARNAME@" "URL Protocol" ""
|
|
|
|
WriteRegStr HKCR "@PACKAGE_TARNAME@" "" "URL:Bitcoin"
|
|
|
|
WriteRegStr HKCR "@PACKAGE_TARNAME@\DefaultIcon" "" $INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@
|
|
|
|
WriteRegStr HKCR "@PACKAGE_TARNAME@\shell\open\command" "" '"$INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@" "%1"'
|
2013-05-28 01:55:01 +02:00
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
# Macro for selecting uninstaller sections
|
|
|
|
!macro SELECT_UNSECTION SECTION_NAME UNSECTION_ID
|
|
|
|
Push $R0
|
|
|
|
ReadRegStr $R0 HKCU "${REGKEY}\Components" "${SECTION_NAME}"
|
|
|
|
StrCmp $R0 1 0 next${UNSECTION_ID}
|
|
|
|
!insertmacro SelectSection "${UNSECTION_ID}"
|
|
|
|
GoTo done${UNSECTION_ID}
|
|
|
|
next${UNSECTION_ID}:
|
|
|
|
!insertmacro UnselectSection "${UNSECTION_ID}"
|
|
|
|
done${UNSECTION_ID}:
|
|
|
|
Pop $R0
|
|
|
|
!macroend
|
|
|
|
|
|
|
|
# Uninstaller sections
|
|
|
|
Section /o -un.Main UNSEC0000
|
2016-02-26 01:04:48 +01:00
|
|
|
Delete /REBOOTOK $INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@
|
2013-05-28 01:55:01 +02:00
|
|
|
Delete /REBOOTOK $INSTDIR\COPYING.txt
|
|
|
|
Delete /REBOOTOK $INSTDIR\readme.txt
|
|
|
|
RMDir /r /REBOOTOK $INSTDIR\daemon
|
2014-01-21 17:12:34 +01:00
|
|
|
RMDir /r /REBOOTOK $INSTDIR\doc
|
2013-05-28 01:55:01 +02:00
|
|
|
DeleteRegValue HKCU "${REGKEY}\Components" Main
|
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
Section -un.post UNSEC0001
|
|
|
|
DeleteRegKey HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)"
|
2014-01-21 18:41:11 +01:00
|
|
|
Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Uninstall $(^Name).lnk"
|
|
|
|
Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\$(^Name).lnk"
|
2013-05-28 01:55:01 +02:00
|
|
|
Delete /REBOOTOK "$SMSTARTUP\Bitcoin.lnk"
|
|
|
|
Delete /REBOOTOK $INSTDIR\uninstall.exe
|
|
|
|
Delete /REBOOTOK $INSTDIR\debug.log
|
|
|
|
Delete /REBOOTOK $INSTDIR\db.log
|
|
|
|
DeleteRegValue HKCU "${REGKEY}" StartMenuGroup
|
|
|
|
DeleteRegValue HKCU "${REGKEY}" Path
|
|
|
|
DeleteRegKey /IfEmpty HKCU "${REGKEY}\Components"
|
|
|
|
DeleteRegKey /IfEmpty HKCU "${REGKEY}"
|
2016-02-26 01:04:48 +01:00
|
|
|
DeleteRegKey HKCR "@PACKAGE_TARNAME@"
|
2013-05-28 01:55:01 +02:00
|
|
|
RmDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup
|
|
|
|
RmDir /REBOOTOK $INSTDIR
|
|
|
|
Push $R0
|
|
|
|
StrCpy $R0 $StartMenuGroup 1
|
|
|
|
StrCmp $R0 ">" no_smgroup
|
|
|
|
no_smgroup:
|
|
|
|
Pop $R0
|
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
# Installer functions
|
|
|
|
Function .onInit
|
|
|
|
InitPluginsDir
|
2014-01-21 12:01:37 +01:00
|
|
|
!if "@WINDOWS_BITS@" == "64"
|
|
|
|
${If} ${RunningX64}
|
|
|
|
; disable registry redirection (enable access to 64-bit portion of registry)
|
|
|
|
SetRegView 64
|
|
|
|
${Else}
|
|
|
|
MessageBox MB_OK|MB_ICONSTOP "Cannot install 64-bit version on a 32-bit system."
|
|
|
|
Abort
|
|
|
|
${EndIf}
|
|
|
|
!endif
|
2013-05-28 01:55:01 +02:00
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
# Uninstaller functions
|
|
|
|
Function un.onInit
|
|
|
|
ReadRegStr $INSTDIR HKCU "${REGKEY}" Path
|
|
|
|
!insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuGroup
|
|
|
|
!insertmacro SELECT_UNSECTION Main ${UNSEC0000}
|
|
|
|
FunctionEnd
|