Annotation of win32/dist/parser_mui_en.nsi, revision 1.1

1.1     ! misha       1: ; parser.nsi
        !             2: ;
        !             3: 
        !             4: !include "MUI.nsh"
        !             5: !include "Library.nsh"
        !             6: 
        !             7: ;--------------------------------
        !             8: ; Configuration
        !             9:        
        !            10:        var MSVCR_EXIST
        !            11:        var MSVCP_EXIST
        !            12: 
        !            13:        !define VER_FILE "3_4_3"
        !            14:        !define VER_DISPLAY "3.4.3"
        !            15:        !define VER_LANG "en"
        !            16:        !define UNINSTALL_PATH "Software\Microsoft\Windows\CurrentVersion\Uninstall\Parser 3"
        !            17: 
        !            18:        ; General
        !            19:        Name "Parser ${VER_DISPLAY}"
        !            20:        Caption "Parser ${VER_DISPLAY}"
        !            21: 
        !            22:        SetCompressor /SOLID lzma
        !            23:        SetOverwrite ifnewer
        !            24:        CRCCheck on
        !            25:        AllowRootDirInstall false
        !            26:        SetDatablockOptimize on
        !            27:        SetDateSave on
        !            28: 
        !            29:        ; The file to write
        !            30:        OutFile "parser${VER_FILE}_${VER_LANG}.exe"
        !            31: 
        !            32:        !define MUI_HEADERIMAGE
        !            33:        !define MUI_HEADERIMAGE_BITMAP "logo.bmp"
        !            34:        !define MUI_HEADERIMAGE_NOSTRETCH
        !            35: 
        !            36: ;      !define MUI_BGCOLOR "99D228"
        !            37:        !define MUI_ICON "favicon.ico"
        !            38:        !define MUI_UNICON "favicon.ico"
        !            39: 
        !            40: ; Interface Settings
        !            41:        ;!define MUI_ABORTWARNING
        !            42:        !define MUI_COMPONENTSPAGE_SMALLDESC
        !            43:        !define MUI_FINISHPAGE_NOAUTOCLOSE
        !            44:        !define MUI_UNFINISHPAGE_NOAUTOCLOSE
        !            45: 
        !            46: ;--------------------------------
        !            47: ; Pages
        !            48:        !define MUI_LICENSEPAGE_RADIOBUTTONS
        !            49:        !define MUI_WELCOMEPAGE_TEXT "This programm will install Parser ${VER_DISPLAY} on your computer.\r\n\r\nClick Next to continue"
        !            50:        !define MUI_COMPONENTSPAGE_TEXT '"Select components to install and click Next to continue" "" "Components"'
        !            51:        
        !            52:        !insertmacro MUI_PAGE_WELCOME
        !            53:        !insertmacro MUI_PAGE_LICENSE "license_${VER_LANG}.txt"
        !            54:        !insertmacro MUI_PAGE_COMPONENTS
        !            55:        !insertmacro MUI_PAGE_DIRECTORY
        !            56:        !insertmacro MUI_PAGE_INSTFILES
        !            57:        
        !            58:        !insertmacro MUI_UNPAGE_CONFIRM
        !            59:        !insertmacro MUI_UNPAGE_INSTFILES
        !            60:  
        !            61: ;--------------------------------
        !            62: ; Languages
        !            63:   !insertmacro MUI_LANGUAGE "English"
        !            64: 
        !            65: ;--------------------------------
        !            66: ; Installer Sections
        !            67: 
        !            68: Section ""
        !            69:        WriteRegStr HKLM "${UNINSTALL_PATH}" "DisplayName" "Parser 3 (remove only)"
        !            70:        WriteRegStr HKLM "${UNINSTALL_PATH}" "DisplayVersion" "${VER_DISPLAY}"
        !            71:        WriteRegStr HKLM "${UNINSTALL_PATH}" "DisplayIcon" "$INSTDIR\parser3_uninst.exe"
        !            72:        WriteRegStr HKLM "${UNINSTALL_PATH}" "HelpLink" "http://www.parser.ru/en/"
        !            73:        WriteRegStr HKLM "${UNINSTALL_PATH}" "URLInfoAbout" "http://www.parser.ru/en/"
        !            74:        WriteRegDWORD HKLM "${UNINSTALL_PATH}" "NoModify" 1
        !            75:        WriteRegStr HKLM "${UNINSTALL_PATH}" "UninstallString" '"$INSTDIR\parser3_uninst.exe"'
        !            76:        SetOutPath $INSTDIR
        !            77:        WriteUninstaller "parser3_uninst.exe"
        !            78: SectionEnd
        !            79: 
        !            80: Section "CGI with XML" XML
        !            81:        SetOutPath $INSTDIR
        !            82:        File "cgi_xml\*.*"
        !            83:        call InstallLibs
        !            84: SectionEnd
        !            85: 
        !            86: 
        !            87: Section "IIS ISAPI with XML" ISAPIXML
        !            88:        SetOutPath $INSTDIR
        !            89:        File "isapi_xml\*.*"
        !            90:        call InstallLibs
        !            91: SectionEnd
        !            92: 
        !            93: 
        !            94: SubSection /e "Documentation"
        !            95: 
        !            96:        Section "CHM" CHM
        !            97:                CreateDirectory "$INSTDIR\docs"
        !            98:                SetOutPath $INSTDIR\docs
        !            99:                File "docs\*.${VER_LANG}.chm"
        !           100:        SectionEnd
        !           101:        
        !           102:        Section "PDF" PDF
        !           103:                CreateDirectory "$INSTDIR\docs"
        !           104:                SetOutPath $INSTDIR\docs
        !           105:                File "docs\*.${VER_LANG}.pdf"
        !           106:        SectionEnd
        !           107: 
        !           108: SubSectionEnd
        !           109: 
        !           110: 
        !           111: SubSection /e "Misc" other
        !           112: 
        !           113:        Section "Main configuration file" AUTO
        !           114:                SetOutPath $INSTDIR
        !           115:                File "config\auto.p"
        !           116:                CreateDirectory "$INSTDIR\charsets"
        !           117:                SetOutPath $INSTDIR\charsets
        !           118:                File "config\charsets\*.*"
        !           119:        SectionEnd
        !           120: 
        !           121:        Section "libcurl library" LIBCURL
        !           122:                SetOutPath $INSTDIR
        !           123:                File "lib\curl\libcurl.dll"
        !           124: 
        !           125:                File "lib\openssl\libeay32.dll"
        !           126:                File "lib\openssl\ssleay32.dll"
        !           127:        SectionEnd
        !           128: 
        !           129:        Section "libmemcached library" LIBMEMCACHED
        !           130:                SetOutPath $INSTDIR
        !           131:                File "lib\memcached\libmemcached.dll"
        !           132:        SectionEnd
        !           133: 
        !           134:        Section "_test.html" test
        !           135:                CreateDirectory "$INSTDIR\other"
        !           136:                SetOutPath $INSTDIR\other
        !           137:                File "other\${VER_LANG}\_test.html"
        !           138:        SectionEnd
        !           139: 
        !           140: SubSectionEnd
        !           141: 
        !           142: 
        !           143: SubSection /e "SQL drivers"
        !           144: 
        !           145:        Section "MySQL driver" MYSQL
        !           146:                CreateDirectory "$INSTDIR\lib"
        !           147:                SetOutPath $INSTDIR\lib
        !           148:                File "sql\parser3mysql.dll"
        !           149: 
        !           150:                File "lib\sql\libmysql.dll"
        !           151:        SectionEnd
        !           152:        
        !           153:        
        !           154:        Section "SQLite driver" SQLITE
        !           155:                CreateDirectory "$INSTDIR\lib"
        !           156:                SetOutPath $INSTDIR\lib
        !           157:                File "sql\parser3sqlite.dll"
        !           158: 
        !           159:                File "lib\sql\sqlite3.dll"
        !           160:        SectionEnd
        !           161:        
        !           162:        
        !           163:        Section "ODBC driver" ODBC
        !           164:                CreateDirectory "$INSTDIR\lib"
        !           165:                SetOutPath $INSTDIR\lib
        !           166:                File "sql\parser3odbc.dll"
        !           167:        SectionEnd
        !           168:        
        !           169:        
        !           170:        Section "Oracle driver" ORACLE
        !           171:                CreateDirectory "$INSTDIR\lib"
        !           172:                SetOutPath $INSTDIR\lib
        !           173:                File "sql\parser3oracle.dll"
        !           174:        SectionEnd
        !           175:        
        !           176:        
        !           177:        Section "PostgreSQL driver" PGSQL
        !           178:                CreateDirectory "$INSTDIR\lib"
        !           179:                SetOutPath $INSTDIR\lib
        !           180:                File "sql\parser3pgsql.dll"
        !           181: 
        !           182:                File "lib\sql\libpq.dll"
        !           183: 
        !           184:                SetOutPath $INSTDIR
        !           185:                File "lib\sql\libintl.dll"
        !           186:                File "lib\openssl\libeay32.dll"
        !           187:                File "lib\openssl\ssleay32.dll"
        !           188:        SectionEnd
        !           189: 
        !           190: SubSectionEnd
        !           191: 
        !           192: 
        !           193: 
        !           194: Function InstallLibs
        !           195:        IfFileExists "$SYSDIR\msvcr71.dll" 0 new_msvcr
        !           196:                StrCpy $MSVCR_EXIST 1
        !           197:        new_msvcr:
        !           198:        !insertmacro InstallLib DLL $MSVCR_EXIST REBOOT_NOTPROTECTED lib\system\msvcr71.dll $SYSDIR\msvcr71.dll $TEMP
        !           199: 
        !           200:        IfFileExists "$SYSDIR\msvcp71.dll" 0 new_msvcp
        !           201:                StrCpy $MSVCP_EXIST 1
        !           202:        new_msvcp:
        !           203:        !insertmacro InstallLib DLL $MSVCP_EXIST REBOOT_NOTPROTECTED lib\system\msvcp71.dll $SYSDIR\msvcp71.dll $TEMP
        !           204: FunctionEnd
        !           205: 
        !           206: 
        !           207: ;--------------------------------
        !           208: ; Descriptions
        !           209: 
        !           210:   !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
        !           211:     !insertmacro MUI_DESCRIPTION_TEXT ${XML}   "Can be used with any web-server which supports CGI scripts"
        !           212:     !insertmacro MUI_DESCRIPTION_TEXT ${ISAPIXML}   "IIS ISAPI extension is more efficient than CGI"
        !           213: 
        !           214:     !insertmacro MUI_DESCRIPTION_TEXT ${CHM} "Documentation as Windows help file"
        !           215:     !insertmacro MUI_DESCRIPTION_TEXT ${PDF} "Documentation ready to print"
        !           216: 
        !           217:     !insertmacro MUI_DESCRIPTION_TEXT ${AUTO} "Main configuration file (auto.p)"
        !           218:     !insertmacro MUI_DESCRIPTION_TEXT ${LIBCURL} "libcurl library which is used from curl class"
        !           219:     !insertmacro MUI_DESCRIPTION_TEXT ${LIBMEMCACHED} "libmemcached library which is used from memcached class"
        !           220:     !insertmacro MUI_DESCRIPTION_TEXT ${test} "File to test Parser installation"
        !           221: 
        !           222:     !insertmacro MUI_DESCRIPTION_TEXT ${MYSQL}  "Driver to access MySQL servers"
        !           223:     !insertmacro MUI_DESCRIPTION_TEXT ${SQLITE} "Driver for SQLite"
        !           224:     !insertmacro MUI_DESCRIPTION_TEXT ${PGSQL}  "Driver to access PgSQL servers"
        !           225:     !insertmacro MUI_DESCRIPTION_TEXT ${ODBC}   "Driver to access data via ODBC"
        !           226:     !insertmacro MUI_DESCRIPTION_TEXT ${ORACLE} "Driver to access ORACLE servers"
        !           227:   !insertmacro MUI_FUNCTION_DESCRIPTION_END
        !           228: 
        !           229: DirText "Specify a folder where your web-server keeps CGI-scripts" "Folder to install Parser ${VER_DISPLAY}" "Change"
        !           230: InstallDir "$7"
        !           231: InstallDirRegKey HKLM "SOFTWARE\Art Lebedev Studio\Parser 3" "Install_Dir"
        !           232: 
        !           233: 
        !           234: 
        !           235: ;--------------------------------
        !           236: ; Uninstaller Section
        !           237: 
        !           238: UninstallText "Uninstall Parser 3 Click Next to continue" "Folder"
        !           239: UninstallSubCaption 0 ": Confirm"
        !           240: UninstallSubCaption 1 ": Deleting files"
        !           241: UninstallSubCaption 2 ": Delete completed"
        !           242: UninstallButtonText "Next"
        !           243: 
        !           244: 
        !           245: ; special uninstall section.
        !           246: Section "Uninstall"
        !           247: ;      remove files
        !           248:        Delete "$INSTDIR\charsets\*.cfg"
        !           249:        RMDir "$INSTDIR\charsets"
        !           250: 
        !           251: ; SQL drivers
        !           252:        Delete "$INSTDIR\lib\parser3*.dll"
        !           253: 
        !           254: ; SQL libs
        !           255:        Delete "$INSTDIR\lib\libmysql.dll"
        !           256:        Delete "$INSTDIR\lib\sqlite*.dll"
        !           257:        Delete "$INSTDIR\lib\libpq*.dll"
        !           258: 
        !           259:        RMDir "$INSTDIR\lib"
        !           260: 
        !           261:        Delete "$INSTDIR\libintl.dll"
        !           262: 
        !           263: ; DOCs
        !           264:        Delete "$INSTDIR\docs\*.*"
        !           265:        RMDir "$INSTDIR\docs"
        !           266: 
        !           267: ; OpenSSL libs
        !           268:        Delete "$INSTDIR\libeay32.dll"
        !           269:        Delete "$INSTDIR\ssleay32.dll"
        !           270: 
        !           271: ; CURL
        !           272:        Delete "$INSTDIR\libcurl.dll"
        !           273: 
        !           274: ; MEMCACHED
        !           275:        Delete "$INSTDIR\libmemcached.dll"
        !           276: 
        !           277: ; rest
        !           278:        Delete "$INSTDIR\*parser3*.*"
        !           279: 
        !           280:        Delete "$INSTDIR\readme.*.txt"
        !           281:        Delete "$INSTDIR\Readme"
        !           282:        Delete "$INSTDIR\auto.p"
        !           283: 
        !           284:        Delete "$INSTDIR\other\_test.html"
        !           285:        RMDir "$INSTDIR\other"
        !           286: 
        !           287:        !insertmacro UnInstallLib DLL SHARED NOREMOVE $SYSDIR\msvcr71.dll
        !           288:        !insertmacro UnInstallLib DLL SHARED NOREMOVE $SYSDIR\msvcp71.dll
        !           289: ;      remove registry keys
        !           290:        DeleteRegKey HKLM "SOFTWARE\Art Lebedev Studio\"
        !           291:        DeleteRegKey HKLM "${UNINSTALL_PATH}"
        !           292: ;      MUST REMOVE UNINSTALLER, too
        !           293:        Delete $INSTDIR\parser3_uninst.exe
        !           294: ;      remove directories used.
        !           295: ;      RMDir "$INSTDIR"
        !           296: SectionEnd
        !           297: 
        !           298: 
        !           299: ;!define SF_SELECTED   1
        !           300: ;!define SF_SUBSEC     2
        !           301: ;!define SF_SUBSECEND  4
        !           302: ;!define SF_BOLD       8
        !           303: ;!define SF_RO         16
        !           304: ;!define SF_EXPAND     32
        !           305: 
        !           306: ;!define SECTION_OFF   0xFFFFFFFE
        !           307: 
        !           308: Function .onInit
        !           309:        StrCpy $INSTDIR "C:\"
        !           310: 
        !           311:        ; looking for directory with Apache installation
        !           312:        Push $5
        !           313:        Push $6
        !           314:        Push $7
        !           315: 
        !           316:        ; Apache 2.0 and may be early
        !           317:        StrCpy $5 0
        !           318: loop1:
        !           319:        EnumRegKey $6 HKLM "SOFTWARE\Apache Group\Apache" "$5"
        !           320:        StrCmp $6 "" end1
        !           321:        IntOp $5 $5 + 1
        !           322:        ReadRegStr $7 HKLM "SOFTWARE\Apache Group\Apache\$6" "ServerRoot"
        !           323:        StrCmp $7 "" loop1
        !           324:        StrCpy $INSTDIR "$7cgi-bin"
        !           325:        Goto loop1
        !           326: end1:
        !           327: 
        !           328:        ; Apache 2.2
        !           329:        StrCpy $5 0
        !           330: loop2:
        !           331:        EnumRegKey $6 HKLM "SOFTWARE\Apache Software Foundation\Apache" "$5"
        !           332:        StrCmp $6 "" end2
        !           333:        IntOp $5 $5 + 1
        !           334:        ReadRegStr $7 HKLM "SOFTWARE\Apache Software Foundation\Apache\$6" "ServerRoot"
        !           335:        StrCmp $7 "" loop2
        !           336:        StrCpy $INSTDIR "$7cgi-bin"
        !           337:        Goto loop2
        !           338: end2:
        !           339: 
        !           340:        ; MessageBox MB_OK "$INSTDIR"
        !           341: 
        !           342:        Pop $7
        !           343:        Pop $6
        !           344:        Pop $5
        !           345:        
        !           346:     Push $0
        !           347: 
        !           348:     StrCpy $1 ${XML}
        !           349: 
        !           350:     SectionGetFlags ${XML} $0
        !           351:     IntOp $0 $0 | ${SF_SELECTED}
        !           352:     SectionSetFlags ${XML} $0
        !           353: 
        !           354:     SectionGetFlags ${ISAPIXML} $0
        !           355:     IntOp $0 $0 & ${SECTION_OFF}
        !           356:     SectionSetFlags ${ISAPIXML} $0
        !           357: 
        !           358: 
        !           359: 
        !           360:     SectionGetFlags ${CHM} $0
        !           361:     IntOp $0 $0 |  ${SF_SELECTED}
        !           362:     SectionSetFlags ${CHM} $0
        !           363: 
        !           364:     SectionGetFlags ${PDF} $0
        !           365:     IntOp $0 $0 & ${SECTION_OFF}
        !           366:     SectionSetFlags ${PDF} $0
        !           367: 
        !           368: 
        !           369: 
        !           370:     SectionGetFlags ${AUTO} $0
        !           371:     IntOp $0 $0 |  ${SF_SELECTED}
        !           372:     SectionSetFlags ${AUTO} $0
        !           373: 
        !           374:     SectionGetFlags ${LIBCURL} $0
        !           375:     IntOp $0 $0 |  ${SF_SELECTED}
        !           376:     SectionSetFlags ${LIBCURL} $0
        !           377: 
        !           378:     SectionGetFlags ${LIBMEMCACHED} $0
        !           379:     IntOp $0 $0 |  ${SF_SELECTED}
        !           380:     SectionSetFlags ${LIBMEMCACHED} $0
        !           381: 
        !           382: 
        !           383: 
        !           384:     SectionGetFlags ${MYSQL} $0
        !           385:     IntOp $0 $0 |  ${SF_SELECTED}
        !           386:     SectionSetFlags ${MYSQL} $0
        !           387: 
        !           388:     SectionGetFlags ${SQLITE} $0
        !           389:     IntOp $0 $0 |  ${SF_SELECTED}
        !           390:     SectionSetFlags ${SQLITE} $0
        !           391: 
        !           392:     SectionGetFlags ${ODBC} $0
        !           393:     IntOp $0 $0 & ${SF_SELECTED}
        !           394:     SectionSetFlags ${ODBC} $0
        !           395: 
        !           396:     SectionGetFlags ${ORACLE} $0
        !           397:     IntOp $0 $0 & ${SECTION_OFF}
        !           398:     SectionSetFlags ${ORACLE} $0
        !           399: 
        !           400:     SectionGetFlags ${PGSQL} $0
        !           401:     IntOp $0 $0 & ${SECTION_OFF}
        !           402:     SectionSetFlags ${PGSQL} $0
        !           403: 
        !           404:     Pop $0
        !           405: FunctionEnd
        !           406: 
        !           407: Function .onSelChange
        !           408: ;      MessageBox MB_OK 'onSelChange'
        !           409:     Push $0
        !           410: 
        !           411:     ; Turn off old selected section
        !           412:     SectionGetFlags $1 $0
        !           413:     IntOp $0 $0 & ${SECTION_OFF}
        !           414:     SectionSetFlags $1 $0
        !           415: 
        !           416:     ; Now remember the current selection
        !           417:     Push $2
        !           418:     StrCpy $2 $1
        !           419: 
        !           420:     SectionGetFlags ${XML} $0
        !           421:     IntOp $0 $0 & ${SF_SELECTED}
        !           422:     IntCmp $0 ${SF_SELECTED} 0 +2 +2
        !           423:         StrCpy $1 ${XML}
        !           424: 
        !           425:     SectionGetFlags ${ISAPIXML} $0
        !           426:     IntOp $0 $0 & ${SF_SELECTED}
        !           427:     IntCmp $0 ${SF_SELECTED} 0 +2 +2
        !           428:         StrCpy $1 ${ISAPIXML}
        !           429: 
        !           430:     StrCmp $2 $1 0 +2
        !           431:         SectionGetFlags $1 $0
        !           432:         IntOp $0 $0 | ${SF_SELECTED}
        !           433:         SectionSetFlags $1 $0
        !           434:     Pop $2
        !           435:     Pop $0
        !           436: FunctionEnd
        !           437: 
        !           438: 
        !           439: Function .onInstSuccess
        !           440:        WriteRegStr HKLM "SOFTWARE\Art Lebedev Studio\Parser 3" "Install_Dir" "$INSTDIR"
        !           441:        MessageBox MB_YESNO|MB_ICONQUESTION "Do you want to read a short installation instruction?" IDNO NoReadMe
        !           442:        Exec 'notepad.exe "$INSTDIR\readme.${VER_LANG}.txt"'
        !           443: NoReadMe:
        !           444: FunctionEnd

E-mail: