Linux/Wine based build scripts for Windows executables and installer
[electrum-nvc.git] / contrib / build-wine / electrum.nsis
1 ; -------------------------------
2 ; Start
3  
4  
5   !define MUI_PRODUCT "Electrum"
6   !define MUI_FILE "electrum"
7   !define MUI_VERSION ""
8   !define MUI_BRANDINGTEXT "Electrum"
9   CRCCheck On
10  
11   !include "${NSISDIR}\Contrib\Modern UI\System.nsh"
12  
13  
14 ;--------------------------------
15 ;General
16  
17   OutFile "dist\electrum-setup.exe"
18   ShowInstDetails "nevershow"
19   ShowUninstDetails "nevershow"
20   ;SetCompressor "lzma"
21  
22   ;!define MUI_ICON "icon.ico"
23   ;!define MUI_UNICON "icon.ico"
24   ;!define MUI_SPECIALBITMAP "Bitmap.bmp"
25  
26  
27 ;--------------------------------
28 ;Folder selection page
29  
30   InstallDir "$PROGRAMFILES\${MUI_PRODUCT}"
31  
32  
33 ;--------------------------------
34 ;Modern UI Configuration
35  
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  
43  
44  
45 ;--------------------------------
46 ;Language
47  
48   !insertmacro MUI_LANGUAGE "English"
49  
50  
51 ;-------------------------------- 
52 ;Modern UI System
53  
54   ;!insertmacro MUI_SYSTEM 
55  
56  
57 ;--------------------------------
58 ;Data
59  
60   LicenseData "license.txt"
61  
62  
63 ;-------------------------------- 
64 ;Installer Sections     
65 Section "install" ;Installation info
66  
67 ;Add files
68   SetOutPath "$INSTDIR"
69  
70   ;File "${MUI_FILE}.exe"
71   ;File "${MUI_FILE}.ini"
72   ;File "license.txt"
73   SetOutPath "$INSTDIR"  
74   file /r dist\electrum\*.*
75  
76 ;create desktop shortcut
77   CreateShortCut "$DESKTOP\${MUI_PRODUCT}.lnk" "$INSTDIR\${MUI_FILE}.exe" ""
78  
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
83  
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"
87  
88   WriteUninstaller "$INSTDIR\Uninstall.exe"
89  
90 SectionEnd
91  
92  
93 ;--------------------------------    
94 ;Uninstaller Section  
95 Section "Uninstall"
96  
97 ;Delete Files 
98   RMDir /r "$INSTDIR\*.*"    
99  
100 ;Remove the installation directory
101   RMDir "$INSTDIR"
102  
103 ;Delete Start Menu Shortcuts
104   Delete "$DESKTOP\${MUI_PRODUCT}.lnk"
105   Delete "$SMPROGRAMS\${MUI_PRODUCT}\*.*"
106   RmDir  "$SMPROGRAMS\${MUI_PRODUCT}"
107  
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}"  
111  
112 SectionEnd
113  
114  
115 ;--------------------------------    
116 ;MessageBox Section
117  
118  
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."
122 FunctionEnd
123  
124  
125 Function un.onUninstSuccess
126   MessageBox MB_OK "You have successfully uninstalled ${MUI_PRODUCT}."
127 FunctionEnd
128  
129 ;eof