1 ; -------------------------------
5 !define MUI_PRODUCT "Electrum"
6 !define MUI_FILE "electrum"
8 !define MUI_BRANDINGTEXT "Electrum"
11 !include "${NSISDIR}\Contrib\Modern UI\System.nsh"
14 ;--------------------------------
17 OutFile "dist\electrum-setup.exe"
18 ShowInstDetails "nevershow"
19 ShowUninstDetails "nevershow"
22 ;!define MUI_ICON "icon.ico"
23 ;!define MUI_UNICON "icon.ico"
24 ;!define MUI_SPECIALBITMAP "Bitmap.bmp"
27 ;--------------------------------
28 ;Folder selection page
30 InstallDir "$PROGRAMFILES\${MUI_PRODUCT}"
33 ;--------------------------------
34 ;Modern UI Configuration
36 !define MUI_WELCOMEPAGE
37 !define MUI_LICENSEPAGE
38 !define MUI_DIRECTORYPAGE
39 !define MUI_ABORTWARNING
40 !define MUI_UNINSTALLER
41 !define MUI_UNCONFIRMPAGE
42 !define MUI_FINISHPAGE
45 ;--------------------------------
48 !insertmacro MUI_LANGUAGE "English"
51 ;--------------------------------
54 ;!insertmacro MUI_SYSTEM
57 ;--------------------------------
60 ;LicenseData "license.txt"
63 ;--------------------------------
65 Section "install" ;Installation info
70 ;File "${MUI_FILE}.exe"
71 ;File "${MUI_FILE}.ini"
74 file /r dist\electrum\*.*
76 ;create desktop shortcut
77 CreateShortCut "$DESKTOP\${MUI_PRODUCT}.lnk" "$INSTDIR\${MUI_FILE}.exe" ""
79 ;create start-menu items
80 CreateDirectory "$SMPROGRAMS\${MUI_PRODUCT}"
81 CreateShortCut "$SMPROGRAMS\${MUI_PRODUCT}\Uninstall.lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0
82 CreateShortCut "$SMPROGRAMS\${MUI_PRODUCT}\${MUI_PRODUCT}.lnk" "$INSTDIR\${MUI_FILE}.exe" "" "$INSTDIR\${MUI_FILE}.exe" 0
84 ;write uninstall information to the registry
85 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}" "DisplayName" "${MUI_PRODUCT} (remove only)"
86 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}" "UninstallString" "$INSTDIR\Uninstall.exe"
88 WriteUninstaller "$INSTDIR\Uninstall.exe"
93 ;--------------------------------
98 RMDir /r "$INSTDIR\*.*"
100 ;Remove the installation directory
103 ;Delete Start Menu Shortcuts
104 Delete "$DESKTOP\${MUI_PRODUCT}.lnk"
105 Delete "$SMPROGRAMS\${MUI_PRODUCT}\*.*"
106 RmDir "$SMPROGRAMS\${MUI_PRODUCT}"
108 ;Delete Uninstaller And Unistall Registry Entries
109 DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\${MUI_PRODUCT}"
110 DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}"
115 ;--------------------------------
119 ;Function that calls a messagebox when installation finished correctly
120 Function .onInstSuccess
121 MessageBox MB_OK "You have successfully installed ${MUI_PRODUCT}. Use the desktop icon to start the program."
125 Function un.onUninstSuccess
126 MessageBox MB_OK "You have successfully uninstalled ${MUI_PRODUCT}."