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

1.1       gully       1: ;--------------------------------
                      2: ;Include Modern UI
                      3: 
                      4:   !include "MUI.nsh"
                      5: 
                      6: ;--------------------------------
                      7: ;General
                      8: 
                      9:   ;Name and file
1.7     ! gully      10:   !define VERSION "9.0-pre4"
1.1       gully      11:   Name "Amaya WX ${VERSION}"
                     12:   OutFile "Amaya-WX-${VERSION}.exe"
                     13:   
                     14:   ;Use lzma to compress (better than zip)
                     15:   SetCompressor lzma
                     16: 
                     17:   ;Default installation folder
1.2       gully      18:   InstallDir "$PROGRAMFILES\AmayaWX"
1.1       gully      19:   
                     20:   ;Get installation folder from registry if available
1.2       gully      21:   InstallDirRegKey HKCU "Software\AmayaWX" ""
1.1       gully      22: 
                     23: 
                     24: ;--------------------------------
                     25: ;Variables
                     26: 
1.3       gully      27: 
1.1       gully      28:   Var STARTMENU_FOLDER
                     29: 
                     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" 
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" 
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
                     57:   
                     58:   !insertmacro MUI_UNPAGE_CONFIRM
                     59:   !insertmacro MUI_UNPAGE_INSTFILES
                     60: 
                     61: ;--------------------------------
                     62: ;Languages
                     63: 
                     64:   !insertmacro MUI_LANGUAGE "English"
                     65:   !insertmacro MUI_LANGUAGE "French"
                     66:   !insertmacro MUI_LANGUAGE "German"
                     67:   !insertmacro MUI_LANGUAGE "Spanish"
                     68: ;  !insertmacro MUI_LANGUAGE "SimpChinese"
                     69: ;  !insertmacro MUI_LANGUAGE "TradChinese"
                     70: ;  !insertmacro MUI_LANGUAGE "Japanese"
                     71: ;  !insertmacro MUI_LANGUAGE "Korean"
                     72: ;  !insertmacro MUI_LANGUAGE "Italian"
                     73: ;  !insertmacro MUI_LANGUAGE "Dutch"
                     74: ;  !insertmacro MUI_LANGUAGE "Danish"
                     75: ;  !insertmacro MUI_LANGUAGE "Swedish"
                     76: ;  !insertmacro MUI_LANGUAGE "Norwegian"
                     77: ;  !insertmacro MUI_LANGUAGE "Finnish"
                     78: ;  !insertmacro MUI_LANGUAGE "Greek"
                     79:   !insertmacro MUI_LANGUAGE "Russian"
                     80:   !insertmacro MUI_LANGUAGE "Portuguese"
                     81: ;  !insertmacro MUI_LANGUAGE "PortugueseBR"
                     82: ;  !insertmacro MUI_LANGUAGE "Polish"
                     83: ;  !insertmacro MUI_LANGUAGE "Ukrainian"
                     84: ;  !insertmacro MUI_LANGUAGE "Czech"
                     85: ;  !insertmacro MUI_LANGUAGE "Slovak"
                     86: ;  !insertmacro MUI_LANGUAGE "Croatian"
                     87: ;  !insertmacro MUI_LANGUAGE "Bulgarian"
                     88: ;  !insertmacro MUI_LANGUAGE "Hungarian"
                     89: ;  !insertmacro MUI_LANGUAGE "Thai"
                     90: ;  !insertmacro MUI_LANGUAGE "Romanian"
                     91: ;  !insertmacro MUI_LANGUAGE "Latvian"
                     92: ;  !insertmacro MUI_LANGUAGE "Macedonian"
                     93: ;  !insertmacro MUI_LANGUAGE "Estonian"
                     94:   !insertmacro MUI_LANGUAGE "Turkish"
                     95: ;  !insertmacro MUI_LANGUAGE "Lithuanian"
                     96: ;  !insertmacro MUI_LANGUAGE "Catalan"
                     97: ;  !insertmacro MUI_LANGUAGE "Slovenian"
                     98: ;  !insertmacro MUI_LANGUAGE "Serbian"
                     99: ;  !insertmacro MUI_LANGUAGE "SerbianLatin"
                    100: ;  !insertmacro MUI_LANGUAGE "Arabic"
                    101: ;  !insertmacro MUI_LANGUAGE "Farsi"
                    102: ;  !insertmacro MUI_LANGUAGE "Hebrew"
                    103: ;  !insertmacro MUI_LANGUAGE "Indonesian"
                    104: ;  !insertmacro MUI_LANGUAGE "Mongolian"
                    105: ;  !insertmacro MUI_LANGUAGE "Luxembourgish"
                    106: ;  !insertmacro MUI_LANGUAGE "Albanian"
                    107: 
                    108: ;--------------------------------
                    109: ;Reserve Files
                    110:   
                    111:   ;These files should be inserted before other files in the data block
                    112:   ;Keep these lines before any File command
                    113:   ;Only for solid compression (by default, solid compression is enabled for BZIP2 and LZMA)
                    114:   
                    115:   !insertmacro MUI_RESERVEFILE_LANGDLL
                    116: 
                    117: ;--------------------------------
                    118: ;Installer Sections
                    119: 
                    120: Section "Amaya" SecAmaya
                    121: 
                    122:   ;This section is required : readonly mode
                    123:   SectionIn RO
                    124: 
                    125:   SetOutPath "$INSTDIR\WindowsWX\bin"
                    126:   File WindowsWX\bin\amaya.exe
                    127:   File WindowsWX\bin\wxmsw*u_xrc_vc_custom.dll
                    128:   File WindowsWX\bin\wxmsw*u_html_vc_custom.dll
                    129:   File WindowsWX\bin\wxmsw*u_core_vc_custom.dll
                    130:   File WindowsWX\bin\wxmsw*u_adv_vc_custom.dll
                    131:   File WindowsWX\bin\wxmsw*u_gl_vc_custom.dll
                    132:   File WindowsWX\bin\wxbase*u_vc_custom.dll
                    133:   File WindowsWX\bin\wxbase*u_xml_vc_custom.dll
                    134: ;  File WindowsWX\bin\thotprinter.exe
                    135: 
                    136: 
                    137:   SetOutPath "$INSTDIR\resources\icons"
                    138:   File resources\icons\*.png
1.6       gully     139:   File resources\icons\*.gif
1.1       gully     140:   SetOutPath "$INSTDIR\resources\xrc"
                    141:   File resources\xrc\*.xrc
                    142: 
                    143: 
                    144:   SetOutPath "$INSTDIR\amaya"
                    145:   File amaya\COPYRIGHT
                    146:   File amaya\*.png
                    147:   File amaya\*.gif
                    148:   File amaya\*.css
                    149:   File amaya\*.html*
                    150:   File amaya\*.PRS
                    151:   File amaya\*.STR
                    152:   File amaya\*.TRA
                    153:   File amaya\*.conf
                    154:   File amaya\*.en
                    155:   File amaya\*.trans*
                    156:   File amaya\*.ico
                    157:   File amaya\*.svg
                    158: 
                    159:   SetOutPath "$INSTDIR\annotlib"
                    160:   File annotlib\*.png
                    161:   File annotlib\*.gif
                    162:   File annotlib\*.PRS
                    163:   File annotlib\*.STR
                    164:   File annotlib\*.TRA
                    165:   File annotlib\*.en
                    166: 
                    167:   SetOutPath "$INSTDIR\config\libconfig"
                    168:   File config\libconfig\*.png
                    169:   File config\libconfig\*.svg
                    170:   File config\libconfig\*.css
                    171:   File config\libconfig\*.lhtml
                    172: 
                    173:   SetOutPath "$INSTDIR\config"
                    174:   File config\*-amayadialogue
                    175:   File config\*-libdialogue
                    176:   File config\*-amayamsg
                    177:   File config\*-libdialogue
                    178:   File config\lib_files.dat
                    179:   File config\fonts.*
                    180:   File config\amaya.kb
                    181:   File config\amaya.profiles
                    182:   File config\*.rdf
                    183:   File config\annot.schemas
                    184:   File config\win-thot.rc
                    185: 
                    186:   SetOutPath "$INSTDIR\dicopar"
                    187:   File dicopar\alphabet
                    188:   File dicopar\*.ptn
                    189:   File dicopar\clavier
                    190:   File dicopar\*.dic
                    191: 
                    192:   SetOutPath "$INSTDIR\doc\html"
                    193:   File doc\html\*
1.4       gully     194:   SetOutPath "$INSTDIR\doc\html\accessibility_in_amaya"
1.1       gully     195:   File doc\html\accessibility_in_amaya\*
1.4       gully     196:   SetOutPath "$INSTDIR\doc\html\attaching_annotations"
1.1       gully     197:   File doc\html\attaching_annotations\*
1.4       gully     198:   SetOutPath "$INSTDIR\doc\html\browsing"
1.1       gully     199:   File doc\html\browsing\*
1.4       gully     200:   SetOutPath "$INSTDIR\doc\html\configuring_amaya"
1.1       gully     201:   File doc\html\configuring_amaya\*
1.4       gully     202:   SetOutPath "$INSTDIR\doc\html\editing_attributes"
1.1       gully     203:   File doc\html\editing_attributes\*
1.4       gully     204:   SetOutPath "$INSTDIR\doc\html\editing_documents"
1.1       gully     205:   File doc\html\editing_documents\*
1.4       gully     206:   SetOutPath "$INSTDIR\doc\html\editing_iso-latin-1_characters"
1.1       gully     207:   File doc\html\editing_iso-latin-1_characters\*
1.4       gully     208:   SetOutPath "$INSTDIR\doc\html\editing_mathematics"
1.1       gully     209:   File doc\html\editing_mathematics\*
1.4       gully     210:   SetOutPath "$INSTDIR\doc\html\editing_tables"
1.1       gully     211:   File doc\html\editing_tables\*
1.4       gully     212:   SetOutPath "$INSTDIR\doc\html\elements"
1.1       gully     213:   File doc\html\elements\*
1.4       gully     214:   SetOutPath "$INSTDIR\doc\html\HTML-elements"
1.1       gully     215:   File doc\html\HTML-elements\*
1.4       gully     216:   SetOutPath "$INSTDIR\doc\html\linking"
1.1       gully     217:   File doc\html\linking\*
1.4       gully     218:   SetOutPath "$INSTDIR\doc\html\printing"
1.1       gully     219:   File doc\html\printing\*
1.4       gully     220:   SetOutPath "$INSTDIR\doc\html\saving_and_publishing_documents"
1.1       gully     221:   File doc\html\saving_and_publishing_documents\*
1.4       gully     222:   SetOutPath "$INSTDIR\doc\html\searching_and_replacing_text"
1.1       gully     223:   File doc\html\searching_and_replacing_text\*
1.4       gully     224:   SetOutPath "$INSTDIR\doc\html\selecting"
1.1       gully     225:   File doc\html\selecting\*
1.4       gully     226:   SetOutPath "$INSTDIR\doc\html\spell_checking"
1.1       gully     227:   File doc\html\spell_checking\*
1.4       gully     228:   SetOutPath "$INSTDIR\doc\html\style_sheets"
1.1       gully     229:   File doc\html\style_sheets\*
1.4       gully     230:   SetOutPath "$INSTDIR\doc\html\using_graphics"
1.1       gully     231:   File doc\html\using_graphics\*
1.4       gully     232:   SetOutPath "$INSTDIR\doc\html\using_image_maps"
1.1       gully     233:   File doc\html\using_image_maps\*
1.4       gully     234:   SetOutPath "$INSTDIR\doc\html\using_the_makebook_function"
1.1       gully     235:   File doc\html\using_the_makebook_function\*
1.4       gully     236:   SetOutPath "$INSTDIR\doc\html\using_xml"
1.1       gully     237:   File doc\html\using_xml\*
1.4       gully     238:   SetOutPath "$INSTDIR\doc\html\viewing"
1.1       gully     239:   File doc\html\viewing\*
                    240: 
                    241:   SetOutPath "$INSTDIR\doc\images"
                    242:   File doc\images\*
                    243: 
                    244:   SetOutPath "$INSTDIR\fonts"
                    245:   File fonts\*
                    246: 
                    247:   ;Store installation folder
1.2       gully     248:   WriteRegStr HKCU "Software\AmayaWX" "" $INSTDIR
1.1       gully     249:   
                    250:   ;Create uninstaller
                    251:   WriteUninstaller "$INSTDIR\Uninstall.exe"
                    252: 
                    253:   ;Start Menu
                    254:   !insertmacro MUI_STARTMENU_WRITE_BEGIN Application   
                    255:     ;Create shortcuts
                    256:     CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
                    257:     CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
                    258:     CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Amaya.lnk" "$INSTDIR\WindowsWX\bin\amaya.exe"
                    259:   !insertmacro MUI_STARTMENU_WRITE_END
                    260: 
1.3       gully     261:   ;Create desktop link
                    262:   CreateShortCut "$DESKTOP\AmayaWX.lnk" "$INSTDIR\WindowsWX\bin\amaya.exe"
1.1       gully     263: SectionEnd
                    264: 
                    265: ;--------------------------------
                    266: ;Installer Functions
                    267: 
                    268: Function .onInit
                    269: 
                    270:   !insertmacro MUI_LANGDLL_DISPLAY
                    271: 
                    272: FunctionEnd
                    273: 
                    274: ;--------------------------------
                    275: ;Descriptions
                    276: 
                    277:   ;USE A LANGUAGE STRING IF YOU WANT YOUR DESCRIPTIONS TO BE LANGAUGE SPECIFIC
                    278: 
                    279:   ;Assign descriptions to sections
                    280:   !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
                    281:     !insertmacro MUI_DESCRIPTION_TEXT ${SecAmaya} "Amaya."
                    282:   !insertmacro MUI_FUNCTION_DESCRIPTION_END
                    283: 
                    284:  
                    285: ;--------------------------------
                    286: ;Uninstaller Section
                    287: 
                    288: Section "Uninstall"
                    289: 
                    290:   Delete "$INSTDIR\Uninstall.exe"
                    291: 
                    292:   RMDir /r "$INSTDIR"
                    293: 
                    294:   ;Start Menu uninstall
1.3       gully     295: ;  !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP   
                    296: ;  Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk"
                    297: ;  ;Delete empty start menu parent diretories
                    298: ;  StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP"
                    299: ;  startMenuDeleteLoop:
                    300: ;    ClearErrors
                    301: ;    RMDir $MUI_TEMP
                    302: ;    GetFullPathName $MUI_TEMP "$MUI_TEMP\.."    
                    303: ;    IfErrors startMenuDeleteLoopDone
                    304: ;    StrCmp $MUI_TEMP $SMPROGRAMS startMenuDeleteLoopDone startMenuDeleteLoop
                    305: ;  startMenuDeleteLoopDone:
1.1       gully     306: 
1.5       gully     307:   Delete "$SMPROGRAMS\$STARTMENU_FOLDER\Amaya.lnk"
                    308:   Delete "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk"
                    309:   RMDir "$SMPROGRAMS\$STARTMENU_FOLDER"
1.3       gully     310:   Delete "$DESKTOP\AmayaWX.lnk"
1.1       gully     311: 
1.2       gully     312:   DeleteRegKey /ifempty HKCU "Software\AmayaWX"
1.1       gully     313: 
                    314: SectionEnd
                    315: 
                    316: ;--------------------------------
                    317: ;Uninstaller Functions
                    318: 
                    319: Function un.onInit
                    320: 
                    321:   !insertmacro MUI_UNGETLANGUAGE
                    322:   
                    323: FunctionEnd

Webmaster