pw3270.nsi.in
6.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
!include "MUI2.nsh"
!include "x64.nsh"
!include "FileFunc.nsh"
Name "@PACKAGE@"
Caption "@PACKAGE@ - @PACKAGE_DESCRIPTION@"
!ifdef WITHGTK
outfile "@PACKAGE@-@PACKAGE_VERSION@-gtk-@GTK_MODVERSION@-@host_cpu@.exe"
!else
outfile "@PACKAGE@-@PACKAGE_VERSION@-requires-gtk-@GTK_MODVERSION@-@host_cpu@.exe"
!endif
XPStyle on
installDir "$@PROGRAMFILES@\@PACKAGE@"
#define the installer icon
!define MUI_ICON "@PACKAGE@.ico"
!define MUI_UNICON "@PACKAGE@.ico"
icon "@PACKAGE@.ico"
# Get installation folder from registry if available
InstallDirRegKey HKLM "Software\@PACKAGE@" "InstallLocation"
RequestExecutionLevel admin
# Properties
VIProductVersion "@PACKAGE_MAJOR_VERSION@.@PACKAGE_MINOR_VERSION@.@PACKAGE_MAJOR_RELEASE@.0"
VIFileVersion "@WIN32_VERSION@"
VIAddVersionKey "ProductVersion" "@PACKAGE_MAJOR_VERSION@.@PACKAGE_MINOR_VERSION@.@PACKAGE_MAJOR_RELEASE@.0"
VIAddVersionKey "FileVersion" "@WIN32_VERSION@"
VIAddVersionKey "ProductName" "sisbb"
VIAddVersionKey "FileDescription" "@PACKAGE_DESCRIPTION@"
VIAddVersionKey "LegalCopyright" "GPL-2.0"
# Interface
!define MUI_ABORTWARNING
# !insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "LICENSE"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
# !insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
# !insertmacro MUI_UNPAGE_FINISH
# Languages
!insertmacro MUI_LANGUAGE "English"
# Section scripts
!include Sections.nsh
# default section
SubSection "@PACKAGE@" SecMain
Section "Core" SecCore
SetRegView @WINARCH@
${DisableX64FSRedirection}
# define the output path for this file
setOutPath $INSTDIR
SetShellVarContext all
createShortCut "$SMPROGRAMS\@PACKAGE@.lnk" "$INSTDIR\@PACKAGE@.exe"
createShortCut "$DESKTOP\@PACKAGE@.lnk" "$INSTDIR\@PACKAGE@.exe"
# Binary files
file "/oname=$INSTDIR\@PACKAGE@.exe" "bin\@PACKAGE@.exe"
file "/oname=$INSTDIR\@PACKAGE@.ico" "@PACKAGE@.ico"
file "/oname=$INSTDIR\lib3270.dll.@PACKAGE_VERSION@" "bin\lib3270.dll.@PACKAGE_VERSION@"
file "/oname=$INSTDIR\@PACKAGE@.dll.@PACKAGE_VERSION@" "bin\@PACKAGE@.dll.@PACKAGE_VERSION@"
# Configuration files
file "/oname=$INSTDIR\@PACKAGE@-logo.png" "@PACKAGE@-logo.png"
file "/oname=$INSTDIR\@PACKAGE@.png" "@PACKAGE@.png"
file "/oname=$INSTDIR\colors.conf" "colors.conf"
# Documentation files
file "/oname=$INSTDIR\AUTHORS" "AUTHORS"
file "/oname=$INSTDIR\LICENSE" "LICENSE"
# Misc folders
CreateDirectory "$INSTDIR\certs"
CreateDirectory "$INSTDIR\plugins"
# UI definition files
CreateDirectory "$INSTDIR\ui"
file "/oname=$INSTDIR\ui\00default.xml" "ui\00default.xml"
# Charset definition files
CreateDirectory "$INSTDIR\charsets"
file "/oname=$INSTDIR\charsets\bracket.xml" "bracket.xml"
# Locale files
CreateDirectory "$INSTDIR\locale\pt_BR\LC_MESSAGES"
file "/oname=$INSTDIR\locale\pt_BR\LC_MESSAGES\@PACKAGE@.mo" "locale\pt_BR\LC_MESSAGES\@PACKAGE@.mo"
# Save DataDir
SetRegView @WINARCH@
WriteRegStr HKLM "Software\@PACKAGE@" "datadir" "$INSTDIR"
WriteRegStr HKLM "Software\@PACKAGE@" "appName" "$INSTDIR\@PACKAGE@.exe"
# define uninstaller name
SetRegView 32
writeUninstaller $INSTDIR\uninstall.exe
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PACKAGE@" \
"DisplayName" "@PACKAGE@ - @PACKAGE_DESCRIPTION@"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PACKAGE@" \
"DisplayIcon" "$INSTDIR\@PACKAGE@.ico"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PACKAGE@" \
"DisplayVersion" "@PACKAGE_VERSION@"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PACKAGE@" \
"UninstallString" "$INSTDIR\uninstall.exe"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PACKAGE@" \
"InstallLocation" "$INSTDIR"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PACKAGE@" \
"NoModify" "1"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PACKAGE@" \
"NoRepair" "1"
# Save instalation dir
WriteRegStr HKCU "Software\@PACKAGE@" "" $INSTDIR
sectionEnd
SubSection "Plugins" SecPLugin
Section /o "HLLAPI" HLLAPIPlugin
setOutPath $INSTDIR
${DisableX64FSRedirection}
CreateDirectory "$INSTDIR\plugins"
file "/oname=$INSTDIR\plugins\ipc3270c.dll" "bin\ipc3270c.dll"
${EnableX64FSRedirection}
file "/oname=$SYSDIR\libhllapi.dll" "bin\libhllapi.dll"
sectionEnd
SubSectionEnd
SubSection "Menus, Keypads & Toolbars" SecMenu
Section "Keypad" KeypadMenu
file "/oname=$INSTDIR\ui\10keypad.xml" "ui\10keypad.xml"
sectionEnd
Section "Functions" FunctionsMenu
file "/oname=$INSTDIR\ui\10functions.xml" "ui\10functions.xml"
sectionEnd
Section /o "View trace Menu" TraceMenu
file "/oname=$INSTDIR\ui\98trace.xml" "ui\98trace.xml"
sectionEnd
Section /o "Application debug" DBGMenu
file "/oname=$INSTDIR\ui\99debug.xml" "ui\99debug.xml"
sectionEnd
SubSectionEnd
SubSectionEnd
!ifdef WITHGTK
Section /o "GTK+ Runtime" SecGTK
setOutPath $INSTDIR
file /r "bin\runtime\*.*"
SectionEnd
!endif
Section "Uninstall"
# Always delete uninstaller first
delete $INSTDIR\uninstaller.exe
# Set SMPROGRAMS and DESKTOP path
SetShellVarContext all
# now delete installed files
delete $INSTDIR\@PACKAGE@.exe
delete $SMPROGRAMS\@PACKAGE@.lnk
delete $DESKTOP\@PACKAGE@.lnk
RMDir /r "$INSTDIR\locale"
RMDir /r "$INSTDIR\share"
RMDir /r "$INSTDIR\etc"
RMDir /r "$INSTDIR\plugins"
RMDir /r "$INSTDIR\sdk"
RMDir /r "$INSTDIR\gtk2-runtime"
# Delete all files
delete "$INSTDIR\*.dll"
# Remove registry
SetRegView 32
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PACKAGE@"
DeleteRegKey HKLM "Software\@PACKAGE@"
SetRegView @WINARCH@
DeleteRegKey HKLM "Software\@PACKAGE@"
# Delete System libraries
delete $SYSDIR\libhllapi.dll
RMDir /r "$INSTDIR"
SectionEnd
Function .onInit
#---[ Verifica opção de instalação HLLAPI ]----------------------------------------------------------
Push $0
${GetParameters} $R0
ClearErrors
${GetOptions} $R0 /HLLAPI= $0
${if} $0 == "NO"
SectionGetFlags ${HLLAPIPlugin} $0
IntOp $0 $0 & ${SECTION_OFF}
SectionSetFlags ${HLLAPIPlugin} $0
${else}
SectionGetFlags ${HLLAPIPlugin} $0
IntOp $0 $0 | ${SF_SELECTED}
SectionSetFlags ${HLLAPIPlugin} $0
${EndIf}
Pop $0
!ifdef WITHGTK
#---[ Verifica se precisa instalar GTK ]-------------------------------------------------------------
SetRegView @WINARCH@
ReadRegStr $4 HKLM "Software\gtkwin\@GTK_MODVERSION@" "path"
${if} $4 == ""
SectionGetFlags ${SecGTK} $0
IntOp $0 $0 | ${SF_SELECTED}
SectionSetFlags ${SecGTK} $0
${Else}
${if} ${FileExists} `$4\*.*`
SectionGetFlags ${SecGTK} $0
IntOp $0 $0 & ${SECTION_OFF}
SectionSetFlags ${SecGTK} $0
${Else}
SectionGetFlags ${SecGTK} $0
IntOp $0 $0 | ${SF_SELECTED}
SectionSetFlags ${SecGTK} $0
${EndIf}
${EndIf}
!endif
FunctionEnd