Annotation of win32/dist.x64/parser_mui_en.nsi, revision 1.3
1.1 moko 1: ; parser.nsi
2: ;
3:
4: !include "MUI.nsh"
5: !include "Library.nsh"
6:
7: ;--------------------------------
8: ; Configuration
9:
1.3 ! moko 10: !define VER_FILE "3_4_6x64"
! 11: !define VER_DISPLAY "3.4.6x64"
1.1 moko 12: !define VER_LANG "en"
13: !define UNINSTALL_PATH "Software\Microsoft\Windows\CurrentVersion\Uninstall\Parser 3"
14:
15: ; General
16: Name "Parser ${VER_DISPLAY}"
17: Caption "Parser ${VER_DISPLAY}"
18:
19: SetCompressor /SOLID lzma
20: SetOverwrite ifnewer
21: CRCCheck on
22: AllowRootDirInstall false
23: SetDatablockOptimize on
24: SetDateSave on
25:
26: ; The file to write
27: OutFile "parser${VER_FILE}_${VER_LANG}.exe"
28:
29: !define MUI_HEADERIMAGE
30: !define MUI_HEADERIMAGE_BITMAP "logo.bmp"
31: !define MUI_HEADERIMAGE_NOSTRETCH
32:
33: ; !define MUI_BGCOLOR "99D228"
34: !define MUI_ICON "favicon.ico"
35: !define MUI_UNICON "favicon.ico"
36:
37: ; Interface Settings
38: ;!define MUI_ABORTWARNING
39: !define MUI_COMPONENTSPAGE_SMALLDESC
40: !define MUI_FINISHPAGE_NOAUTOCLOSE
41: !define MUI_UNFINISHPAGE_NOAUTOCLOSE
42:
43: ;--------------------------------
44: ; Pages
45: !define MUI_LICENSEPAGE_RADIOBUTTONS
46: !define MUI_WELCOMEPAGE_TEXT "This programm will install Parser ${VER_DISPLAY} on your computer.\r\n\r\nClick Next to continue"
47: !define MUI_COMPONENTSPAGE_TEXT '"Select components to install and click Next to continue" "" "Components"'
48:
49: !insertmacro MUI_PAGE_WELCOME
50: !insertmacro MUI_PAGE_LICENSE "license_${VER_LANG}.txt"
51: !insertmacro MUI_PAGE_COMPONENTS
52: !insertmacro MUI_PAGE_DIRECTORY
53: !insertmacro MUI_PAGE_INSTFILES
54:
55: !insertmacro MUI_UNPAGE_CONFIRM
56: !insertmacro MUI_UNPAGE_INSTFILES
57:
58: ;--------------------------------
59: ; Languages
60: !insertmacro MUI_LANGUAGE "English"
61:
62: ;--------------------------------
63: ; Installer Sections
64:
65: Section ""
66: WriteRegStr HKLM "${UNINSTALL_PATH}" "DisplayName" "Parser 3 (remove only)"
67: WriteRegStr HKLM "${UNINSTALL_PATH}" "DisplayVersion" "${VER_DISPLAY}"
68: WriteRegStr HKLM "${UNINSTALL_PATH}" "DisplayIcon" "$INSTDIR\parser3_uninst.exe"
69: WriteRegStr HKLM "${UNINSTALL_PATH}" "HelpLink" "http://www.parser.ru/en/"
70: WriteRegStr HKLM "${UNINSTALL_PATH}" "URLInfoAbout" "http://www.parser.ru/en/"
71: WriteRegDWORD HKLM "${UNINSTALL_PATH}" "NoModify" 1
72: WriteRegStr HKLM "${UNINSTALL_PATH}" "UninstallString" '"$INSTDIR\parser3_uninst.exe"'
73: SetOutPath $INSTDIR
74: WriteUninstaller "parser3_uninst.exe"
75: SectionEnd
76:
77: Section "CGI with XML" XML
78: SetOutPath $INSTDIR
79: File "cgi_xml\*.*"
80: SectionEnd
81:
82:
83: Section "IIS ISAPI with XML" ISAPIXML
84: SetOutPath $INSTDIR
85: File "isapi_xml\*.*"
86: SectionEnd
87:
88:
89: SubSection /e "Documentation"
90:
91: Section "CHM" CHM
92: CreateDirectory "$INSTDIR\docs"
93: SetOutPath $INSTDIR\docs
94: File "docs\*.${VER_LANG}.chm"
95: SectionEnd
96:
97: Section "PDF" PDF
98: CreateDirectory "$INSTDIR\docs"
99: SetOutPath $INSTDIR\docs
100: File "docs\*.${VER_LANG}.pdf"
101: SectionEnd
102:
103: SubSectionEnd
104:
105:
106: SubSection /e "Misc" other
107:
108: Section "Main configuration file" AUTO
109: SetOutPath $INSTDIR
110: File "config\auto.p"
111: CreateDirectory "$INSTDIR\charsets"
112: SetOutPath $INSTDIR\charsets
113: File "config\charsets\*.*"
114: SectionEnd
115:
116: Section "libcurl library" LIBCURL
117: SetOutPath $INSTDIR
118: File "lib\curl\libcurl.dll"
119: SectionEnd
120:
121: Section "_test.html" test
122: CreateDirectory "$INSTDIR\other"
123: SetOutPath $INSTDIR\other
124: File "other\${VER_LANG}\_test.html"
125: SectionEnd
126:
127: SubSectionEnd
128:
129:
130: SubSection /e "SQL drivers"
131:
132: Section "MySQL driver" MYSQL
133: CreateDirectory "$INSTDIR\lib"
134: SetOutPath $INSTDIR\lib
135: File "sql\parser3mysql.dll"
136:
137: File "lib\sql\libmySQL.dll"
1.2 moko 138:
139: SetOutPath $INSTDIR
140: File "lib\sql-mysql-dependences\*.dll"
1.1 moko 141: SectionEnd
142:
143:
144: Section "SQLite driver" SQLITE
145: CreateDirectory "$INSTDIR\lib"
146: SetOutPath $INSTDIR\lib
147: File "sql\parser3sqlite.dll"
148:
149: File "lib\sql\sqlite3.dll"
150: SectionEnd
151:
152:
153: Section "Oracle driver" ORACLE
154: CreateDirectory "$INSTDIR\lib"
155: SetOutPath $INSTDIR\lib
156: File "sql\parser3oracle.dll"
157: SectionEnd
158:
159:
160: Section "PostgreSQL driver" PGSQL
161: CreateDirectory "$INSTDIR\lib"
162: SetOutPath $INSTDIR\lib
163: File "sql\parser3pgsql.dll"
164:
165: File "lib\sql\libpq.dll"
166:
167: SetOutPath $INSTDIR
168: File "lib\sql-pq-dependences\*.dll"
169: SectionEnd
170:
171: SubSectionEnd
172:
173:
174:
175: ;--------------------------------
176: ; Descriptions
177:
178: !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
179: !insertmacro MUI_DESCRIPTION_TEXT ${XML} "Can be used with any web-server which supports CGI scripts"
180: !insertmacro MUI_DESCRIPTION_TEXT ${ISAPIXML} "IIS ISAPI extension is more efficient than CGI"
181:
182: !insertmacro MUI_DESCRIPTION_TEXT ${CHM} "Documentation as Windows help file"
183: !insertmacro MUI_DESCRIPTION_TEXT ${PDF} "Documentation ready to print"
184:
185: !insertmacro MUI_DESCRIPTION_TEXT ${AUTO} "Main configuration file (auto.p)"
186: !insertmacro MUI_DESCRIPTION_TEXT ${LIBCURL} "libcurl library which is used from curl class"
187: !insertmacro MUI_DESCRIPTION_TEXT ${test} "File to test Parser installation"
188:
189: !insertmacro MUI_DESCRIPTION_TEXT ${MYSQL} "Driver to access MySQL servers"
190: !insertmacro MUI_DESCRIPTION_TEXT ${SQLITE} "Driver for SQLite"
191: !insertmacro MUI_DESCRIPTION_TEXT ${PGSQL} "Driver to access PgSQL servers"
192: !insertmacro MUI_DESCRIPTION_TEXT ${ORACLE} "Driver to access ORACLE servers"
193: !insertmacro MUI_FUNCTION_DESCRIPTION_END
194:
195: DirText "Specify a folder where your web-server keeps CGI-scripts" "Folder to install Parser ${VER_DISPLAY}" "Change"
196: InstallDir "$7"
197: InstallDirRegKey HKLM "SOFTWARE\Art Lebedev Studio\Parser 3" "Install_Dir"
198:
199:
200:
201: ;--------------------------------
202: ; Uninstaller Section
203:
204: UninstallText "Uninstall Parser 3 Click Next to continue" "Folder"
205: UninstallSubCaption 0 ": Confirm"
206: UninstallSubCaption 1 ": Deleting files"
207: UninstallSubCaption 2 ": Delete completed"
208: UninstallButtonText "Next"
209:
210:
211: ; special uninstall section.
212: Section "Uninstall"
213: ; remove files
214: Delete "$INSTDIR\charsets\*.cfg"
215: RMDir "$INSTDIR\charsets"
216:
217: ; SQL drivers
218: Delete "$INSTDIR\lib\parser3*.dll"
219:
220: ; SQL libs
221: Delete "$INSTDIR\lib\libmySQL.dll"
222: Delete "$INSTDIR\lib\sqlite*.dll"
223: Delete "$INSTDIR\lib\libpq*.dll"
224:
225: RMDir "$INSTDIR\lib"
226:
227: ; CURL, sql-pq-dependences
228: Delete "$INSTDIR\lib*.dll"
229:
230: ; DOCs
231: Delete "$INSTDIR\docs\*.*"
232: RMDir "$INSTDIR\docs"
233:
234: ; rest
235: Delete "$INSTDIR\*parser3*.*"
236:
237: Delete "$INSTDIR\readme.*.txt"
238: Delete "$INSTDIR\Readme"
239: Delete "$INSTDIR\auto.p"
240:
241: Delete "$INSTDIR\other\_test.html"
242: RMDir "$INSTDIR\other"
243:
244: ; remove registry keys
245: DeleteRegKey HKLM "SOFTWARE\Art Lebedev Studio\"
246: DeleteRegKey HKLM "${UNINSTALL_PATH}"
247: ; MUST REMOVE UNINSTALLER, too
248: Delete $INSTDIR\parser3_uninst.exe
249: ; remove directories used.
250: ; RMDir "$INSTDIR"
251: SectionEnd
252:
253:
254: ;!define SF_SELECTED 1
255: ;!define SF_SUBSEC 2
256: ;!define SF_SUBSECEND 4
257: ;!define SF_BOLD 8
258: ;!define SF_RO 16
259: ;!define SF_EXPAND 32
260:
261: ;!define SECTION_OFF 0xFFFFFFFE
262:
263: Function .onInit
264: StrCpy $INSTDIR "C:\"
265:
266: ; looking for directory with Apache installation
267: Push $5
268: Push $6
269: Push $7
270:
271: ; Apache 2.0 and may be early
272: StrCpy $5 0
273: loop1:
274: EnumRegKey $6 HKLM "SOFTWARE\Apache Group\Apache" "$5"
275: StrCmp $6 "" end1
276: IntOp $5 $5 + 1
277: ReadRegStr $7 HKLM "SOFTWARE\Apache Group\Apache\$6" "ServerRoot"
278: StrCmp $7 "" loop1
279: StrCpy $INSTDIR "$7cgi-bin"
280: Goto loop1
281: end1:
282:
283: ; Apache 2.2
284: StrCpy $5 0
285: loop2:
286: EnumRegKey $6 HKLM "SOFTWARE\Apache Software Foundation\Apache" "$5"
287: StrCmp $6 "" end2
288: IntOp $5 $5 + 1
289: ReadRegStr $7 HKLM "SOFTWARE\Apache Software Foundation\Apache\$6" "ServerRoot"
290: StrCmp $7 "" loop2
291: StrCpy $INSTDIR "$7cgi-bin"
292: Goto loop2
293: end2:
294:
295: ; MessageBox MB_OK "$INSTDIR"
296:
297: Pop $7
298: Pop $6
299: Pop $5
300:
301: Push $0
302:
303: StrCpy $1 ${XML}
304:
305: SectionGetFlags ${XML} $0
306: IntOp $0 $0 | ${SF_SELECTED}
307: SectionSetFlags ${XML} $0
308:
309: SectionGetFlags ${ISAPIXML} $0
310: IntOp $0 $0 & ${SECTION_OFF}
311: SectionSetFlags ${ISAPIXML} $0
312:
313:
314:
315: SectionGetFlags ${CHM} $0
316: IntOp $0 $0 | ${SF_SELECTED}
317: SectionSetFlags ${CHM} $0
318:
319: SectionGetFlags ${PDF} $0
320: IntOp $0 $0 & ${SECTION_OFF}
321: SectionSetFlags ${PDF} $0
322:
323:
324:
325: SectionGetFlags ${AUTO} $0
326: IntOp $0 $0 | ${SF_SELECTED}
327: SectionSetFlags ${AUTO} $0
328:
329: SectionGetFlags ${LIBCURL} $0
330: IntOp $0 $0 | ${SF_SELECTED}
331: SectionSetFlags ${LIBCURL} $0
332:
333:
334:
335: SectionGetFlags ${MYSQL} $0
336: IntOp $0 $0 | ${SF_SELECTED}
337: SectionSetFlags ${MYSQL} $0
338:
339: SectionGetFlags ${SQLITE} $0
340: IntOp $0 $0 | ${SF_SELECTED}
341: SectionSetFlags ${SQLITE} $0
342:
343: SectionGetFlags ${ORACLE} $0
344: IntOp $0 $0 & ${SECTION_OFF}
345: SectionSetFlags ${ORACLE} $0
346:
347: SectionGetFlags ${PGSQL} $0
348: IntOp $0 $0 & ${SECTION_OFF}
349: SectionSetFlags ${PGSQL} $0
350:
351: Pop $0
352: FunctionEnd
353:
354: Function .onSelChange
355: ; MessageBox MB_OK 'onSelChange'
356: Push $0
357:
358: ; Turn off old selected section
359: SectionGetFlags $1 $0
360: IntOp $0 $0 & ${SECTION_OFF}
361: SectionSetFlags $1 $0
362:
363: ; Now remember the current selection
364: Push $2
365: StrCpy $2 $1
366:
367: SectionGetFlags ${XML} $0
368: IntOp $0 $0 & ${SF_SELECTED}
369: IntCmp $0 ${SF_SELECTED} 0 +2 +2
370: StrCpy $1 ${XML}
371:
372: SectionGetFlags ${ISAPIXML} $0
373: IntOp $0 $0 & ${SF_SELECTED}
374: IntCmp $0 ${SF_SELECTED} 0 +2 +2
375: StrCpy $1 ${ISAPIXML}
376:
377: StrCmp $2 $1 0 +2
378: SectionGetFlags $1 $0
379: IntOp $0 $0 | ${SF_SELECTED}
380: SectionSetFlags $1 $0
381: Pop $2
382: Pop $0
383: FunctionEnd
384:
385:
386: Function .onInstSuccess
387: WriteRegStr HKLM "SOFTWARE\Art Lebedev Studio\Parser 3" "Install_Dir" "$INSTDIR"
388: MessageBox MB_YESNO|MB_ICONQUESTION "Do you want to read a short installation instruction?" IDNO NoReadMe
389: Exec 'notepad.exe "$INSTDIR\readme.${VER_LANG}.txt"'
390: NoReadMe:
391: FunctionEnd
E-mail: