Annotation of Amaya/amaya-wx_debug.nsi, revision 1.14
1.1 gully 1: ;--------------------------------
2: ;Include Modern UI
3:
4: !include "MUI.nsh"
5:
1.9 cvs 6:
1.1 gully 7: ;--------------------------------
8: ;General
9:
10: ;Name and file
1.14 ! gully 11: !define VERSION "9.0.1"
1.1 gully 12: Name "Amaya WX ${VERSION} (debug)"
13: OutFile "Amaya-WX-${VERSION}-debug.exe"
14:
15: ;Use lzma to compress (better than zip)
16: SetCompressor lzma
17:
18: ;Default installation folder
1.2 gully 19: InstallDir "$PROGRAMFILES\AmayaWX-debug"
1.1 gully 20:
21: ;Get installation folder from registry if available
1.2 gully 22: InstallDirRegKey HKCU "Software\AmayaWX-debug" ""
1.1 gully 23:
24:
25: ;--------------------------------
26: ;Variables
27:
1.3 gully 28:
1.1 gully 29: Var STARTMENU_FOLDER
30: ;--------------------------------
31: ;Interface Settings
32:
33: !define MUI_ABORTWARNING
34:
35: ;--------------------------------
36: ;Language Selection Dialog Settings
37:
38: ;Remember the installer language
39: !define MUI_LANGDLL_REGISTRY_ROOT "HKCU"
1.2 gully 40: !define MUI_LANGDLL_REGISTRY_KEY "Software\AmayaWX-debug"
1.1 gully 41: !define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
42:
43: ;--------------------------------
44: ;Pages
45:
46: !insertmacro MUI_PAGE_LICENSE "amaya\COPYRIGHT"
47: !insertmacro MUI_PAGE_COMPONENTS
48: !insertmacro MUI_PAGE_DIRECTORY
49:
50: ;Start Menu Folder Page Configuration
51: !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU"
1.2 gully 52: !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\AmayaWX-debug"
1.1 gully 53: !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
54: !insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER
55:
56: !insertmacro MUI_PAGE_INSTFILES
1.10 gully 57:
58: !define MUI_FINISHPAGE_LINK "Visit the Amaya site for the latest news, FAQs and support"
59: !define MUI_FINISHPAGE_LINK_LOCATION "http://www.w3.org/Amaya"
60:
61: !define MUI_FINISHPAGE_RUN "$INSTDIR\WindowsWX\bin\amaya.exe"
62: !define MUI_FINISHPAGE_NOREBOOTSUPPORT
1.1 gully 63:
1.10 gully 64: !insertmacro MUI_PAGE_FINISH
65:
1.1 gully 66: !insertmacro MUI_UNPAGE_CONFIRM
67: !insertmacro MUI_UNPAGE_INSTFILES
68:
69: ;--------------------------------
70: ;Languages
71:
72: !insertmacro MUI_LANGUAGE "English"
73: !insertmacro MUI_LANGUAGE "French"
74: !insertmacro MUI_LANGUAGE "German"
75: !insertmacro MUI_LANGUAGE "Spanish"
76: ; !insertmacro MUI_LANGUAGE "SimpChinese"
77: ; !insertmacro MUI_LANGUAGE "TradChinese"
78: ; !insertmacro MUI_LANGUAGE "Japanese"
79: ; !insertmacro MUI_LANGUAGE "Korean"
80: ; !insertmacro MUI_LANGUAGE "Italian"
81: ; !insertmacro MUI_LANGUAGE "Dutch"
82: ; !insertmacro MUI_LANGUAGE "Danish"
83: ; !insertmacro MUI_LANGUAGE "Swedish"
84: ; !insertmacro MUI_LANGUAGE "Norwegian"
85: ; !insertmacro MUI_LANGUAGE "Finnish"
86: ; !insertmacro MUI_LANGUAGE "Greek"
87: !insertmacro MUI_LANGUAGE "Russian"
88: !insertmacro MUI_LANGUAGE "Portuguese"
89: ; !insertmacro MUI_LANGUAGE "PortugueseBR"
90: ; !insertmacro MUI_LANGUAGE "Polish"
91: ; !insertmacro MUI_LANGUAGE "Ukrainian"
92: ; !insertmacro MUI_LANGUAGE "Czech"
93: ; !insertmacro MUI_LANGUAGE "Slovak"
94: ; !insertmacro MUI_LANGUAGE "Croatian"
95: ; !insertmacro MUI_LANGUAGE "Bulgarian"
96: ; !insertmacro MUI_LANGUAGE "Hungarian"
97: ; !insertmacro MUI_LANGUAGE "Thai"
98: ; !insertmacro MUI_LANGUAGE "Romanian"
99: ; !insertmacro MUI_LANGUAGE "Latvian"
100: ; !insertmacro MUI_LANGUAGE "Macedonian"
101: ; !insertmacro MUI_LANGUAGE "Estonian"
102: !insertmacro MUI_LANGUAGE "Turkish"
103: ; !insertmacro MUI_LANGUAGE "Lithuanian"
104: ; !insertmacro MUI_LANGUAGE "Catalan"
105: ; !insertmacro MUI_LANGUAGE "Slovenian"
106: ; !insertmacro MUI_LANGUAGE "Serbian"
107: ; !insertmacro MUI_LANGUAGE "SerbianLatin"
108: ; !insertmacro MUI_LANGUAGE "Arabic"
109: ; !insertmacro MUI_LANGUAGE "Farsi"
110: ; !insertmacro MUI_LANGUAGE "Hebrew"
111: ; !insertmacro MUI_LANGUAGE "Indonesian"
112: ; !insertmacro MUI_LANGUAGE "Mongolian"
113: ; !insertmacro MUI_LANGUAGE "Luxembourgish"
114: ; !insertmacro MUI_LANGUAGE "Albanian"
115:
116: ;--------------------------------
117: ;Reserve Files
118:
119: ;These files should be inserted before other files in the data block
120: ;Keep these lines before any File command
121: ;Only for solid compression (by default, solid compression is enabled for BZIP2 and LZMA)
122:
123: !insertmacro MUI_RESERVEFILE_LANGDLL
124:
125: ;--------------------------------
126: ;Installer Sections
127:
128: Section "Amaya" SecAmaya
129:
1.9 cvs 130:
1.10 gully 131: SetDetailsPrint textonly
132: DetailPrint "Testing supported OS..."
133: SetDetailsPrint listonly
134:
1.9 cvs 135: ;XXXXXXXXXXXXXXXXXXXXXXXXXX
136: ;Test the platform
137: ;XXXXXXXXXXXXXXXXXXXXXXXXXX
1.10 gully 138: ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
139: StrCmp $R0 "" lbl_notwinnt lbl_winnt
1.9 cvs 140:
141: ; we are not NT
1.10 gully 142: lbl_notwinnt:
143: ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion" VersionNumber
1.9 cvs 144:
145: StrCpy $R1 $R0 1
146: StrCmp $R1 '4' 0 lbl_error
147:
148: StrCpy $R1 $R0 3
149:
150: StrCmp $R1 '4.0' lbl_win32_95
151: StrCmp $R1 '4.9' lbl_win32_ME lbl_win32_98
1.10 gully 152:
1.9 cvs 153: lbl_win32_95:
1.10 gully 154: Abort "Win95 not supported"
1.9 cvs 155:
156: lbl_win32_98:
1.10 gully 157: Abort "Win98 not supported"
1.9 cvs 158:
159: lbl_win32_ME:
1.10 gully 160: Abort "WinME not supported"
1.9 cvs 161:
162: lbl_winnt:
163:
164: StrCpy $R1 $R0 1
165:
166: StrCmp $R1 '3' lbl_winnt_x
167: StrCmp $R1 '4' lbl_winnt_x
168:
169: StrCpy $R1 $R0 3
170:
171: StrCmp $R1 '5.0' lbl_winnt_2000
172: StrCmp $R1 '5.1' lbl_winnt_XP
1.10 gully 173: StrCmp $R1 '5.2' lbl_winnt_2003
174: Goto lbl_error
1.9 cvs 175:
176: lbl_winnt_x:
177: StrCpy $R0 "NT $R0" 6
178: Goto lbl_done
179:
180: lbl_winnt_2000:
181: Strcpy $R0 '2000'
182: Goto lbl_done
183:
184: lbl_winnt_XP:
185: Strcpy $R0 'XP'
186: Goto lbl_done
187:
188: lbl_winnt_2003:
189: Strcpy $R0 '2003'
190: Goto lbl_done
191:
192: lbl_error:
1.10 gully 193: Abort "Only WinXP/2k/NT are supported"
1.9 cvs 194: lbl_done:
195: ;XXXXXXXXXXXXXXXXXXXXXXXXXX
196:
1.1 gully 197: ;This section is required : readonly mode
198: SectionIn RO
199:
1.10 gully 200: SetDetailsPrint textonly
201: DetailPrint "Installing Amaya binaries and wxWidgets DLL"
202: SetDetailsPrint listonly
203:
1.1 gully 204: SetOutPath "$INSTDIR\WindowsWX\bin"
205: File WindowsWX\bin\amaya.exe
206: File WindowsWX\bin\wxmsw*ud_xrc_vc_custom.dll
207: File WindowsWX\bin\wxmsw*ud_html_vc_custom.dll
208: File WindowsWX\bin\wxmsw*ud_core_vc_custom.dll
209: File WindowsWX\bin\wxmsw*ud_adv_vc_custom.dll
210: File WindowsWX\bin\wxmsw*ud_gl_vc_custom.dll
211: File WindowsWX\bin\wxbase*ud_vc_custom.dll
212: File WindowsWX\bin\wxbase*ud_xml_vc_custom.dll
213: ; File WindowsWX\bin\thotprinter.exe
214:
1.10 gully 215: SetDetailsPrint textonly
216: DetailPrint "Installing Amaya resources : icons, dialogues"
217: SetDetailsPrint listonly
1.1 gully 218:
1.13 gully 219: SetOutPath "$INSTDIR\resources\icons\misc"
220: File resources\icons\misc\*.png
221: File resources\icons\misc\*.gif
222: File resources\icons\misc\*.ico
223: SetOutPath "$INSTDIR\resources\icons\16x16"
224: File resources\icons\16x16\*.png
225: File resources\icons\16x16\*.gif
226: File resources\icons\16x16\*.ico
227: SetOutPath "$INSTDIR\resources\icons\22x22"
228: File resources\icons\22x22\*.png
229: File resources\icons\22x22\*.gif
230: File resources\icons\22x22\*.ico
1.1 gully 231: SetOutPath "$INSTDIR\resources\xrc"
232: File resources\xrc\*.xrc
1.11 gully 233: SetOutPath "$INSTDIR\amaya\wxdialog"
234: File amaya\wxdialog\appicon.ico
1.12 gully 235: File amaya\wxdialog\amaya.rc
1.1 gully 236:
1.10 gully 237: SetDetailsPrint textonly
238: DetailPrint "Installing Amaya schemas"
239: SetDetailsPrint listonly
1.1 gully 240:
241: SetOutPath "$INSTDIR\amaya"
242: File amaya\COPYRIGHT
243: File amaya\*.png
244: File amaya\*.gif
245: File amaya\*.css
246: File amaya\*.html*
247: File amaya\*.PRS
248: File amaya\*.STR
249: File amaya\*.TRA
250: File amaya\*.conf
251: File amaya\*.en
252: File amaya\*.trans*
253: File amaya\*.ico
254: File amaya\*.svg
255:
1.10 gully 256: SetDetailsPrint textonly
257: DetailPrint "Installing annotlib schemas"
258: SetDetailsPrint listonly
259:
1.1 gully 260: SetOutPath "$INSTDIR\annotlib"
261: File annotlib\*.png
262: File annotlib\*.gif
263: File annotlib\*.PRS
264: File annotlib\*.STR
265: File annotlib\*.TRA
266: File annotlib\*.en
267:
1.10 gully 268: SetDetailsPrint textonly
269: DetailPrint "Installing Amaya config files"
270: SetDetailsPrint listonly
271:
1.1 gully 272: SetOutPath "$INSTDIR\config\libconfig"
273: File config\libconfig\*.png
274: File config\libconfig\*.svg
275: File config\libconfig\*.css
276: File config\libconfig\*.lhtml
277:
278: SetOutPath "$INSTDIR\config"
279: File config\*-amayadialogue
280: File config\*-libdialogue
281: File config\*-amayamsg
282: File config\*-libdialogue
283: File config\lib_files.dat
284: File config\fonts.*
285: File config\amaya.kb
286: File config\amaya.profiles
287: File config\*.rdf
288: File config\annot.schemas
289: File config\win-thot.rc
290:
1.10 gully 291: SetDetailsPrint textonly
292: DetailPrint "Installing Amaya dictionnaries"
293: SetDetailsPrint listonly
294:
1.1 gully 295: SetOutPath "$INSTDIR\dicopar"
296: File dicopar\alphabet
297: File dicopar\*.ptn
298: File dicopar\clavier
299: File dicopar\*.dic
300:
1.10 gully 301: SetDetailsPrint textonly
302: DetailPrint "Installing Amaya documentation"
303: SetDetailsPrint listonly
304:
1.1 gully 305: SetOutPath "$INSTDIR\doc\html"
306: File doc\html\*
1.4 gully 307: SetOutPath "$INSTDIR\doc\html\accessibility_in_amaya"
1.1 gully 308: File doc\html\accessibility_in_amaya\*
1.4 gully 309: SetOutPath "$INSTDIR\doc\html\attaching_annotations"
1.1 gully 310: File doc\html\attaching_annotations\*
1.4 gully 311: SetOutPath "$INSTDIR\doc\html\browsing"
1.1 gully 312: File doc\html\browsing\*
1.4 gully 313: SetOutPath "$INSTDIR\doc\html\configuring_amaya"
1.1 gully 314: File doc\html\configuring_amaya\*
1.4 gully 315: SetOutPath "$INSTDIR\doc\html\editing_attributes"
1.1 gully 316: File doc\html\editing_attributes\*
1.4 gully 317: SetOutPath "$INSTDIR\doc\html\editing_documents"
1.1 gully 318: File doc\html\editing_documents\*
1.4 gully 319: SetOutPath "$INSTDIR\doc\html\editing_iso-latin-1_characters"
1.1 gully 320: File doc\html\editing_iso-latin-1_characters\*
1.4 gully 321: SetOutPath "$INSTDIR\doc\html\editing_mathematics"
1.1 gully 322: File doc\html\editing_mathematics\*
1.4 gully 323: SetOutPath "$INSTDIR\doc\html\editing_tables"
1.1 gully 324: File doc\html\editing_tables\*
1.4 gully 325: SetOutPath "$INSTDIR\doc\html\elements"
1.1 gully 326: File doc\html\elements\*
1.4 gully 327: SetOutPath "$INSTDIR\doc\html\HTML-elements"
1.1 gully 328: File doc\html\HTML-elements\*
1.4 gully 329: SetOutPath "$INSTDIR\doc\html\linking"
1.1 gully 330: File doc\html\linking\*
1.4 gully 331: SetOutPath "$INSTDIR\doc\html\printing"
1.1 gully 332: File doc\html\printing\*
1.4 gully 333: SetOutPath "$INSTDIR\doc\html\saving_and_publishing_documents"
1.1 gully 334: File doc\html\saving_and_publishing_documents\*
1.4 gully 335: SetOutPath "$INSTDIR\doc\html\searching_and_replacing_text"
1.1 gully 336: File doc\html\searching_and_replacing_text\*
1.4 gully 337: SetOutPath "$INSTDIR\doc\html\selecting"
1.1 gully 338: File doc\html\selecting\*
1.4 gully 339: SetOutPath "$INSTDIR\doc\html\spell_checking"
1.1 gully 340: File doc\html\spell_checking\*
1.4 gully 341: SetOutPath "$INSTDIR\doc\html\style_sheets"
1.1 gully 342: File doc\html\style_sheets\*
1.4 gully 343: SetOutPath "$INSTDIR\doc\html\using_graphics"
1.1 gully 344: File doc\html\using_graphics\*
1.4 gully 345: SetOutPath "$INSTDIR\doc\html\using_image_maps"
1.1 gully 346: File doc\html\using_image_maps\*
1.4 gully 347: SetOutPath "$INSTDIR\doc\html\using_the_makebook_function"
1.1 gully 348: File doc\html\using_the_makebook_function\*
1.4 gully 349: SetOutPath "$INSTDIR\doc\html\using_xml"
1.1 gully 350: File doc\html\using_xml\*
1.4 gully 351: SetOutPath "$INSTDIR\doc\html\viewing"
1.1 gully 352: File doc\html\viewing\*
353:
354: SetOutPath "$INSTDIR\doc\images"
355: File doc\images\*
356:
1.10 gully 357: SetDetailsPrint textonly
358: DetailPrint "Installing Amaya ttf fonts"
359: SetDetailsPrint listonly
360:
1.1 gully 361: SetOutPath "$INSTDIR\fonts"
362: File fonts\*
363:
1.10 gully 364: SetDetailsPrint textonly
365: DetailPrint "Writting registry keys"
366: SetDetailsPrint listonly
367:
1.1 gully 368: ;Store installation folder
1.10 gully 369: WriteRegStr HKCU "Software\AmayaWX-debug" "" $INSTDIR
370: WriteRegExpandStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AmayaWX-debug" "UninstallString" '"$INSTDIR\Uninstall.exe"'
371: WriteRegExpandStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AmayaWX-debug" "InstallLocation" "$INSTDIR"
372: WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AmayaWX-debug" "DisplayName" "Amaya"
1.11 gully 373: WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AmayaWX-debug" "DisplayIcon" "$INSTDIR\WindowsWX\bin\amaya.exe"
1.10 gully 374: WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AmayaWX-debug" "DisplayVersion" "${VERSION}"
375: WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AmayaWX-debug" "URLInfoAbout" "http://www.w3.org/Amaya"
376:
1.11 gully 377: ; Associate files to amaya
378: WriteRegStr HKCR "Amaya" "" "Amaya Files"
379: WriteRegStr HKCR "Amaya\DefaultIcon" "" "$INSTDIR\WindowsWX\bin\amaya.exe"
380: ReadRegStr $R0 HKCR "Amaya\shell\open\command" ""
381: StrCmp $R0 "" 0 no_amayaopen
382: WriteRegStr HKCR "Amaya\shell" "" "open"
383: WriteRegStr HKCR "Amaya\shell\open\command" "" '"$INSTDIR\WindowsWX\bin\amaya.exe" "%1"'
384: no_amayaopen:
385:
1.1 gully 386: ;Create uninstaller
387: WriteUninstaller "$INSTDIR\Uninstall.exe"
388:
389: ;Start Menu
390: !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
391: ;Create shortcuts
392: CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
393: CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
394: CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Amaya.lnk" "$INSTDIR\WindowsWX\bin\amaya.exe"
395: !insertmacro MUI_STARTMENU_WRITE_END
396:
1.3 gully 397: ;Create desktop link
398: CreateShortCut "$DESKTOP\AmayaWX.lnk" "$INSTDIR\WindowsWX\bin\amaya.exe"
1.1 gully 399: SectionEnd
400:
1.11 gully 401:
402: SubSection "File association" SecFileAss
403:
404: Section ".html (HyperText Markup Language)" SecAssHTML
405: WriteRegStr HKCR ".html" "" "Amaya"
406: SectionEnd
407:
408: Section ".xml (eXtensible Markup Language)" SecAssXML
409: WriteRegStr HKCR ".xml" "" "Amaya"
410: SectionEnd
411:
412: Section ".svg (Scalable Vector Graphics)" SecAssSVG
413: WriteRegStr HKCR ".svg" "" "Amaya"
414: SectionEnd
415:
416: Section ".mml (MathML)" SecAssMML
417: WriteRegStr HKCR ".mml" "" "Amaya"
418: SectionEnd
419:
420: Section ".css (Cascading Style Sheets)" SecAssCSS
421: WriteRegStr HKCR ".css" "" "Amaya"
422: SectionEnd
423:
424: SubSectionEnd
425:
1.1 gully 426: ;--------------------------------
427: ;Installer Functions
428:
429: Function .onInit
430:
431: !insertmacro MUI_LANGDLL_DISPLAY
432:
433: FunctionEnd
434:
435: ;--------------------------------
436: ;Descriptions
437:
438: ;USE A LANGUAGE STRING IF YOU WANT YOUR DESCRIPTIONS TO BE LANGAUGE SPECIFIC
439:
440: ;Assign descriptions to sections
441: !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
442: !insertmacro MUI_DESCRIPTION_TEXT ${SecAmaya} "Amaya."
1.11 gully 443: !insertmacro MUI_DESCRIPTION_TEXT ${SecFileAss} "Amaya files associations."
1.1 gully 444: !insertmacro MUI_FUNCTION_DESCRIPTION_END
445:
446: ;--------------------------------
447: ;Uninstaller Section
448:
449: Section "Uninstall"
450:
1.10 gully 451: SetDetailsPrint textonly
452: DetailPrint "Uninstalling Amaya..."
453: SetDetailsPrint listonly
454:
455: IfFileExists $INSTDIR\WindowsWX\bin\amaya.exe amaya_installed
456: MessageBox MB_YESNO "It does not appear that Amaya is installed in the directory '$INSTDIR'.$\r$\nContinue anyway (not recommended)?" IDYES amaya_installed
457: Abort "Uninstall aborted by user"
458: amaya_installed:
459:
460:
461: SetDetailsPrint textonly
462: DetailPrint "Deleting Files..."
463: SetDetailsPrint listonly
464:
465: ReadRegStr $STARTMENU_FOLDER HKCU "Software\AmayaWX-debug" "Start Menu Folder"
466: IfFileExists "$SMPROGRAMS\$STARTMENU_FOLDER\Amaya.lnk" amaya_smp_installed
467: Goto amaya_smp_notinstalled
468: amaya_smp_installed:
469: Delete "$SMPROGRAMS\$STARTMENU_FOLDER\Amaya.lnk"
470: Delete "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk"
471: RMDir "$SMPROGRAMS\$STARTMENU_FOLDER"
472: Delete "$DESKTOP\AmayaWX.lnk"
473: amaya_smp_notinstalled:
1.1 gully 474:
475: RMDir /r "$INSTDIR"
476:
1.10 gully 477: SetDetailsPrint textonly
478: DetailPrint "Deleting Registry Keys..."
479: SetDetailsPrint listonly
1.1 gully 480:
1.10 gully 481: DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AmayaWX-debug"
482: DeleteRegKey HKLM "Software\AmayaWX-debug"
1.11 gully 483: DeleteRegKey HKCR "Amaya"
1.1 gully 484:
485: SectionEnd
486:
487: ;--------------------------------
488: ;Uninstaller Functions
489:
490: Function un.onInit
491:
492: !insertmacro MUI_UNGETLANGUAGE
493:
494: FunctionEnd
Webmaster