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