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