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

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

Webmaster