From: Brian S. <xue...@us...> - 2007-10-05 18:40:16
|
Update of /cvsroot/popfile/windows/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12018/test Modified Files: Tag: b0_22_2 pfidiag.nsi Log Message: Add support for the new Nihongo Parser installation and the new MeCab environment variable. Index: pfidiag.nsi =================================================================== RCS file: /cvsroot/popfile/windows/test/pfidiag.nsi,v retrieving revision 1.8.4.9 retrieving revision 1.8.4.10 diff -C2 -d -r1.8.4.9 -r1.8.4.10 *** pfidiag.nsi 4 Aug 2007 12:41:36 -0000 1.8.4.9 --- pfidiag.nsi 5 Oct 2007 18:40:19 -0000 1.8.4.10 *************** *** 104,108 **** ;-------------------------------------------------------------------------- ! !define C_VERSION "0.1.7" !define C_OUTFILE "pfidiag.exe" --- 104,108 ---- ;-------------------------------------------------------------------------- ! !define C_VERSION "0.1.8" !define C_OUTFILE "pfidiag.exe" *************** *** 293,296 **** --- 293,324 ---- !macroend + ;--------------------------------------------------------------------------- + ; Differentiate between a non-existent and an empty MeCab environment variable + ; (this variable is only defined if the MeCab software has been installed) + ;--------------------------------------------------------------------------- + + !macro CHECK_MECAB REGISTER ENV_VARIABLE MESSAGE + + !insertmacro PFI_UNIQUE_ID + + ClearErrors + ReadEnvStr "${REGISTER}" "${ENV_VARIABLE}" + StrCmp "${REGISTER}" "" 0 show_value_${PFI_UNIQUE_ID} + IfErrors 0 show_value_${PFI_UNIQUE_ID} + IfFileExists "$G_EXPECTED_ROOT\mecab\*.*" MeCab_${PFI_UNIQUE_ID} + DetailPrint "${MESSAGE}= >< (this is OK)" + Goto continue_${PFI_UNIQUE_ID} + + MeCab_${PFI_UNIQUE_ID}: + DetailPrint "${MESSAGE}= ><" + Goto continue_${PFI_UNIQUE_ID} + + show_value_${PFI_UNIQUE_ID}: + DetailPrint "${MESSAGE}= < ${REGISTER} >" + + continue_${PFI_UNIQUE_ID}: + !macroend + + #-------------------------------------------------------------------------- # Configure the MUI pages *************** *** 746,751 **** DetailPrint "HKLM: MRI Version = < ${L_REGDATA} >" ! !insertmacro CHECK_MRI_ENTRY "${L_REGDATA}" "HKLM" "InstallPath" "HKLM: InstallPath " ! !insertmacro CHECK_MRI_ENTRY "${L_REGDATA}" "HKLM" "RootDir_LFN" "HKLM: RootDir_LFN " Push ${L_REGDATA} Call CheckForTrailingSlash --- 774,783 ---- DetailPrint "HKLM: MRI Version = < ${L_REGDATA} >" ! DetailPrint "" ! !insertmacro CHECK_MRI_ENTRY "${L_REGDATA}" "HKLM" "NihongoParser" "HKLM: NewParser " ! DetailPrint "" ! ! !insertmacro CHECK_MRI_ENTRY "${L_REGDATA}" "HKLM" "InstallPath" "HKLM: InstallPath " ! !insertmacro CHECK_MRI_ENTRY "${L_REGDATA}" "HKLM" "RootDir_LFN" "HKLM: RootDir_LFN " Push ${L_REGDATA} Call CheckForTrailingSlash *************** *** 1081,1089 **** !define L_ITAIJIDICTPATH $R9 ; current Kakasi environment variable !define L_KANWADICTPATH $R8 ; current Kakasi environment variable ! !define L_POPFILE_ROOT $R7 ; current value of POPFILE_ROOT environment variable ! !define L_TEMP $R6 Push ${L_ITAIJIDICTPATH} Push ${L_KANWADICTPATH} Push ${L_POPFILE_ROOT} Push ${L_TEMP} --- 1113,1123 ---- !define L_ITAIJIDICTPATH $R9 ; current Kakasi environment variable !define L_KANWADICTPATH $R8 ; current Kakasi environment variable ! !define L_MECABRC $R7 ; current MeCab environment variable ! !define L_POPFILE_ROOT $R6 ; current value of POPFILE_ROOT environment variable ! !define L_TEMP $R5 Push ${L_ITAIJIDICTPATH} Push ${L_KANWADICTPATH} + Push ${L_MECABRC} Push ${L_POPFILE_ROOT} Push ${L_TEMP} *************** *** 1176,1180 **** DetailPrint "" ! StrCmp $G_DIAG_MODE "simple" section_end StrCmp ${L_ITAIJIDICTPATH} "" check_other_kakaksi --- 1210,1214 ---- DetailPrint "" ! StrCmp $G_DIAG_MODE "simple" check_mecab StrCmp ${L_ITAIJIDICTPATH} "" check_other_kakaksi *************** *** 1188,1192 **** check_other_kakaksi: StrCmp ${L_KANWADICTPATH} "" 0 check_kanwa ! StrCmp ${L_ITAIJIDICTPATH} "" section_end exit_with_blank_line check_kanwa: --- 1222,1226 ---- check_other_kakaksi: StrCmp ${L_KANWADICTPATH} "" 0 check_kanwa ! StrCmp ${L_ITAIJIDICTPATH} "" check_mecab kakasi_blank_line check_kanwa: *************** *** 1198,1201 **** --- 1232,1252 ---- DetailPrint "'kanwadict' file = ${L_TEMP}found" + kakasi_blank_line: + DetailPrint "" + + check_mecab: + !insertmacro CHECK_MECAB "${L_MECABRC}" "MECABRC" "'MECABRC' " + DetailPrint "" + + StrCmp $G_DIAG_MODE "simple" section_end + + StrCmp ${L_MECABRC} "" exit_with_blank_line + StrCpy ${L_TEMP} "" + IfFileExists "${L_MECABRC}" display_mecab_result + StrCpy ${L_TEMP} "not " + + display_mecab_result: + DetailPrint "'mecabrc' file = ${L_TEMP}found" + exit_with_blank_line: DetailPrint "" *************** *** 1204,1207 **** --- 1255,1259 ---- Pop ${L_TEMP} Pop ${L_POPFILE_ROOT} + Pop ${L_MECABRC} Pop ${L_KANWADICTPATH} Pop ${L_ITAIJIDICTPATH} *************** *** 1209,1212 **** --- 1261,1265 ---- !undef L_ITAIJIDICTPATH !undef L_KANWADICTPATH + !undef L_MECABRC !undef L_POPFILE_ROOT !undef L_TEMP |