Annotation of Amaya/amaya-wx_release.nsi, revision 1.47

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.46      vatton     11:   !define VERSION "11.3"
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.46      vatton     77:   !insertmacro MUI_LANGUAGE "Japanese"
1.1       gully      78: ;  !insertmacro MUI_LANGUAGE "Korean"
1.30      cvs        79:   !insertmacro MUI_LANGUAGE "Italian"
1.46      vatton     80:   !insertmacro MUI_LANGUAGE "Dutch"
1.1       gully      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:
1.38      vatton    160:      StrCpy $R1 $R0 3
                    161:      StrCpy $R0 'XP'
                    162:      Goto lbl_done
1.9       cvs       163:  
1.36      vatton    164: 
1.9       cvs       165:    lbl_done:
                    166:   ;XXXXXXXXXXXXXXXXXXXXXXXXXX
                    167: 
1.1       gully     168:   ;This section is required : readonly mode
                    169:   SectionIn RO
                    170: 
1.10      gully     171:   SetDetailsPrint textonly
                    172:   DetailPrint "Installing Amaya binaries and wxWidgets DLL"
                    173:   SetDetailsPrint listonly
                    174: 
1.1       gully     175:   SetOutPath "$INSTDIR\WindowsWX\bin"
                    176:   File WindowsWX\bin\amaya.exe
                    177:   File WindowsWX\bin\wxmsw*u_xrc_vc_custom.dll
                    178:   File WindowsWX\bin\wxmsw*u_html_vc_custom.dll
                    179:   File WindowsWX\bin\wxmsw*u_core_vc_custom.dll
                    180:   File WindowsWX\bin\wxmsw*u_adv_vc_custom.dll
1.39      vatton    181:   File WindowsWX\bin\wxmsw*u_aui_vc_custom.dll
1.1       gully     182:   File WindowsWX\bin\wxmsw*u_gl_vc_custom.dll
                    183:   File WindowsWX\bin\wxbase*u_vc_custom.dll
1.35      cvs       184:   File WindowsWX\bin\wxbase*u_net_vc_custom.dll
1.1       gully     185:   File WindowsWX\bin\wxbase*u_xml_vc_custom.dll
1.21      cvs       186:   File WindowsWX\bin\thotprinter.dll
1.1       gully     187: 
1.10      gully     188:   SetDetailsPrint textonly
                    189:   DetailPrint "Installing Amaya resources : icons, dialogues"
                    190:   SetDetailsPrint listonly
1.1       gully     191: 
1.14      gully     192:   SetOutPath "$INSTDIR\resources\icons\misc"
                    193:   File resources\icons\misc\*.png
                    194:   File resources\icons\misc\*.gif
                    195:   File resources\icons\misc\*.ico
                    196:   SetOutPath "$INSTDIR\resources\icons\16x16"
                    197:   File resources\icons\16x16\*.png
                    198:   File resources\icons\16x16\*.ico
                    199:   SetOutPath "$INSTDIR\resources\icons\22x22"
                    200:   File resources\icons\22x22\*.png
1.42      vatton    201:   SetOutPath "$INSTDIR\resources\svg"
                    202:   File resources\svg\*.png
                    203:   File resources\svg\*.svg
                    204:   SetOutPath "$INSTDIR\resources\svg\balloons"
                    205:   File resources\svg\balloons\*.png
                    206:   File resources\svg\balloons\*.svg
                    207:   SetOutPath "$INSTDIR\resources\svg\block_arrows"
                    208:   File resources\svg\block_arrows\*.png
                    209:   File resources\svg\block_arrows\*.svg
                    210:   SetOutPath "$INSTDIR\resources\svg\chemistry"
                    211:   File resources\svg\chemistry\*.png
                    212:   File resources\svg\chemistry\*.svg
                    213:   SetOutPath "$INSTDIR\resources\svg\circuit_diagram"
                    214:   File resources\svg\circuit_diagram\*.png
                    215:   File resources\svg\circuit_diagram\*.svg
                    216:   SetOutPath "$INSTDIR\resources\svg\logic_gates"
                    217:   File resources\svg\logic_gates\*.png
                    218:   File resources\svg\logic_gates\*.svg
                    219:   SetOutPath "$INSTDIR\resources\svg\polygons_and_stars"
                    220:   File resources\svg\polygons_and_stars\*.png
                    221:   File resources\svg\polygons_and_stars\*.svg
1.1       gully     222:   SetOutPath "$INSTDIR\resources\xrc"
                    223:   File resources\xrc\*.xrc
1.29      cvs       224: 
1.33      cvs       225:   
1.11      gully     226:   SetOutPath "$INSTDIR\amaya\wxdialog"
                    227:   File amaya\wxdialog\appicon.ico
1.12      gully     228:   File amaya\wxdialog\amaya.rc
1.1       gully     229: 
1.10      gully     230:   SetDetailsPrint textonly
                    231:   DetailPrint "Installing Amaya schemas"
                    232:   SetDetailsPrint listonly
1.1       gully     233: 
                    234:   SetOutPath "$INSTDIR\amaya"
                    235:   File amaya\COPYRIGHT
                    236:   File amaya\*.png
                    237:   File amaya\*.gif
                    238:   File amaya\*.css
                    239:   File amaya\*.html*
                    240:   File amaya\*.PRS
                    241:   File amaya\*.STR
                    242:   File amaya\*.TRA
                    243:   File amaya\*.conf
                    244:   File amaya\*.en
                    245:   File amaya\*.trans*
                    246:   File amaya\*.ico
                    247:   File amaya\*.svg
                    248: 
1.10      gully     249:   SetDetailsPrint textonly
                    250:   DetailPrint "Installing annotlib schemas"
                    251:   SetDetailsPrint listonly
                    252: 
1.1       gully     253:   SetOutPath "$INSTDIR\annotlib"
                    254:   File annotlib\*.png
                    255:   File annotlib\*.gif
                    256:   File annotlib\*.PRS
                    257:   File annotlib\*.STR
                    258:   File annotlib\*.TRA
                    259:   File annotlib\*.en
                    260: 
1.10      gully     261:   SetDetailsPrint textonly
                    262:   DetailPrint "Installing Amaya config files"
                    263:   SetDetailsPrint listonly
                    264: 
1.1       gully     265: 
                    266:   SetOutPath "$INSTDIR\config"
                    267:   File config\*-amayadialogue
                    268:   File config\*-libdialogue
                    269:   File config\*-amayamsg
                    270:   File config\*-libdialogue
                    271:   File config\fonts.*
                    272:   File config\amaya.kb
                    273:   File config\amaya.profiles
                    274:   File config\*.rdf
1.37      vatton    275:   File config\*.css
1.1       gully     276:   File config\annot.schemas
                    277:   File config\win-thot.rc
1.41      vatton    278:   File config\rdfa.dat
                    279:   File config\rdfa_list.dat
1.1       gully     280: 
1.10      gully     281:   SetDetailsPrint textonly
                    282:   DetailPrint "Installing Amaya dictionnaries"
                    283:   SetDetailsPrint listonly
                    284: 
1.1       gully     285:   SetOutPath "$INSTDIR\dicopar"
                    286:   File dicopar\alphabet
                    287:   File dicopar\*.ptn
                    288:   File dicopar\clavier
                    289:   File dicopar\*.dic
                    290: 
1.10      gully     291:   SetDetailsPrint textonly
                    292:   DetailPrint "Installing Amaya documentation"
                    293:   SetDetailsPrint listonly
                    294: 
1.17      gully     295:   SetOutPath "$INSTDIR\doc\WX"
                    296:   File doc\WX\*
                    297:   SetOutPath "$INSTDIR\doc\WX\HTML-elements"
                    298:   File doc\WX\HTML-elements\*
1.1       gully     299:   SetOutPath "$INSTDIR\doc\images"
                    300:   File doc\images\*
                    301: 
1.10      gully     302:   SetDetailsPrint textonly
                    303:   DetailPrint "Installing Amaya ttf fonts"
                    304:   SetDetailsPrint listonly
                    305: 
1.1       gully     306:   SetOutPath "$INSTDIR\fonts"
                    307:   File fonts\*
                    308: 
1.10      gully     309:   SetDetailsPrint textonly
                    310:   DetailPrint "Writting registry keys"
                    311:   SetDetailsPrint listonly
                    312: 
1.1       gully     313:   ;Store installation folder
1.34      cvs       314:   WriteRegStr HKCU "Software\Amaya" "" $INSTDIR 
                    315:   WriteRegExpandStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Amaya" "UninstallString" '"$INSTDIR\Uninstall.exe"'
                    316:   WriteRegExpandStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Amaya" "InstallLocation" "$INSTDIR"
                    317:   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Amaya" "DisplayName" "Amaya"
                    318:   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Amaya" "DisplayIcon" "$INSTDIR\WindowsWX\bin\amaya.exe"
                    319:   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Amaya" "DisplayVersion" "${VERSION}"
                    320:   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Amaya" "URLInfoAbout" "http://www.w3.org/Amaya"
1.11      gully     321: 
                    322:   ; Associate files to amaya
                    323:   WriteRegStr HKCR "Amaya" "" "Amaya Files"
                    324:   WriteRegStr HKCR "Amaya\DefaultIcon" "" "$INSTDIR\WindowsWX\bin\amaya.exe"
                    325:   ReadRegStr $R0 HKCR "Amaya\shell\open\command" ""
                    326:   StrCmp $R0 "" 0 no_amayaopen
                    327:     WriteRegStr HKCR "Amaya\shell" "" "open"
                    328:     WriteRegStr HKCR "Amaya\shell\open\command" "" '"$INSTDIR\WindowsWX\bin\amaya.exe" "%1"'
                    329:   no_amayaopen:
1.1       gully     330:   
                    331:   ;Create uninstaller
                    332:   WriteUninstaller "$INSTDIR\Uninstall.exe"
                    333: 
1.26      gully     334:   ;Install Amaya for all users
                    335:   SetShellVarContext all
                    336: 
1.1       gully     337:   ;Start Menu
                    338:   !insertmacro MUI_STARTMENU_WRITE_BEGIN Application   
                    339:     ;Create shortcuts
                    340:     CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
                    341:     CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
                    342:     CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Amaya.lnk" "$INSTDIR\WindowsWX\bin\amaya.exe"
                    343:   !insertmacro MUI_STARTMENU_WRITE_END
                    344: 
1.3       gully     345:   ;Create desktop link
1.34      cvs       346:   CreateShortCut "$DESKTOP\Amaya.lnk" "$INSTDIR\WindowsWX\bin\amaya.exe"
1.46      vatton    347: 
                    348:   ;register extension files
                    349:   WriteRegStr HKCR ".xtd" "" "XTD"
                    350:   WriteRegStr HKCR ".xtl" "" "XTL"
                    351:   WriteRegStr HKCR ".svg" "" "SVG"
                    352:   WriteRegStr HKCR ".mml" "" "MML"
                    353:   WriteRegStr HKCR ".html" "" "HTML"
                    354:   WriteRegStr HKCR ".htm" "" "HTM"
1.47    ! vatton    355:   WriteRegStr HKCR "XTD\Shell\Action2" "" "edit"
1.46      vatton    356:   WriteRegStr HKCR "XTD\Shell\Action2\command" "" '$INSTDIR\WindowsWX\bin\amaya.exe "%1"'
1.47    ! vatton    357:   WriteRegStr HKCR "XTL\Shell\Action2" "" "edit"
1.46      vatton    358:   WriteRegStr HKCR "XTL\Shell\Action2\command" "" '$INSTDIR\WindowsWX\bin\amaya.exe "%1"'
1.47    ! vatton    359:   WriteRegStr HKCR "SVG\Shell\Action2" "" "edit"
1.46      vatton    360:   WriteRegStr HKCR "SVG\Shell\Action2\command" "" '$INSTDIR\WindowsWX\bin\amaya.exe "%1"'
1.47    ! vatton    361:   WriteRegStr HKCR "MML\Shell\Action2" "" "edit"
1.46      vatton    362:   WriteRegStr HKCR "MML\Shell\Action2\command" "" '$INSTDIR\WindowsWX\bin\amaya.exe "%1"'
1.47    ! vatton    363:   WriteRegStr HKCR "HTML\Shell\Action2" "" "edit"
1.46      vatton    364:   WriteRegStr HKCR "HTML\Shell\Action2\command" "" '$INSTDIR\WindowsWX\bin\amaya.exe "%1"'
1.47    ! vatton    365:   WriteRegStr HKCR "HTM\Shell\Action2" "" "edit"
1.46      vatton    366:   WriteRegStr HKCR "HTM\Shell\Action2\command" "" '$INSTDIR\WindowsWX\bin\amaya.exe "%1"'
1.1       gully     367: SectionEnd
                    368: 
1.11      gully     369: 
                    370: SubSection "File association" SecFileAss
                    371: 
1.22      gully     372: ; --> .html
1.20      cvs       373: Section /o ".html (HyperText Markup Language)" SecAssHTML
1.22      gully     374:   ReadRegStr $R0 HKCR ".html" ""
                    375:   StrCmp $R0 "Amaya" allready_amaya no_amaya
                    376:   no_amaya:
                    377:     WriteRegStr HKCR ".html" "AM_OLD_VALUE" $R0
1.11      gully     378:   WriteRegStr HKCR ".html" "" "Amaya"
1.22      gully     379:   allready_amaya:
1.11      gully     380: SectionEnd
                    381: 
1.22      gully     382: ; --> .htm
                    383: Section /o ".htm (HyperText Markup Language)" SecAssHTM
                    384:   ReadRegStr $R0 HKCR ".htm" ""
                    385:   StrCmp $R0 "Amaya" allready_amaya no_amaya
                    386:   no_amaya:
                    387:     WriteRegStr HKCR ".htm" "AM_OLD_VALUE" $R0
                    388:     WriteRegStr HKCR ".htm" "" "Amaya"
                    389:   allready_amaya:
                    390: SectionEnd
                    391: 
                    392: ; --> .xml
1.20      cvs       393: Section /o ".xml (eXtensible Markup Language)" SecAssXML
1.22      gully     394:   ReadRegStr $R0 HKCR ".xml" ""
                    395:   StrCmp $R0 "Amaya" allready_amaya no_amaya
                    396:   no_amaya:
                    397:     WriteRegStr HKCR ".xml" "AM_OLD_VALUE" $R0
1.11      gully     398:   WriteRegStr HKCR ".xml" "" "Amaya"
1.22      gully     399:   allready_amaya:
1.11      gully     400: SectionEnd
                    401: 
1.22      gully     402: ; --> .svg
1.20      cvs       403: Section /o ".svg (Scalable Vector Graphics)" SecAssSVG
1.22      gully     404:   ReadRegStr $R0 HKCR ".svg" ""
                    405:   StrCmp $R0 "Amaya" allready_amaya no_amaya
                    406:   no_amaya:
                    407:     WriteRegStr HKCR ".svg" "AM_OLD_VALUE" $R0
1.11      gully     408:   WriteRegStr HKCR ".svg" "" "Amaya"
1.22      gully     409:   allready_amaya:
1.11      gully     410: SectionEnd
                    411: 
1.22      gully     412: ; --> .mml
1.20      cvs       413: Section /o ".mml (MathML)" SecAssMML
1.22      gully     414:   ReadRegStr $R0 HKCR ".mml" ""
                    415:   StrCmp $R0 "Amaya" allready_amaya no_amaya
                    416:   no_amaya:
                    417:     WriteRegStr HKCR ".mml" "AM_OLD_VALUE" $R0
1.11      gully     418:   WriteRegStr HKCR ".mml" "" "Amaya"
1.22      gully     419:   allready_amaya:
1.11      gully     420: SectionEnd
                    421: 
1.22      gully     422: ; --> .css
1.20      cvs       423: Section /o ".css (Cascading Style Sheets)" SecAssCSS
1.22      gully     424:   ReadRegStr $R0 HKCR ".css" ""
                    425:   StrCmp $R0 "Amaya" allready_amaya no_amaya
                    426:   no_amaya:
                    427:     WriteRegStr HKCR ".css" "AM_OLD_VALUE" $R0
1.11      gully     428:   WriteRegStr HKCR ".css" "" "Amaya"
1.22      gully     429:   allready_amaya:
1.11      gully     430: SectionEnd
                    431: 
1.46      vatton    432: ; --> .xtd
                    433: Section /o ".xtd (XTiger Template)" SecAssXTD
                    434:   ReadRegStr $R0 HKCR ".xtd" ""
                    435:   StrCmp $R0 "Amaya" allready_amaya no_amaya
                    436:   no_amaya:
                    437:     WriteRegStr HKCR ".xtd" "AM_OLD_VALUE" $R0
                    438:   WriteRegStr HKCR ".xtd" "" "Amaya"
                    439:   allready_amaya:
                    440: SectionEnd
                    441: 
                    442: ; --> .xtl
                    443: Section /o ".xtl (XTiger Library)" SecAssXTL
                    444:   ReadRegStr $R0 HKCR ".xtl" ""
                    445:   StrCmp $R0 "Amaya" allready_amaya no_amaya
                    446:   no_amaya:
                    447:     WriteRegStr HKCR ".xtl" "AM_OLD_VALUE" $R0
                    448:   WriteRegStr HKCR ".xtl" "" "Amaya"
                    449:   allready_amaya:
                    450: SectionEnd
                    451: 
1.11      gully     452: SubSectionEnd
                    453: 
1.1       gully     454: ;--------------------------------
                    455: ;Installer Functions
                    456: 
                    457: Function .onInit
                    458: 
                    459:   !insertmacro MUI_LANGDLL_DISPLAY
                    460: 
                    461: FunctionEnd
                    462: 
                    463: ;--------------------------------
                    464: ;Descriptions
                    465: 
                    466:   ;USE A LANGUAGE STRING IF YOU WANT YOUR DESCRIPTIONS TO BE LANGAUGE SPECIFIC
                    467: 
                    468:   ;Assign descriptions to sections
                    469:   !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
1.22      gully     470:     !insertmacro MUI_DESCRIPTION_TEXT ${SecAmaya} "Install main Amaya program (mandatory)."
1.19      gully     471:     !insertmacro MUI_DESCRIPTION_TEXT ${SecFileAss} "Selects Amaya as the default application for files of these types."
1.1       gully     472:   !insertmacro MUI_FUNCTION_DESCRIPTION_END
                    473: 
                    474: ;--------------------------------
                    475: ;Uninstaller Section
                    476: 
                    477: Section "Uninstall"
                    478: 
1.10      gully     479:   SetDetailsPrint textonly
                    480:   DetailPrint "Uninstalling Amaya..."
                    481:   SetDetailsPrint listonly
                    482: 
                    483:   IfFileExists $INSTDIR\WindowsWX\bin\amaya.exe amaya_installed
                    484:     MessageBox MB_YESNO "It does not appear that Amaya is installed in the directory '$INSTDIR'.$\r$\nContinue anyway (not recommended)?" IDYES amaya_installed
                    485:     Abort "Uninstall aborted by user"
                    486:   amaya_installed:
                    487: 
                    488: 
                    489:   SetDetailsPrint textonly
                    490:   DetailPrint "Deleting Files..."
                    491:   SetDetailsPrint listonly
1.26      gully     492:   ;Uninstall Amaya for all users
                    493:   SetShellVarContext all
                    494:   
1.34      cvs       495:   ReadRegStr $STARTMENU_FOLDER HKCU "Software\Amaya" "Start Menu Folder"
1.10      gully     496:   IfFileExists "$SMPROGRAMS\$STARTMENU_FOLDER\Amaya.lnk" amaya_smp_installed
                    497:     Goto amaya_smp_notinstalled
                    498:   amaya_smp_installed:
1.5       gully     499:   Delete "$SMPROGRAMS\$STARTMENU_FOLDER\Amaya.lnk"
                    500:   Delete "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk"
                    501:   RMDir "$SMPROGRAMS\$STARTMENU_FOLDER"
1.34      cvs       502:   Delete "$DESKTOP\Amaya.lnk"
1.10      gully     503:   amaya_smp_notinstalled:
                    504: 
                    505:   RMDir /r "$INSTDIR"
                    506: 
                    507:   SetDetailsPrint textonly
                    508:   DetailPrint "Deleting Registry Keys..."
                    509:   SetDetailsPrint listonly
1.1       gully     510: 
1.34      cvs       511:   DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Amaya"
                    512:   DeleteRegKey HKLM "Software\Amaya"
1.11      gully     513:   DeleteRegKey HKCR "Amaya"
1.34      cvs       514:   DeleteRegKey HKCU "Software\Amaya"
1.22      gully     515:   ; uninstall files associations
                    516:   ; --> .html
                    517:   ReadRegStr $R0 HKCR ".html" ""
                    518:   StrCmp $R0 "Amaya" 0 +3
                    519:     ReadRegStr $R0 HKCR ".html" "AM_OLD_VALUE"
                    520:     WriteRegStr HKCR ".html" "" $R0
                    521:   ; --> .htm
                    522:   ReadRegStr $R0 HKCR ".htm" ""
                    523:   StrCmp $R0 "Amaya" 0 +3
                    524:     ReadRegStr $R0 HKCR ".htm" "AM_OLD_VALUE"
                    525:     WriteRegStr HKCR ".htm" "" $R0
                    526:   ; --> .css
                    527:   ReadRegStr $R0 HKCR ".css" ""
                    528:   StrCmp $R0 "Amaya" 0 +3
                    529:     ReadRegStr $R0 HKCR ".css" "AM_OLD_VALUE"
                    530:     WriteRegStr HKCR ".css" "" $R0
                    531:   ; --> .svg
                    532:   ReadRegStr $R0 HKCR ".svg" ""
                    533:   StrCmp $R0 "Amaya" 0 +3
                    534:     ReadRegStr $R0 HKCR ".svg" "AM_OLD_VALUE"
                    535:     WriteRegStr HKCR ".svg" "" $R0
                    536:   ; --> .mml
                    537:   ReadRegStr $R0 HKCR ".mml" ""
                    538:   StrCmp $R0 "Amaya" 0 +3
                    539:     ReadRegStr $R0 HKCR ".mml" "AM_OLD_VALUE"
                    540:     WriteRegStr HKCR ".mml" "" $R0
                    541:   ; --> .xml
                    542:   ReadRegStr $R0 HKCR ".xml" ""
                    543:   StrCmp $R0 "Amaya" 0 +3
                    544:     ReadRegStr $R0 HKCR ".xml" "AM_OLD_VALUE"
                    545:     WriteRegStr HKCR ".xml" "" $R0
1.46      vatton    546:   ; --> .xtd
                    547:   ReadRegStr $R0 HKCR ".xtd" ""
                    548:   StrCmp $R0 "Amaya" 0 +3
                    549:     ReadRegStr $R0 HKCR ".xtd" "AM_OLD_VALUE"
                    550:     WriteRegStr HKCR ".xtd" "" $R0
                    551:   ; --> .xtl
                    552:   ReadRegStr $R0 HKCR ".xtl" ""
                    553:   StrCmp $R0 "Amaya" 0 +3
                    554:     ReadRegStr $R0 HKCR ".xtl" "AM_OLD_VALUE"
                    555:     WriteRegStr HKCR ".xtl" "" $R0
1.1       gully     556: 
                    557: SectionEnd
                    558: 
                    559: ;--------------------------------
                    560: ;Uninstaller Functions
                    561: 
                    562: Function un.onInit
                    563: 
                    564:   !insertmacro MUI_UNGETLANGUAGE
                    565:   
                    566: FunctionEnd

Webmaster