Annotation of Amaya/amaya-wx_debug.nsi, revision 1.23

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.23    ! gully      11:   !define VERSION "9.1.4"
1.1       gully      12:   Name "Amaya WX ${VERSION} (debug)"
1.21      gully      13:   OutFile "amaya-WinXP-${VERSION}-debug.exe"
1.1       gully      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
1.20      cvs       213:   File WindowsWX\bin\thotprinter.dll
1.21      gully     214:   File WindowsWX\bin\MSVCRTD.DLL
1.1       gully     215: 
1.10      gully     216:   SetDetailsPrint textonly
                    217:   DetailPrint "Installing Amaya resources : icons, dialogues"
                    218:   SetDetailsPrint listonly
1.1       gully     219: 
1.13      gully     220:   SetOutPath "$INSTDIR\resources\icons\misc"
                    221:   File resources\icons\misc\*.png
                    222:   File resources\icons\misc\*.gif
                    223:   File resources\icons\misc\*.ico
                    224:   SetOutPath "$INSTDIR\resources\icons\16x16"
                    225:   File resources\icons\16x16\*.png
                    226:   File resources\icons\16x16\*.gif
                    227:   File resources\icons\16x16\*.ico
                    228:   SetOutPath "$INSTDIR\resources\icons\22x22"
                    229:   File resources\icons\22x22\*.png
                    230:   File resources\icons\22x22\*.gif
                    231:   File resources\icons\22x22\*.ico
1.1       gully     232:   SetOutPath "$INSTDIR\resources\xrc"
                    233:   File resources\xrc\*.xrc
1.11      gully     234:   SetOutPath "$INSTDIR\amaya\wxdialog"
                    235:   File amaya\wxdialog\appicon.ico
1.12      gully     236:   File amaya\wxdialog\amaya.rc
1.1       gully     237: 
1.10      gully     238:   SetDetailsPrint textonly
                    239:   DetailPrint "Installing Amaya schemas"
                    240:   SetDetailsPrint listonly
1.1       gully     241: 
                    242:   SetOutPath "$INSTDIR\amaya"
                    243:   File amaya\COPYRIGHT
                    244:   File amaya\*.png
                    245:   File amaya\*.gif
                    246:   File amaya\*.css
                    247:   File amaya\*.html*
                    248:   File amaya\*.PRS
                    249:   File amaya\*.STR
                    250:   File amaya\*.TRA
                    251:   File amaya\*.conf
                    252:   File amaya\*.en
                    253:   File amaya\*.trans*
                    254:   File amaya\*.ico
                    255:   File amaya\*.svg
                    256: 
1.10      gully     257:   SetDetailsPrint textonly
                    258:   DetailPrint "Installing annotlib schemas"
                    259:   SetDetailsPrint listonly
                    260: 
1.1       gully     261:   SetOutPath "$INSTDIR\annotlib"
                    262:   File annotlib\*.png
                    263:   File annotlib\*.gif
                    264:   File annotlib\*.PRS
                    265:   File annotlib\*.STR
                    266:   File annotlib\*.TRA
                    267:   File annotlib\*.en
                    268: 
1.10      gully     269:   SetDetailsPrint textonly
                    270:   DetailPrint "Installing Amaya config files"
                    271:   SetDetailsPrint listonly
                    272: 
1.1       gully     273:   SetOutPath "$INSTDIR\config\libconfig"
                    274:   File config\libconfig\*.png
                    275:   File config\libconfig\*.svg
                    276:   File config\libconfig\*.css
                    277:   File config\libconfig\*.lhtml
                    278: 
                    279:   SetOutPath "$INSTDIR\config"
                    280:   File config\*-amayadialogue
                    281:   File config\*-libdialogue
                    282:   File config\*-amayamsg
                    283:   File config\*-libdialogue
                    284:   File config\lib_files.dat
                    285:   File config\fonts.*
                    286:   File config\amaya.kb
                    287:   File config\amaya.profiles
                    288:   File config\*.rdf
                    289:   File config\annot.schemas
                    290:   File config\win-thot.rc
                    291: 
1.10      gully     292:   SetDetailsPrint textonly
                    293:   DetailPrint "Installing Amaya dictionnaries"
                    294:   SetDetailsPrint listonly
                    295: 
1.1       gully     296:   SetOutPath "$INSTDIR\dicopar"
                    297:   File dicopar\alphabet
                    298:   File dicopar\*.ptn
                    299:   File dicopar\clavier
                    300:   File dicopar\*.dic
                    301: 
1.10      gully     302:   SetDetailsPrint textonly
                    303:   DetailPrint "Installing Amaya documentation"
                    304:   SetDetailsPrint listonly
                    305: 
1.16      gully     306:   SetOutPath "$INSTDIR\doc\WX"
                    307:   File doc\WX\*
                    308:   SetOutPath "$INSTDIR\doc\WX\HTML-elements"
                    309:   File doc\WX\HTML-elements\*
1.1       gully     310:   SetOutPath "$INSTDIR\doc\html"
                    311:   File doc\html\*
1.4       gully     312:   SetOutPath "$INSTDIR\doc\html\accessibility_in_amaya"
1.1       gully     313:   File doc\html\accessibility_in_amaya\*
1.4       gully     314:   SetOutPath "$INSTDIR\doc\html\attaching_annotations"
1.1       gully     315:   File doc\html\attaching_annotations\*
1.4       gully     316:   SetOutPath "$INSTDIR\doc\html\browsing"
1.1       gully     317:   File doc\html\browsing\*
1.4       gully     318:   SetOutPath "$INSTDIR\doc\html\configuring_amaya"
1.1       gully     319:   File doc\html\configuring_amaya\*
1.4       gully     320:   SetOutPath "$INSTDIR\doc\html\editing_attributes"
1.1       gully     321:   File doc\html\editing_attributes\*
1.4       gully     322:   SetOutPath "$INSTDIR\doc\html\editing_documents"
1.1       gully     323:   File doc\html\editing_documents\*
1.4       gully     324:   SetOutPath "$INSTDIR\doc\html\editing_iso-latin-1_characters"
1.1       gully     325:   File doc\html\editing_iso-latin-1_characters\*
1.4       gully     326:   SetOutPath "$INSTDIR\doc\html\editing_mathematics"
1.1       gully     327:   File doc\html\editing_mathematics\*
1.4       gully     328:   SetOutPath "$INSTDIR\doc\html\editing_tables"
1.1       gully     329:   File doc\html\editing_tables\*
1.4       gully     330:   SetOutPath "$INSTDIR\doc\html\elements"
1.1       gully     331:   File doc\html\elements\*
1.4       gully     332:   SetOutPath "$INSTDIR\doc\html\HTML-elements"
1.1       gully     333:   File doc\html\HTML-elements\*
1.4       gully     334:   SetOutPath "$INSTDIR\doc\html\linking"
1.1       gully     335:   File doc\html\linking\*
1.4       gully     336:   SetOutPath "$INSTDIR\doc\html\printing"
1.1       gully     337:   File doc\html\printing\*
1.4       gully     338:   SetOutPath "$INSTDIR\doc\html\saving_and_publishing_documents"
1.1       gully     339:   File doc\html\saving_and_publishing_documents\*
1.4       gully     340:   SetOutPath "$INSTDIR\doc\html\searching_and_replacing_text"
1.1       gully     341:   File doc\html\searching_and_replacing_text\*
1.4       gully     342:   SetOutPath "$INSTDIR\doc\html\selecting"
1.1       gully     343:   File doc\html\selecting\*
1.4       gully     344:   SetOutPath "$INSTDIR\doc\html\spell_checking"
1.1       gully     345:   File doc\html\spell_checking\*
1.4       gully     346:   SetOutPath "$INSTDIR\doc\html\style_sheets"
1.1       gully     347:   File doc\html\style_sheets\*
1.4       gully     348:   SetOutPath "$INSTDIR\doc\html\using_graphics"
1.1       gully     349:   File doc\html\using_graphics\*
1.4       gully     350:   SetOutPath "$INSTDIR\doc\html\using_image_maps"
1.1       gully     351:   File doc\html\using_image_maps\*
1.4       gully     352:   SetOutPath "$INSTDIR\doc\html\using_the_makebook_function"
1.1       gully     353:   File doc\html\using_the_makebook_function\*
1.4       gully     354:   SetOutPath "$INSTDIR\doc\html\using_xml"
1.1       gully     355:   File doc\html\using_xml\*
1.4       gully     356:   SetOutPath "$INSTDIR\doc\html\viewing"
1.1       gully     357:   File doc\html\viewing\*
                    358:   SetOutPath "$INSTDIR\doc\images"
                    359:   File doc\images\*
                    360: 
1.10      gully     361:   SetDetailsPrint textonly
                    362:   DetailPrint "Installing Amaya ttf fonts"
                    363:   SetDetailsPrint listonly
                    364: 
1.1       gully     365:   SetOutPath "$INSTDIR\fonts"
                    366:   File fonts\*
                    367: 
1.10      gully     368:   SetDetailsPrint textonly
                    369:   DetailPrint "Writting registry keys"
                    370:   SetDetailsPrint listonly
                    371: 
1.1       gully     372:   ;Store installation folder
1.10      gully     373:   WriteRegStr HKCU "Software\AmayaWX-debug" "" $INSTDIR 
                    374:   WriteRegExpandStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AmayaWX-debug" "UninstallString" '"$INSTDIR\Uninstall.exe"'
                    375:   WriteRegExpandStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AmayaWX-debug" "InstallLocation" "$INSTDIR"
                    376:   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AmayaWX-debug" "DisplayName" "Amaya"
1.11      gully     377:   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AmayaWX-debug" "DisplayIcon" "$INSTDIR\WindowsWX\bin\amaya.exe"
1.10      gully     378:   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AmayaWX-debug" "DisplayVersion" "${VERSION}"
                    379:   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AmayaWX-debug" "URLInfoAbout" "http://www.w3.org/Amaya"
                    380: 
1.11      gully     381:   ; Associate files to amaya
                    382:   WriteRegStr HKCR "Amaya" "" "Amaya Files"
                    383:   WriteRegStr HKCR "Amaya\DefaultIcon" "" "$INSTDIR\WindowsWX\bin\amaya.exe"
                    384:   ReadRegStr $R0 HKCR "Amaya\shell\open\command" ""
                    385:   StrCmp $R0 "" 0 no_amayaopen
                    386:     WriteRegStr HKCR "Amaya\shell" "" "open"
                    387:     WriteRegStr HKCR "Amaya\shell\open\command" "" '"$INSTDIR\WindowsWX\bin\amaya.exe" "%1"'
                    388:   no_amayaopen:
                    389: 
1.1       gully     390:   ;Create uninstaller
                    391:   WriteUninstaller "$INSTDIR\Uninstall.exe"
                    392: 
                    393:   ;Start Menu
                    394:   !insertmacro MUI_STARTMENU_WRITE_BEGIN Application   
                    395:     ;Create shortcuts
                    396:     CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
                    397:     CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
                    398:     CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Amaya.lnk" "$INSTDIR\WindowsWX\bin\amaya.exe"
                    399:   !insertmacro MUI_STARTMENU_WRITE_END
                    400: 
1.3       gully     401:   ;Create desktop link
                    402:   CreateShortCut "$DESKTOP\AmayaWX.lnk" "$INSTDIR\WindowsWX\bin\amaya.exe"
1.1       gully     403: SectionEnd
                    404: 
1.11      gully     405: 
                    406: SubSection "File association" SecFileAss
                    407: 
1.21      gully     408: ; --> .html
1.19      cvs       409: Section /o ".html (HyperText Markup Language)" SecAssHTML
1.21      gully     410:   ReadRegStr $R0 HKCR ".html" ""
                    411:   StrCmp $R0 "Amaya" allready_amaya no_amaya
                    412:   no_amaya:
                    413:     WriteRegStr HKCR ".html" "AM_OLD_VALUE" $R0
                    414:     WriteRegStr HKCR ".html" "" "Amaya"
                    415:   allready_amaya:
1.11      gully     416: SectionEnd
                    417: 
1.21      gully     418: ; --> .htm
                    419: Section /o ".htm (HyperText Markup Language)" SecAssHTM
                    420:   ReadRegStr $R0 HKCR ".htm" ""
                    421:   StrCmp $R0 "Amaya" allready_amaya no_amaya
                    422:   no_amaya:
                    423:     WriteRegStr HKCR ".htm" "AM_OLD_VALUE" $R0
                    424:     WriteRegStr HKCR ".htm" "" "Amaya"
                    425:   allready_amaya:
                    426: SectionEnd
                    427: 
                    428: ; --> .xml
1.19      cvs       429: Section /o ".xml (eXtensible Markup Language)" SecAssXML
1.21      gully     430:   ReadRegStr $R0 HKCR ".xml" ""
                    431:   StrCmp $R0 "Amaya" allready_amaya no_amaya
                    432:   no_amaya:
                    433:     WriteRegStr HKCR ".xml" "AM_OLD_VALUE" $R0
                    434:     WriteRegStr HKCR ".xml" "" "Amaya"
                    435:   allready_amaya:
1.11      gully     436: SectionEnd
                    437: 
1.21      gully     438: ; --> .svg
1.19      cvs       439: Section /o ".svg (Scalable Vector Graphics)" SecAssSVG
1.21      gully     440:   ReadRegStr $R0 HKCR ".svg" ""
                    441:   StrCmp $R0 "Amaya" allready_amaya no_amaya
                    442:   no_amaya:
                    443:     WriteRegStr HKCR ".svg" "AM_OLD_VALUE" $R0
                    444:     WriteRegStr HKCR ".svg" "" "Amaya"
                    445:   allready_amaya:
1.11      gully     446: SectionEnd
                    447: 
1.21      gully     448: ; --> .mml
1.19      cvs       449: Section /o ".mml (MathML)" SecAssMML
1.21      gully     450:   ReadRegStr $R0 HKCR ".mml" ""
                    451:   StrCmp $R0 "Amaya" allready_amaya no_amaya
                    452:   no_amaya:
                    453:     WriteRegStr HKCR ".mml" "AM_OLD_VALUE" $R0
                    454:     WriteRegStr HKCR ".mml" "" "Amaya"
                    455:   allready_amaya:
1.11      gully     456: SectionEnd
                    457: 
1.21      gully     458: ; --> .css
1.19      cvs       459: Section /o ".css (Cascading Style Sheets)" SecAssCSS
1.21      gully     460:   ReadRegStr $R0 HKCR ".css" ""
                    461:   StrCmp $R0 "Amaya" allready_amaya no_amaya
                    462:   no_amaya:
                    463:     WriteRegStr HKCR ".css" "AM_OLD_VALUE" $R0
                    464:     WriteRegStr HKCR ".css" "" "Amaya"
                    465:   allready_amaya:
1.11      gully     466: SectionEnd
                    467: 
                    468: SubSectionEnd
                    469: 
1.1       gully     470: ;--------------------------------
                    471: ;Installer Functions
                    472: 
                    473: Function .onInit
                    474: 
                    475:   !insertmacro MUI_LANGDLL_DISPLAY
                    476: 
                    477: FunctionEnd
                    478: 
                    479: ;--------------------------------
                    480: ;Descriptions
                    481: 
                    482:   ;USE A LANGUAGE STRING IF YOU WANT YOUR DESCRIPTIONS TO BE LANGAUGE SPECIFIC
                    483: 
                    484:   ;Assign descriptions to sections
                    485:   !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
1.21      gully     486:     !insertmacro MUI_DESCRIPTION_TEXT ${SecAmaya} "Install main Amaya program (mandatory)."
1.18      gully     487:     !insertmacro MUI_DESCRIPTION_TEXT ${SecFileAss} "Selects Amaya as the default application for files of these types."
1.1       gully     488:   !insertmacro MUI_FUNCTION_DESCRIPTION_END
                    489:  
                    490: ;--------------------------------
                    491: ;Uninstaller Section
                    492: 
                    493: Section "Uninstall"
                    494: 
1.10      gully     495:   SetDetailsPrint textonly
                    496:   DetailPrint "Uninstalling Amaya..."
                    497:   SetDetailsPrint listonly
                    498: 
                    499:   IfFileExists $INSTDIR\WindowsWX\bin\amaya.exe amaya_installed
                    500:     MessageBox MB_YESNO "It does not appear that Amaya is installed in the directory '$INSTDIR'.$\r$\nContinue anyway (not recommended)?" IDYES amaya_installed
                    501:     Abort "Uninstall aborted by user"
                    502:   amaya_installed:
                    503: 
                    504: 
                    505:   SetDetailsPrint textonly
                    506:   DetailPrint "Deleting Files..."
                    507:   SetDetailsPrint listonly
                    508: 
                    509:   ReadRegStr $STARTMENU_FOLDER HKCU "Software\AmayaWX-debug" "Start Menu Folder"
                    510:   IfFileExists "$SMPROGRAMS\$STARTMENU_FOLDER\Amaya.lnk" amaya_smp_installed
                    511:     Goto amaya_smp_notinstalled
                    512:   amaya_smp_installed:
                    513:     Delete "$SMPROGRAMS\$STARTMENU_FOLDER\Amaya.lnk"
                    514:     Delete "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk"
                    515:     RMDir  "$SMPROGRAMS\$STARTMENU_FOLDER"
                    516:     Delete "$DESKTOP\AmayaWX.lnk"
                    517:   amaya_smp_notinstalled:
1.1       gully     518: 
                    519:   RMDir /r "$INSTDIR"
                    520: 
1.10      gully     521:   SetDetailsPrint textonly
                    522:   DetailPrint "Deleting Registry Keys..."
                    523:   SetDetailsPrint listonly
1.1       gully     524: 
1.10      gully     525:   DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AmayaWX-debug"
                    526:   DeleteRegKey HKLM "Software\AmayaWX-debug"
1.11      gully     527:   DeleteRegKey HKCR "Amaya"
1.17      gully     528:   DeleteRegKey HKCU "Software\AmayaWX-debug"
1.1       gully     529: 
1.21      gully     530:   ; uninstall files associations
                    531:   ; --> .html
                    532:   ReadRegStr $R0 HKCR ".html" ""
                    533:   StrCmp $R0 "Amaya" 0 +3
                    534:     ReadRegStr $R0 HKCR ".html" "AM_OLD_VALUE"
                    535:     WriteRegStr HKCR ".html" "" $R0
                    536:   ; --> .htm
                    537:   ReadRegStr $R0 HKCR ".htm" ""
                    538:   StrCmp $R0 "Amaya" 0 +3
                    539:     ReadRegStr $R0 HKCR ".htm" "AM_OLD_VALUE"
                    540:     WriteRegStr HKCR ".htm" "" $R0
                    541:   ; --> .css
                    542:   ReadRegStr $R0 HKCR ".css" ""
                    543:   StrCmp $R0 "Amaya" 0 +3
                    544:     ReadRegStr $R0 HKCR ".css" "AM_OLD_VALUE"
                    545:     WriteRegStr HKCR ".css" "" $R0
                    546:   ; --> .svg
                    547:   ReadRegStr $R0 HKCR ".svg" ""
                    548:   StrCmp $R0 "Amaya" 0 +3
                    549:     ReadRegStr $R0 HKCR ".svg" "AM_OLD_VALUE"
                    550:     WriteRegStr HKCR ".svg" "" $R0
                    551:   ; --> .mml
                    552:   ReadRegStr $R0 HKCR ".mml" ""
                    553:   StrCmp $R0 "Amaya" 0 +3
                    554:     ReadRegStr $R0 HKCR ".mml" "AM_OLD_VALUE"
                    555:     WriteRegStr HKCR ".mml" "" $R0
                    556:   ; --> .xml
                    557:   ReadRegStr $R0 HKCR ".xml" ""
                    558:   StrCmp $R0 "Amaya" 0 +3
                    559:     ReadRegStr $R0 HKCR ".xml" "AM_OLD_VALUE"
                    560:     WriteRegStr HKCR ".xml" "" $R0
                    561: 
1.1       gully     562: SectionEnd
                    563: 
                    564: ;--------------------------------
                    565: ;Uninstaller Functions
                    566: 
                    567: Function un.onInit
                    568: 
                    569:   !insertmacro MUI_UNGETLANGUAGE
                    570:   
                    571: FunctionEnd

Webmaster