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

1.1       gully       1: ;--------------------------------
                      2: ;Include Modern UI
                      3: 
                      4:   !include "MUI.nsh"
                      5: 
                      6: ;--------------------------------
                      7: ;General
                      8: 
                      9:   ;Name and file
1.5     ! gully      10:   !define VERSION "9.0-pre2"
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
                    139:   SetOutPath "$INSTDIR\resources\xrc"
                    140:   File resources\xrc\*.xrc
                    141: 
                    142: 
                    143:   SetOutPath "$INSTDIR\amaya"
                    144:   File amaya\COPYRIGHT
                    145:   File amaya\*.png
                    146:   File amaya\*.gif
                    147:   File amaya\*.css
                    148:   File amaya\*.html*
                    149:   File amaya\*.PRS
                    150:   File amaya\*.STR
                    151:   File amaya\*.TRA
                    152:   File amaya\*.conf
                    153:   File amaya\*.en
                    154:   File amaya\*.trans*
                    155:   File amaya\*.ico
                    156:   File amaya\*.svg
                    157: 
                    158:   SetOutPath "$INSTDIR\annotlib"
                    159:   File annotlib\*.png
                    160:   File annotlib\*.gif
                    161:   File annotlib\*.PRS
                    162:   File annotlib\*.STR
                    163:   File annotlib\*.TRA
                    164:   File annotlib\*.en
                    165: 
                    166:   SetOutPath "$INSTDIR\config\libconfig"
                    167:   File config\libconfig\*.png
                    168:   File config\libconfig\*.svg
                    169:   File config\libconfig\*.css
                    170:   File config\libconfig\*.lhtml
                    171: 
                    172:   SetOutPath "$INSTDIR\config"
                    173:   File config\*-amayadialogue
                    174:   File config\*-libdialogue
                    175:   File config\*-amayamsg
                    176:   File config\*-libdialogue
                    177:   File config\lib_files.dat
                    178:   File config\fonts.*
                    179:   File config\amaya.kb
                    180:   File config\amaya.profiles
                    181:   File config\*.rdf
                    182:   File config\annot.schemas
                    183:   File config\win-thot.rc
                    184: 
                    185:   SetOutPath "$INSTDIR\dicopar"
                    186:   File dicopar\alphabet
                    187:   File dicopar\*.ptn
                    188:   File dicopar\clavier
                    189:   File dicopar\*.dic
                    190: 
                    191:   SetOutPath "$INSTDIR\doc\html"
                    192:   File doc\html\*
1.4       gully     193:   SetOutPath "$INSTDIR\doc\html\accessibility_in_amaya"
1.1       gully     194:   File doc\html\accessibility_in_amaya\*
1.4       gully     195:   SetOutPath "$INSTDIR\doc\html\attaching_annotations"
1.1       gully     196:   File doc\html\attaching_annotations\*
1.4       gully     197:   SetOutPath "$INSTDIR\doc\html\browsing"
1.1       gully     198:   File doc\html\browsing\*
1.4       gully     199:   SetOutPath "$INSTDIR\doc\html\configuring_amaya"
1.1       gully     200:   File doc\html\configuring_amaya\*
1.4       gully     201:   SetOutPath "$INSTDIR\doc\html\editing_attributes"
1.1       gully     202:   File doc\html\editing_attributes\*
1.4       gully     203:   SetOutPath "$INSTDIR\doc\html\editing_documents"
1.1       gully     204:   File doc\html\editing_documents\*
1.4       gully     205:   SetOutPath "$INSTDIR\doc\html\editing_iso-latin-1_characters"
1.1       gully     206:   File doc\html\editing_iso-latin-1_characters\*
1.4       gully     207:   SetOutPath "$INSTDIR\doc\html\editing_mathematics"
1.1       gully     208:   File doc\html\editing_mathematics\*
1.4       gully     209:   SetOutPath "$INSTDIR\doc\html\editing_tables"
1.1       gully     210:   File doc\html\editing_tables\*
1.4       gully     211:   SetOutPath "$INSTDIR\doc\html\elements"
1.1       gully     212:   File doc\html\elements\*
1.4       gully     213:   SetOutPath "$INSTDIR\doc\html\HTML-elements"
1.1       gully     214:   File doc\html\HTML-elements\*
1.4       gully     215:   SetOutPath "$INSTDIR\doc\html\linking"
1.1       gully     216:   File doc\html\linking\*
1.4       gully     217:   SetOutPath "$INSTDIR\doc\html\printing"
1.1       gully     218:   File doc\html\printing\*
1.4       gully     219:   SetOutPath "$INSTDIR\doc\html\saving_and_publishing_documents"
1.1       gully     220:   File doc\html\saving_and_publishing_documents\*
1.4       gully     221:   SetOutPath "$INSTDIR\doc\html\searching_and_replacing_text"
1.1       gully     222:   File doc\html\searching_and_replacing_text\*
1.4       gully     223:   SetOutPath "$INSTDIR\doc\html\selecting"
1.1       gully     224:   File doc\html\selecting\*
1.4       gully     225:   SetOutPath "$INSTDIR\doc\html\spell_checking"
1.1       gully     226:   File doc\html\spell_checking\*
1.4       gully     227:   SetOutPath "$INSTDIR\doc\html\style_sheets"
1.1       gully     228:   File doc\html\style_sheets\*
1.4       gully     229:   SetOutPath "$INSTDIR\doc\html\using_graphics"
1.1       gully     230:   File doc\html\using_graphics\*
1.4       gully     231:   SetOutPath "$INSTDIR\doc\html\using_image_maps"
1.1       gully     232:   File doc\html\using_image_maps\*
1.4       gully     233:   SetOutPath "$INSTDIR\doc\html\using_the_makebook_function"
1.1       gully     234:   File doc\html\using_the_makebook_function\*
1.4       gully     235:   SetOutPath "$INSTDIR\doc\html\using_xml"
1.1       gully     236:   File doc\html\using_xml\*
1.4       gully     237:   SetOutPath "$INSTDIR\doc\html\viewing"
1.1       gully     238:   File doc\html\viewing\*
                    239: 
                    240:   SetOutPath "$INSTDIR\doc\images"
                    241:   File doc\images\*
                    242: 
                    243:   SetOutPath "$INSTDIR\fonts"
                    244:   File fonts\*
                    245: 
                    246:   ;Store installation folder
1.2       gully     247:   WriteRegStr HKCU "Software\AmayaWX" "" $INSTDIR
1.1       gully     248:   
                    249:   ;Create uninstaller
                    250:   WriteUninstaller "$INSTDIR\Uninstall.exe"
                    251: 
                    252:   ;Start Menu
                    253:   !insertmacro MUI_STARTMENU_WRITE_BEGIN Application   
                    254:     ;Create shortcuts
                    255:     CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
                    256:     CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
                    257:     CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Amaya.lnk" "$INSTDIR\WindowsWX\bin\amaya.exe"
                    258:   !insertmacro MUI_STARTMENU_WRITE_END
                    259: 
1.3       gully     260:   ;Create desktop link
                    261:   CreateShortCut "$DESKTOP\AmayaWX.lnk" "$INSTDIR\WindowsWX\bin\amaya.exe"
1.1       gully     262: SectionEnd
                    263: 
                    264: ;--------------------------------
                    265: ;Installer Functions
                    266: 
                    267: Function .onInit
                    268: 
                    269:   !insertmacro MUI_LANGDLL_DISPLAY
                    270: 
                    271: FunctionEnd
                    272: 
                    273: ;--------------------------------
                    274: ;Descriptions
                    275: 
                    276:   ;USE A LANGUAGE STRING IF YOU WANT YOUR DESCRIPTIONS TO BE LANGAUGE SPECIFIC
                    277: 
                    278:   ;Assign descriptions to sections
                    279:   !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
                    280:     !insertmacro MUI_DESCRIPTION_TEXT ${SecAmaya} "Amaya."
                    281:   !insertmacro MUI_FUNCTION_DESCRIPTION_END
                    282: 
                    283:  
                    284: ;--------------------------------
                    285: ;Uninstaller Section
                    286: 
                    287: Section "Uninstall"
                    288: 
                    289:   Delete "$INSTDIR\Uninstall.exe"
                    290: 
                    291:   RMDir /r "$INSTDIR"
                    292: 
                    293:   ;Start Menu uninstall
1.3       gully     294: ;  !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP   
                    295: ;  Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk"
                    296: ;  ;Delete empty start menu parent diretories
                    297: ;  StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP"
                    298: ;  startMenuDeleteLoop:
                    299: ;    ClearErrors
                    300: ;    RMDir $MUI_TEMP
                    301: ;    GetFullPathName $MUI_TEMP "$MUI_TEMP\.."    
                    302: ;    IfErrors startMenuDeleteLoopDone
                    303: ;    StrCmp $MUI_TEMP $SMPROGRAMS startMenuDeleteLoopDone startMenuDeleteLoop
                    304: ;  startMenuDeleteLoopDone:
1.1       gully     305: 
1.5     ! gully     306:   Delete "$SMPROGRAMS\$STARTMENU_FOLDER\Amaya.lnk"
        !           307:   Delete "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk"
        !           308:   RMDir "$SMPROGRAMS\$STARTMENU_FOLDER"
1.3       gully     309:   Delete "$DESKTOP\AmayaWX.lnk"
1.1       gully     310: 
1.2       gully     311:   DeleteRegKey /ifempty HKCU "Software\AmayaWX"
1.1       gully     312: 
                    313: SectionEnd
                    314: 
                    315: ;--------------------------------
                    316: ;Uninstaller Functions
                    317: 
                    318: Function un.onInit
                    319: 
                    320:   !insertmacro MUI_UNGETLANGUAGE
                    321:   
                    322: FunctionEnd

Webmaster