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

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

Webmaster