Statistics
| Revision:

root / trunk / nntpgrab.nsi @ 1916

History | View | Annotate | Download (6.2 KB)

1
; nntpgrab.nsi
2
;
3

                
4
;!include "MUI.nsh"
5
;!include "Sections.nsh"
6
!include "registerExtension.nsh"
7

                
8
;--------------------------------
9

                
10
; The name of the installer
11
Name "NNTPGrab"
12

                
13
; The file to write
14
OutFile "nntpgrab_trunk_snapshot_svn_r@VER@_setup.exe"
15

                
16
; The default installation directory
17
InstallDir $PROGRAMFILES\NNTPGrab
18

                
19
; Registry key to check for directory (so if you install again, it will 
20
; overwrite the old one automatically)
21
InstallDirRegKey HKLM "Software\NNTPGrab" "Install_Dir"
22

                
23
; Best compression
24
SetCompressor lzma
25
 
26
;--------------------------------
27

                
28
; Check if the program is running
29
!define WNDCLASS "gdkWindowTopLevel"
30
!define WNDTITLE "NNTPGrab"
31

                
32
Function .onInit
33
  FindWindow $0 "${WNDCLASS}" "${WNDTITLE}"
34
  StrCmp $0 0 continueInstall
35
    MessageBox MB_ICONSTOP|MB_OK "The installation cannot continue because NNTPGrab is still running. Please close NNTPGrab and try again."
36
    Abort
37
  continueInstall:
38
FunctionEnd
39

                
40
;--------------------------------
41

                
42
; Pages
43

                
44
LicenseData "COPYING"
45
Page license
46
Page components
47
Page directory
48
Page instfiles
49

                
50
UninstPage uninstConfirm
51
UninstPage instfiles
52

                
53
;--------------------------------
54

                
55
; The stuff to install
56
Section "NNTPGrab (required)"
57

                
58
  SectionIn RO
59
  
60
  SetOutPath $INSTDIR\bin
61
  File "dist\bin\exchndl.dll"
62
  File "dist\bin\gspawn-win32-helper.exe"
63
  File "dist\bin\gspawn-win32-helper-console.exe"
64
  File "dist\bin\libffi-6.dll"
65
  File "dist\bin\libgcc_s_sjlj-1.dll"
66
  File "dist\bin\libgio-2.0-0.dll"
67
  File "dist\bin\libglib-2.0-0.dll"
68
  File "dist\bin\libgmodule-2.0-0.dll"
69
  File "dist\bin\libgobject-2.0-0.dll"
70
  File "dist\bin\libgthread-2.0-0.dll"
71
  File "dist\bin\iconv.dll"
72
  File "dist\bin\libintl-8.dll"
73
  File "dist\bin\libnntpgrab_automation-0.dll"
74
  File "dist\bin\libnntpgrab_utils-0.dll"
75
  File "dist\bin\libnntpgrab_glue-0.dll"
76
  File "dist\bin\libnntpgrab-0.dll"
77
  File "dist\bin\libpng15-15.dll"
78
  File "dist\bin\libproxy.dll"
79
  File "dist\bin\QtCore4.dll"
80
  File "dist\bin\QtNetwork4.dll"
81
  File "dist\bin\QtGui4.dll"
82
  File "dist\bin\libsoup-2.4-1.dll"
83
  File "dist\bin\libxml2-2.dll"
84
  File "dist\bin\libstdc++-6.dll"
85
  File "dist\bin\nntpgrab_gui.exe"
86
  File "dist\bin\nntpgrab_gui_debug.exe"
87
  File "dist\bin\nntpgrab_server.exe"
88
  File "dist\bin\nntpgrab_server_qt.exe"
89
  File "dist\bin\par2.exe"
90
  File "dist\bin\UnRAR.exe"
91
  File "dist\bin\zlib1.dll"
92
  File "client\gui\nntpgrab.ico"
93

                
94
  # Start GnuTLS libraries
95
  File "dist\bin\libgpg-error-0.dll"
96
  File "dist\bin\libgcrypt-11.dll"
97
  File "dist\bin\libp11-kit-0.dll"
98
  File "dist\bin\libgnutls-26.dll"
99

                
100
  # Start GIO TLS module
101
  SetOutPath $INSTDIR\lib\gio\modules
102
  File "dist\lib\gio\modules\giomodule.cache"
103
  File "dist\lib\gio\modules\libgiognutls.dll"
104

                
105
  SetOutPath $INSTDIR\lib\nntpgrab
106
  File "dist\lib\nntpgrab\*.dll"
107

                
108
  SetOutPath $INSTDIR\share\nntpgrab\translations
109
  File "dist\share\nntpgrab\translations\*.qm"
110

                
111
  SetOutPath $INSTDIR\share\locale\nl\LC_MESSAGES
112
  File "dist\share\locale\nl\LC_MESSAGES\*.mo"
113

                
114
  ; Write the installation path into the registry
115
  WriteRegStr HKLM SOFTWARE\NNTPGrab "Install_Dir" "$INSTDIR"
116
  
117
  ; Write the uninstall keys for Windows
118
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NNTPGrab" "DisplayName" "NNTPGrab"
119
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NNTPGrab" "UninstallString" '"$INSTDIR\uninstall.exe"'
120
  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NNTPGrab" "NoModify" 1
121
  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NNTPGrab" "NoRepair" 1
122
  WriteUninstaller "uninstall.exe"
123

                
124
  SetOutPath $INSTDIR\bin
125
  CreateDirectory "$SMPROGRAMS\NNTPGrab"
126
;  CreateShortCut "$SMPROGRAMS\NNTPGrab\License.lnk" "$INSTDIR\COPYING.txt" "" "$INSTDIR\COPYING.txt" 0
127
  CreateShortCut "$SMPROGRAMS\NNTPGrab\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
128
  CreateShortCut "$SMPROGRAMS\NNTPGrab\NNTPGrab.lnk" "$INSTDIR\bin\nntpgrab_gui.exe" "" "$INSTDIR\bin\nntpgrab.ico" 0
129
  CreateShortCut "$SMPROGRAMS\NNTPGrab\NNTPGrab Server.lnk" "$INSTDIR\bin\nntpgrab_server_qt.exe" "" "$INSTDIR\bin\nntpgrab.ico" 0
130
  
131
SectionEnd
132

                
133
Section ".NZB File association"
134

                
135
  ${registerExtension} "$INSTDIR\bin\nntpgrab_gui.exe" ".nzb" "NNTPGrab"
136

                
137
SectionEnd
138

                
139
Section "Webinterface"
140

                
141
  SetOutPath $INSTDIR\webinterface
142
  File "plugins\jsonrpc\web\*.html"
143

                
144
  SetOutPath $INSTDIR\webinterface\css
145
  File "plugins\jsonrpc\web\css\*.css"
146

                
147
  SetOutPath $INSTDIR\webinterface\css\images
148
  File "plugins\jsonrpc\web\css\images\*.png"
149

                
150
  SetOutPath $INSTDIR\webinterface\javascript
151
  File "plugins\jsonrpc\web\javascript\*.js"
152

                
153
SectionEnd
154

                
155
;--------------------------------
156

                
157
; Uninstaller
158

                
159
Section "Uninstall"
160
  
161
  ; Remove registry keys
162
  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NNTPGrab"
163
  DeleteRegKey HKLM SOFTWARE\NNTPGrab
164

                
165
  ; Remove files and uninstaller
166
  Delete $INSTDIR\webinterface\javascript\*.*
167
  RMDir  $INSTDIR\webinterface\javascript
168
  Delete $INSTDIR\webinterface\css\images\*.*
169
  RMDir  $INSTDIR\webinterface\css\images
170
  Delete $INSTDIR\webinterface\css\*.*
171
  RMDir  $INSTDIR\webinterface\css
172
  Delete $INSTDIR\webinterface\*.*
173
  RMDir  $INSTDIR\webinterface
174
  Delete $INSTDIR\share\locale\nl\LC_MESSAGES\*.*
175
  RMDir  $INSTDIR\share\locale\nl\LC_MESSAGES
176
  Delete $INSTDIR\share\locale\nl\*.*
177
  RMDir  $INSTDIR\share\locale\nl
178
  Delete $INSTDIR\share\locale\*.*
179
  RMDir  $INSTDIR\share\locale
180
  Delete $INSTDIR\share\nntpgrab\translations\*.*
181
  RMDir  $INSTDIR\share\nntpgrab\translations
182
  Delete $INSTDIR\share\nntpgrab\*.*
183
  RMDir  $INSTDIR\share\nntpgrab
184
  RMDir  $INSTDIR\share
185

                
186
  Delete $INSTDIR\lib\nntpgrab\*.*
187
  RMDir  $INSTDIR\lib\nntpgrab
188
  Delete $INSTDIR\lib\gio\modules\*.*
189
  RMDir  $INSTDIR\lib\gio\modules
190
  RMDir  $INSTDIR\lib\gio
191
  Delete $INSTDIR\lib\*.*
192
  RMDir  $INSTDIR\lib
193

                
194
  Delete $INSTDIR\bin\*.*
195
  RMDir  $INSTDIR\bin
196

                
197
  Delete $INSTDIR\*.*
198
  RMDir  $INSTDIR
199

                
200
  ; Remove shortcuts, if any
201
  Delete "$SMPROGRAMS\NNTPGrab\*.*"
202

                
203
  ; Remove directories used
204
  RMDir "$SMPROGRAMS\NNTPGrab"
205
  RMDir "$INSTDIR"
206

                
207
  ; Delete file associations
208
  ${unregisterExtension} ".nzb" "NZB File"
209
SectionEnd