mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-01 09:45:18 +00:00
Improved installer script
This commit is contained in:
parent
35838b0884
commit
e96f75b978
1 changed files with 91 additions and 116 deletions
|
@ -1,129 +1,104 @@
|
||||||
; -------------------------------
|
;--------------------------------
|
||||||
; Start
|
;Include Modern UI
|
||||||
|
|
||||||
|
!include "MUI2.nsh"
|
||||||
!define MUI_PRODUCT "Electrum"
|
|
||||||
!define MUI_FILE "electrum"
|
|
||||||
!define MUI_VERSION ""
|
|
||||||
!define MUI_BRANDINGTEXT "Electrum"
|
|
||||||
CRCCheck On
|
|
||||||
|
|
||||||
!include "${NSISDIR}\Contrib\Modern UI\System.nsh"
|
|
||||||
|
|
||||||
|
|
||||||
;--------------------------------
|
;--------------------------------
|
||||||
;General
|
;General
|
||||||
|
|
||||||
OutFile "dist\electrum-setup.exe"
|
;Name and file
|
||||||
ShowInstDetails "nevershow"
|
Name "Electrum"
|
||||||
ShowUninstDetails "nevershow"
|
OutFile "dist/electrum-setup.exe"
|
||||||
;SetCompressor "lzma"
|
|
||||||
|
;Default installation folder
|
||||||
;!define MUI_ICON "icon.ico"
|
InstallDir "$PROGRAMFILES\Electrum"
|
||||||
;!define MUI_UNICON "icon.ico"
|
|
||||||
;!define MUI_SPECIALBITMAP "Bitmap.bmp"
|
;Get installation folder from registry if available
|
||||||
|
InstallDirRegKey HKCU "Software\Electrum" ""
|
||||||
|
|
||||||
|
;Request application privileges for Windows Vista
|
||||||
|
RequestExecutionLevel user
|
||||||
|
|
||||||
;--------------------------------
|
;--------------------------------
|
||||||
;Folder selection page
|
;Variables
|
||||||
|
|
||||||
InstallDir "$PROGRAMFILES\${MUI_PRODUCT}"
|
|
||||||
|
|
||||||
|
|
||||||
;--------------------------------
|
;--------------------------------
|
||||||
;Modern UI Configuration
|
;Interface Settings
|
||||||
|
|
||||||
!define MUI_WELCOMEPAGE
|
|
||||||
!define MUI_LICENSEPAGE
|
|
||||||
!define MUI_DIRECTORYPAGE
|
|
||||||
!define MUI_ABORTWARNING
|
!define MUI_ABORTWARNING
|
||||||
!define MUI_UNINSTALLER
|
|
||||||
!define MUI_UNCONFIRMPAGE
|
|
||||||
!define MUI_FINISHPAGE
|
|
||||||
|
|
||||||
|
|
||||||
;--------------------------------
|
;--------------------------------
|
||||||
;Language
|
;Pages
|
||||||
|
|
||||||
|
!insertmacro MUI_PAGE_LICENSE "tmp/electrum/LICENCE"
|
||||||
|
;!insertmacro MUI_PAGE_COMPONENTS
|
||||||
|
!insertmacro MUI_PAGE_DIRECTORY
|
||||||
|
|
||||||
|
;Start Menu Folder Page Configuration
|
||||||
|
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU"
|
||||||
|
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\Electrum"
|
||||||
|
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
|
||||||
|
|
||||||
|
;!insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder
|
||||||
|
|
||||||
|
!insertmacro MUI_PAGE_INSTFILES
|
||||||
|
|
||||||
|
!insertmacro MUI_UNPAGE_CONFIRM
|
||||||
|
!insertmacro MUI_UNPAGE_INSTFILES
|
||||||
|
|
||||||
|
;--------------------------------
|
||||||
|
;Languages
|
||||||
|
|
||||||
!insertmacro MUI_LANGUAGE "English"
|
!insertmacro MUI_LANGUAGE "English"
|
||||||
|
|
||||||
|
;--------------------------------
|
||||||
;--------------------------------
|
;Installer Sections
|
||||||
;Modern UI System
|
|
||||||
|
Section
|
||||||
;!insertmacro MUI_SYSTEM
|
|
||||||
|
SetOutPath "$INSTDIR"
|
||||||
|
|
||||||
|
;ADD YOUR OWN FILES HERE...
|
||||||
|
file /r dist\electrum\*.*
|
||||||
|
|
||||||
|
;Store installation folder
|
||||||
|
WriteRegStr HKCU "Software\Electrum" "" $INSTDIR
|
||||||
|
|
||||||
|
;Create uninstaller
|
||||||
|
WriteUninstaller "$INSTDIR\Uninstall.exe"
|
||||||
|
|
||||||
|
|
||||||
|
CreateShortCut "$DESKTOP\Electrum.lnk" "$INSTDIR\electrum.exe" ""
|
||||||
|
|
||||||
|
;create start-menu items
|
||||||
|
CreateDirectory "$SMPROGRAMS\Electrum"
|
||||||
|
CreateShortCut "$SMPROGRAMS\Electrum\Uninstall.lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0
|
||||||
|
CreateShortCut "$SMPROGRAMS\Electrum\Electrum.lnk" "$INSTDIR\electrum.exe" "" "$INSTDIR\electrum.exe" 0
|
||||||
|
|
||||||
|
SectionEnd
|
||||||
|
|
||||||
|
;--------------------------------
|
||||||
|
;Descriptions
|
||||||
|
|
||||||
|
;Assign language strings to sections
|
||||||
|
;!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
|
||||||
|
; !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy)
|
||||||
|
;!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
||||||
|
|
||||||
;--------------------------------
|
;--------------------------------
|
||||||
;Data
|
;Uninstaller Section
|
||||||
|
|
||||||
;LicenseData "license.txt"
|
|
||||||
|
|
||||||
|
|
||||||
;--------------------------------
|
|
||||||
;Installer Sections
|
|
||||||
Section "install" ;Installation info
|
|
||||||
|
|
||||||
;Add files
|
|
||||||
SetOutPath "$INSTDIR"
|
|
||||||
|
|
||||||
;File "${MUI_FILE}.exe"
|
|
||||||
;File "${MUI_FILE}.ini"
|
|
||||||
;File "license.txt"
|
|
||||||
SetOutPath "$INSTDIR"
|
|
||||||
file /r dist\electrum\*.*
|
|
||||||
|
|
||||||
;create desktop shortcut
|
|
||||||
CreateShortCut "$DESKTOP\${MUI_PRODUCT}.lnk" "$INSTDIR\${MUI_FILE}.exe" ""
|
|
||||||
|
|
||||||
;create start-menu items
|
|
||||||
CreateDirectory "$SMPROGRAMS\${MUI_PRODUCT}"
|
|
||||||
CreateShortCut "$SMPROGRAMS\${MUI_PRODUCT}\Uninstall.lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0
|
|
||||||
CreateShortCut "$SMPROGRAMS\${MUI_PRODUCT}\${MUI_PRODUCT}.lnk" "$INSTDIR\${MUI_FILE}.exe" "" "$INSTDIR\${MUI_FILE}.exe" 0
|
|
||||||
|
|
||||||
;write uninstall information to the registry
|
|
||||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}" "DisplayName" "${MUI_PRODUCT} (remove only)"
|
|
||||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}" "UninstallString" "$INSTDIR\Uninstall.exe"
|
|
||||||
|
|
||||||
WriteUninstaller "$INSTDIR\Uninstall.exe"
|
|
||||||
|
|
||||||
SectionEnd
|
|
||||||
|
|
||||||
|
|
||||||
;--------------------------------
|
|
||||||
;Uninstaller Section
|
|
||||||
Section "Uninstall"
|
Section "Uninstall"
|
||||||
|
|
||||||
;Delete Files
|
;ADD YOUR OWN FILES HERE...
|
||||||
RMDir /r "$INSTDIR\*.*"
|
RMDir /r "$INSTDIR\*.*"
|
||||||
|
|
||||||
;Remove the installation directory
|
|
||||||
RMDir "$INSTDIR"
|
RMDir "$INSTDIR"
|
||||||
|
|
||||||
;Delete Start Menu Shortcuts
|
Delete "$DESKTOP\Electrum.lnk"
|
||||||
Delete "$DESKTOP\${MUI_PRODUCT}.lnk"
|
Delete "$SMPROGRAMS\Electrum\*.*"
|
||||||
Delete "$SMPROGRAMS\${MUI_PRODUCT}\*.*"
|
RmDir "$SMPROGRAMS\Electrum"
|
||||||
RmDir "$SMPROGRAMS\${MUI_PRODUCT}"
|
|
||||||
|
DeleteRegKey /ifempty HKCU "Software\Electrum"
|
||||||
;Delete Uninstaller And Unistall Registry Entries
|
|
||||||
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\${MUI_PRODUCT}"
|
|
||||||
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}"
|
|
||||||
|
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
|
|
||||||
;--------------------------------
|
|
||||||
;MessageBox Section
|
|
||||||
|
|
||||||
|
|
||||||
;Function that calls a messagebox when installation finished correctly
|
|
||||||
Function .onInstSuccess
|
|
||||||
MessageBox MB_OK "You have successfully installed ${MUI_PRODUCT}. Use the desktop icon to start the program."
|
|
||||||
FunctionEnd
|
|
||||||
|
|
||||||
|
|
||||||
Function un.onUninstSuccess
|
|
||||||
MessageBox MB_OK "You have successfully uninstalled ${MUI_PRODUCT}."
|
|
||||||
FunctionEnd
|
|
||||||
|
|
||||||
;eof
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue