Index: win_installer/patch/src/ant/LanguagePack.xml =================================================================== diff -u --- win_installer/patch/src/ant/LanguagePack.xml (revision 0) +++ win_installer/patch/src/ant/LanguagePack.xml (revision 1e8a5f06a79e03ae6e078f2e5544d9e38b3c9dde) @@ -0,0 +1,18 @@ + + + + + + + + + + + + \ No newline at end of file Index: win_installer/patch/src/includes/Functions.nsh =================================================================== diff -u -r2cc2f53df1ff6203a63543135a6418fa0093c684 -r1e8a5f06a79e03ae6e078f2e5544d9e38b3c9dde --- win_installer/patch/src/includes/Functions.nsh (.../Functions.nsh) (revision 2cc2f53df1ff6203a63543135a6418fa0093c684) +++ win_installer/patch/src/includes/Functions.nsh (.../Functions.nsh) (revision 1e8a5f06a79e03ae6e078f2e5544d9e38b3c9dde) @@ -381,3 +381,154 @@ Exch 6 FunctionEnd + +!define StrTok "!insertmacro StrTok" + +!macro StrTok ResultVar String Separators ResultPart SkipEmptyParts + Push "${String}" + Push "${Separators}" + Push "${ResultPart}" + Push "${SkipEmptyParts}" + Call StrTok + Pop "${ResultVar}" +!macroend + +Function StrTok +/*After this point: + ------------------------------------------ + $0 = SkipEmptyParts (input) + $1 = ResultPart (input) + $2 = Separators (input) + $3 = String (input) + $4 = SeparatorsLen (temp) + $5 = StrLen (temp) + $6 = StartCharPos (temp) + $7 = TempStr (temp) + $8 = CurrentLoop + $9 = CurrentSepChar + $R0 = CurrentSepCharNum + */ + + ;Get input from user + Exch $0 + Exch + Exch $1 + Exch + Exch 2 + Exch $2 + Exch 2 + Exch 3 + Exch $3 + Exch 3 + Push $4 + Push $5 + Push $6 + Push $7 + Push $8 + Push $9 + Push $R0 + + ;Parameter defaults + ${IfThen} $2 == `` ${|} StrCpy $2 `|` ${|} + ${IfThen} $1 == `` ${|} StrCpy $1 `L` ${|} + ${IfThen} $0 == `` ${|} StrCpy $0 `0` ${|} + + ;Get "String" and "Separators" length + StrLen $4 $2 + StrLen $5 $3 + ;Start "StartCharPos" and "ResultPart" counters + StrCpy $6 0 + StrCpy $8 -1 + + ;Loop until "ResultPart" is met, "Separators" is found or + ;"String" reaches its end + ResultPartLoop: ;"CurrentLoop" Loop + + ;Increase "CurrentLoop" counter + IntOp $8 $8 + 1 + + StrSearchLoop: + ${Do} ;"String" Loop + ;Remove everything before and after the searched part ("TempStr") + StrCpy $7 $3 1 $6 + + ;Verify if it's the "String" end + ${If} $6 >= $5 + ;If "CurrentLoop" is what the user wants, remove the part + ;after "TempStr" and itself and get out of here + ${If} $8 == $1 + ${OrIf} $1 == `L` + StrCpy $3 $3 $6 + ${Else} ;If not, empty "String" and get out of here + StrCpy $3 `` + ${EndIf} + StrCpy $R0 `End` + ${ExitDo} + ${EndIf} + + ;Start "CurrentSepCharNum" counter (for "Separators" Loop) + StrCpy $R0 0 + + ${Do} ;"Separators" Loop + ;Use one "Separators" character at a time + ${If} $R0 <> 0 + StrCpy $9 $2 1 $R0 + ${Else} + StrCpy $9 $2 1 + ${EndIf} + + ;Go to the next "String" char if it's "Separators" end + ${IfThen} $R0 >= $4 ${|} ${ExitDo} ${|} + + ;Or, if "TempStr" equals "CurrentSepChar", then... + ${If} $7 == $9 + StrCpy $7 $3 $6 + + ;If "String" is empty because this result part doesn't + ;contain data, verify if "SkipEmptyParts" is activated, + ;so we don't return the output to user yet + + ${If} $7 == `` + ${AndIf} $0 = 1 ;${TRUE} + IntOp $6 $6 + 1 + StrCpy $3 $3 `` $6 + StrCpy $6 0 + Goto StrSearchLoop + ${ElseIf} $8 == $1 + StrCpy $3 $3 $6 + StrCpy $R0 "End" + ${ExitDo} + ${EndIf} ;If not, go to the next result part + IntOp $6 $6 + 1 + StrCpy $3 $3 `` $6 + StrCpy $6 0 + Goto ResultPartLoop + ${EndIf} + + ;Increase "CurrentSepCharNum" counter + IntOp $R0 $R0 + 1 + ${Loop} + ${IfThen} $R0 == "End" ${|} ${ExitDo} ${|} + + ;Increase "StartCharPos" counter + IntOp $6 $6 + 1 + ${Loop} + +/*After this point: + ------------------------------------------ + $3 = ResultVar (output)*/ + + ;Return output to user + + Pop $R0 + Pop $9 + Pop $8 + Pop $7 + Pop $6 + Pop $5 + Pop $4 + Pop $0 + Pop $1 + Pop $2 + Exch $3 +FunctionEnd Index: win_installer/patch/src/patch.nsi =================================================================== diff -u -r2cc2f53df1ff6203a63543135a6418fa0093c684 -r1e8a5f06a79e03ae6e078f2e5544d9e38b3c9dde --- win_installer/patch/src/patch.nsi (.../patch.nsi) (revision 2cc2f53df1ff6203a63543135a6418fa0093c684) +++ win_installer/patch/src/patch.nsi (.../patch.nsi) (revision 1e8a5f06a79e03ae6e078f2e5544d9e38b3c9dde) @@ -50,9 +50,9 @@ # constants !define VERSION "2.1.1" !define PREVIOUS_VERSION "2.1" -!define LANGUAGE_PACK_VERSION "2008-06-19" -!define LANGUAGE_PACK_VERSION_INT "20080619" -!define DATE_TIME_STAMP "200806190000" +!define LANGUAGE_PACK_VERSION "2008-09-05" +!define LANGUAGE_PACK_VERSION_INT "20080905" +!define DATE_TIME_STAMP "200809050000" ######################## Added in the extra .0 for 2.1 for constitency !define SERVER_VERSION_NUMBER "${VERSION}.0.${DATE_TIME_STAMP}" !define BASE_VERSION "2.0" @@ -162,10 +162,15 @@ ;Var RETAIN_FILES ; bool value to devide whether to retain files Var TIMESTAMP ; timestamp Var BACKUP ; bool value to determine whether the updater will backup -Var OLD_LANG_VERSION ; int to that gets the old language version from the regestry +#LANGUAGE PACK VARIABLES ##### +Var UPDATE_LANGUAGES ; bool value to determine whether to update languages with language pack +Var LAMS_DIR ; directory lams is installed at +Var VERSION_INT ; version of the language pack +Var OLD_LANG_VERSION ; previous version of language pack + # installer sections SectionGroup "LAMS ${VERSION} Patch (Requires LAMS 2.0)" update @@ -175,16 +180,6 @@ ; Backing up existing lams installation call backupLams - ;ReadRegStr $MYSQL_HOST HKLM "${REG_HEAD}" "mysql_host" - ; TODO Change after 2.1, get the port from the registry instead or hard coding it - ;ReadRegStr $MYSQL_PORT HKLM "${REG_HEAD}" "mysql_port" - ;strcpy $MYSQL_PORT 3360 - - ;${if} $MYSQL_HOST == "" - ; strcpy $MYSQL_HOST "localhost" - ;${endif} - - ; removing temporary jboss files clearerrors Detailprint "Removing $INSTDIR\jboss-4.0.2\server\default\tmp " @@ -207,6 +202,32 @@ ; Updating the database to support version call updateDatabase + # RUNNING THE LANGUAGE PACK ################## + call languagePackInit + ; copy language files from LAMS projects to a folder in $INSTDIR + call copyProjects + + ; get the language files locations specific to this server from the database + ; unpack to $INSTDIR\library\llidx + call copyllid + + ; Finally, add rows in the database (lams_supported_locale) for all new language files + call updateLanguageTables + + # write this language pack version to registry + Detailprint 'Writing Language pack version ${LANGUAGE_PACK_VERSION} to registry: "$VERSION_INT"' + + DetailPrint "LAMS Language Pack ${LANGUAGE_PACK_VERSION} install successfull" + + ################################################ + + strcpy $INSTDIR $LAMS_DIR + setoutpath $INSTDIR + File /a "${DOCUMENTS}\license.txt" + File /a "${DOCUMENTS}\license-wrapper.txt" + File /a "${DOCUMENTS}\readme.txt" + + ; Update the registry call WriteRegEntries SectionEnd @@ -681,10 +702,357 @@ WriteRegStr HKLM "${REG_HEAD}" "mysql_host" "$MYSQL_HOST" WriteRegStr HKLM "${REG_HEAD}" "mysql_port" "$MYSQL_PORT" WriteRegStr HKLM "${REG_HEAD}" "version" "${VERSION}" + WriteRegStr HKLM "${REG_HEAD}" "language_pack" "${VERSION}" FunctionEnd +################################################################################ +# CODE USED FOR LANGUAGE PACK # +################################################################################ +; first, finds the location of the language files in the database +; then copy the required files to the dirname +Var CSllid +Var FSllid +Var RFllid +Function copyllid + setoutpath "$TEMP\lams" + File "${BUILD_DIR}\GetLlidFolderNames.class" + + strcpy $1 "jdbc:mysql://$MYSQL_HOST/$DB_NAME?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&autoReconnect=true&useUnicode=true" + ReadRegStr $3 HKLM "${REG_HEAD}" "dir_jdk" + # execute llid finder + Detailprint '"$3\bin\java.exe" -cp ".;$LAMS_DIR\jboss-4.0.2\server\default\deploy\lams.ear\mysql-connector-java-3.1.12-bin.jar" GetLlidFolderNames "Chat and Scribe" "$1" "$DB_USER" "$DB_PASS"' + nsExec::ExecToStack '"$3\bin\java.exe" -cp ".;$LAMS_DIR\jboss-4.0.2\server\default\deploy\lams.ear\mysql-connector-java-3.1.12-bin.jar" GetLlidFolderNames "Chat and Scribe" "$1" "$DB_USER" "$DB_PASS"' + pop $0 + pop $CSllid + ${if} $0 != '0' + Messagebox MB_OK|MB_ICONSTOP "Error while finding Chat and Scrbe llid folders: $CSllid" + Abort + ${endif} + + setoutpath "$TEMP\lams" + File "${BUILD_DIR}\GetLlidFolderNames.class" + + strcpy $1 "jdbc:mysql://$MYSQL_HOST/$DB_NAME?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&autoReconnect=true&useUnicode=true" + ReadRegStr $3 HKLM "${REG_HEAD}" "dir_jdk" + # execute llid finder + Detailprint '"$3\bin\java.exe" -cp ".;$LAMS_DIR\jboss-4.0.2\server\default\deploy\lams.ear\mysql-connector-java-3.1.12-bin.jar" GetLlidFolderNames "Forum and Scribe" "$1" "$DB_USER" "$DB_PASS"' + nsExec::ExecToStack '"$3\bin\java.exe" -cp ".;$LAMS_DIR\jboss-4.0.2\server\default\deploy\lams.ear\mysql-connector-java-3.1.12-bin.jar" GetLlidFolderNames "Forum and Scribe" "$1" "$DB_USER" "$DB_PASS"' + pop $0 + pop $FSllid + ${if} $0 != '0' + Messagebox MB_OK|MB_ICONSTOP "Error while finding Forum and Scribe llid folders" + Abort + ${endif} + + strcpy $1 "jdbc:mysql://$MYSQL_HOST/$DB_NAME?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&autoReconnect=true&useUnicode=true" + ReadRegStr $3 HKLM "${REG_HEAD}" "dir_jdk" + # execute llid finder + Detailprint '"$3\bin\java.exe" -cp ".;$LAMS_DIR\jboss-4.0.2\server\default\deploy\lams.ear\mysql-connector-java-3.1.12-bin.jar" GetLlidFolderNames "Resource and Forum" "$1" "$DB_USER" "$DB_PASS"' + nsExec::ExecToStack '"$3\bin\java.exe" -cp ".;$LAMS_DIR\jboss-4.0.2\server\default\deploy\lams.ear\mysql-connector-java-3.1.12-bin.jar" GetLlidFolderNames "Resources and Forum" "$1" "$DB_USER" "$DB_PASS"' + pop $0 + pop $RFllid + ${if} $0 != '0' + Messagebox MB_OK|MB_ICONSTOP "Error while finding Resource and Forum llid folders" + Abort + ${endif} + + setoutpath "$LAMS_DIR\jboss-4.0.2\server\default\deploy\lams.ear\lams-dictionary.jar\org\lamsfoundation\lams\library\llid$CSllid" + file /a "${BASE_PROJECT_DIR}\lams_build\librarypackages\chatscribe\language\lams\*" + + setoutpath "$LAMS_DIR\jboss-4.0.2\server\default\deploy\lams.ear\lams-dictionary.jar\org\lamsfoundation\lams\library\llid$FSllid" + file /a "${BASE_PROJECT_DIR}\lams_build\librarypackages\forumscribe\language\lams\*" + + setoutpath "$LAMS_DIR\jboss-4.0.2\server\default\deploy\lams.ear\lams-dictionary.jar\org\lamsfoundation\lams\library\llid$RFllid" + file /a "${BASE_PROJECT_DIR}\lams_build\librarypackages\shareresourcesforum\language\lams\*" + +FunctionEnd +Function languagePackInit + InitPluginsDir + + #get the version in from the version date yyyy-mm-dd + call getVersionInt + + # getting the mysql database details + ReadRegStr $MYSQL_DIR HKLM "${REG_HEAD}" "dir_mysql" + ReadRegStr $DB_NAME HKLM "${REG_HEAD}" "db_name" + ReadRegStr $DB_USER HKLM "${REG_HEAD}" "db_user" + ReadRegStr $DB_PASS HKLM "${REG_HEAD}" "db_pass" + + # Abort install if already installed or if a newer version is installed + strcpy $OLD_LANG_VERSION "20061205" ;default old version (Date of First language pack of LAMS2) + ReadRegStr $0 HKLM "${REG_HEAD}" "language_pack" + ${VersionCompare} "$VERSION_INT" "$0" $1 + ${If} $1 == "0" + DetailPrint "LAMS Language pack already up-to-date" + strcpy $UPDATE_LANGUAGES "0" + goto done + ${EndIf} + ${if} $1 == "2" + DetailPrint "LAMS Language pack already up-to-date" + goto done + strcpy $UPDATE_LANGUAGES "0" + ${EndIf} + strcpy $UPDATE_LANGUAGES "1" + ${If} $0 != "" + strcpy $OLD_LANG_VERSION $0 + ${EndIf} + + # Abort if there is no version of LAMS2 installed + ReadRegStr $0 HKLM "${REG_HEAD}" "version" + ${If} $0 = "" + MessageBox MB_OK|MB_ICONSTOP "No version of LAMS 2.x is installed$\n$\n\ + Please install LAMS 2 before continuing" + Abort + ${EndIf} + + #set the installation directory + ReadRegStr $0 HKLM "${REG_HEAD}" "dir_inst" + strcpy $LAMS_DIR $0 + strcpy $INSTDIR "$0\jboss-4.0.2\server\default\deploy\lams.ear\lams-dictionary.jar\org\lamsfoundation\lams" + + done: +FunctionEnd +Function getVersionInt + push ${LANGUAGE_PACK_VERSION} + push "-" + push 0 + push 1 + call Strtok + pop $VERSION_INT + + push ${LANGUAGE_PACK_VERSION} + push "-" + push 1 + push 1 + call Strtok + pop $0 + strcpy $VERSION_INT "$VERSION_INT$0" + + push ${LANGUAGE_PACK_VERSION} + push "-" + push 2 + push 1 + call Strtok + pop $0 + strcpy $VERSION_INT "$VERSION_INT$0" + +FunctionEnd + +; copies all the lams_blah project language files from lams_blah/conf/languages +; files are compresses then extracted to the jboss language directory: +; C:\lams\jboss-4.0.2\server\default\deploy\lams.ear\lams-dictionary.jar\org\lamsfoundation\lams +Function copyProjects + + setoutpath "$LAMS_DIR\jboss-4.0.2\server\default\deploy\lams.ear\lams-central.war\flashxml\" + detailprint "Extracting language files for flash" + file /a /r "${BASE_PROJECT_DIR}\lams_central\build\lib\lams-central.war\flashxml\*" + + ;copying COMMON project language files + setoutpath "$INSTDIR" + detailprint "Extracting language files for lams_common" + file /a "${BASE_PROJECT_DIR}\lams_common\build\lib\language\org\lamsfoundation\lams\*" + + ;copying ADMIN project language files + setoutpath "$INSTDIR\admin" + detailprint "Extracting language files for lams_admin" + file /a "${BASE_PROJECT_DIR}\lams_admin\build\lib\language\org\lamsfoundation\lams\admin\*" + + ;copying CENTRAL project language files + setoutpath "$INSTDIR\central" + detailprint "Extracting language files for lams_central" + file /a "${BASE_PROJECT_DIR}\lams_central\build\lib\language\org\lamsfoundation\lams\central\*" + + ;copying CONTENTREPOSITORY project language files + setoutpath "$INSTDIR\contentrepository" + detailprint "Extracting language files for lams_contentrepository" + file /a /x CVS "${BASE_PROJECT_DIR}\lams_contentrepository\conf\language\*" + + ;copying LEARNING project language files + setoutpath "$INSTDIR\learning" + detailprint "Extracting language files for lams_learning" + file /a "${BASE_PROJECT_DIR}\lams_learning\build\lib\language\org\lamsfoundation\lams\learning\*" + + ;copying MONITORING project language files + setoutpath "$INSTDIR\monitoring" + detailprint "Extracting language files for lams_monitoring" + file /a "${BASE_PROJECT_DIR}\lams_monitoring\build\lib\language\org\lamsfoundation\lams\monitoring\*" + + ;copying TOOL_CHAT project language files + setoutpath "$INSTDIR\tool\chat" + detailprint "Extracting language files for lams_tool_chat" + file /a "${BASE_PROJECT_DIR}\lams_tool_chat\build\deploy\language\*" + + ;copying TOOL_FORUM project language files + setoutpath "$INSTDIR\tool\forum" + detailprint "Extracting language files for lams_tool_forum" + file /a "${BASE_PROJECT_DIR}\lams_tool_forum\build\deploy\language\*" + + ;copying TOOL_LAMC project language files + setoutpath "$INSTDIR\tool\mc" + detailprint "Extracting language files for lams_tool_lamc" + file /a "${BASE_PROJECT_DIR}\lams_tool_lamc\build\deploy\language\*" + + ;copying TOOL_LAQA project language filesh + setoutpath "$INSTDIR\tool\qa" + detailprint "Extracting language files for lams_tool_laqa" + file /a "${BASE_PROJECT_DIR}\lams_tool_laqa\build\deploy\language\*" + + ;copying TOOL_NOTEBOOK project language files + setoutpath "$INSTDIR\tool\notebook" + detailprint "Extracting language files for lams_tool_notebook" + file /a "${BASE_PROJECT_DIR}\lams_tool_notebook\build\deploy\language\*" + + ;copying TOOL_NB project language files + setoutpath "$INSTDIR\tool\noticeboard" + detailprint "Extracting language files for lams_tool_nb" + file /a "${BASE_PROJECT_DIR}\lams_tool_nb\build\deploy\language\*" + + ;copying TOOL_LARSRC project language files + setoutpath "$INSTDIR\tool\rsrc" + detailprint "Extracting language files for lams_tool_larsrc" + file /a "${BASE_PROJECT_DIR}\lams_tool_larsrc\build\deploy\language\*" + + ;copying TOOL_SBMT project language files + setoutpath "$INSTDIR\tool\sbmt" + detailprint "Extracting language files for lams_tool_sbmt" + file /a "${BASE_PROJECT_DIR}\lams_tool_sbmt\build\deploy\language\*" + + ;copying TOOL_SCRIBE project language files + setoutpath "$INSTDIR\tool\scribe" + detailprint "Extracting language files for lams_tool_scribe" + file /a "${BASE_PROJECT_DIR}\lams_tool_scribe\build\deploy\language\*" + + ;copying TOOL_SURVEY project language files + setoutpath "$INSTDIR\tool\survey" + detailprint "Extracting language files for lams_tool_survey" + file /a "${BASE_PROJECT_DIR}\lams_tool_survey\build\deploy\language\*" + + ;copying TOOL_VOTE project language files + setoutpath "$INSTDIR\tool\vote" + detailprint "Extracting language files for lams_tool_vote" + file /a "${BASE_PROJECT_DIR}\lams_tool_vote\build\deploy\language\*" +FunctionEnd + + +Function SplitFirstStrPart + Exch $R0 + Exch + Exch $R1 + Push $R2 + Push $R3 + StrCpy $R3 $R1 + StrLen $R1 $R0 + IntOp $R1 $R1 + 1 + loop: + IntOp $R1 $R1 - 1 + StrCpy $R2 $R0 1 -$R1 + StrCmp $R1 0 exit0 + StrCmp $R2 $R3 exit1 loop + exit0: + StrCpy $R1 "" + Goto exit2 + exit1: + IntOp $R1 $R1 - 1 + StrCmp $R1 0 0 +3 + StrCpy $R2 "" + Goto +2 + StrCpy $R2 $R0 "" -$R1 + IntOp $R1 $R1 + 1 + StrCpy $R0 $R0 -$R1 + StrCpy $R1 $R2 + exit2: + Pop $R3 + Pop $R2 + Exch $R1 ;rest + Exch + Exch $R0 ;first +FunctionEnd + +;checks if the languages in the language pack exist +;inserts rows into lams_supported_locale iff the languages dont exist +Function updateLanguageTables + + ; get the procedure scripts required + setoutpath "$INSTDIR" + File /a ${SQL}\updateLocales.sql + File /a ${ANT}\LanguagePack.xml + + + setoutpath "$INSTDIR\apache-ant-1.6.5\bin" + File /a "${BASE_DIR}\apache-ant-1.6.5\bin\*" + + setoutpath "$INSTDIR\apache-ant-1.6.5\lib" + File /a "${BASE_DIR}\apache-ant-1.6.5\lib\*" + + ; update locals must be stored as a procedure first + ; nsExec wont let me do "mysql < insertLocale.sql" so i had to use ant + ; create installer.properties + ClearErrors + FileOpen $0 $TEMP\installer.properties w + IfErrors 0 +2 + goto error + + # convert '\' to '/' for Ant's benefit + Push $TEMP + Push "\" + Call StrSlash + Pop $2 + FileWrite $0 "TEMP=$2$\r$\n" + + Push $INSTDIR + Push "\" + Call StrSlash + Pop $2 + FileWrite $0 "INSTDIR=$2/$\r$\n" + FileWrite $0 "DB_NAME=$DB_NAME$\r$\n" + FileWrite $0 "MYSQL_HOST=$MYSQL_HOST$\r$\n" + FileWrite $0 "DB_USER=$DB_USER$\r$\n" + FileWrite $0 "DB_PASS=$DB_PASS$\r$\n" + Push $LAMS_DIR + Push "\" + Call StrSlash + Pop $2 + FileWrite $0 "EARDIR=$2/jboss-4.0.2/server/default/deploy/lams.ear$\r$\n" + + copyfiles "$TEMP\installer.properties" $INSTDIR + + SetOutPath $INSTDIR + File /a "${ANT}\LanguagePack.xml" + + ReadRegStr $0 HKLM "${REG_HEAD}" "dir_inst" + + ; update locals must be stored as a procedure first + ; use ANT to store procedures + DetailPrint '$0\apache-ant-1.6.5\bin\newAnt.bat insertLocale-db' + nsExec::ExecToStack '$0\apache-ant-1.6.5\bin\newAnt.bat -logfile "..\..\..\..\..\..\..\..\..\update-logs\ant-insert-locales.log" -buildfile $INSTDIR\LanguagePack.xml insertLocale-db' + Pop $0 ; return code, 0=success, error=fail + Pop $1 ; console output + DetailPrint "Database insert status: $0" + DetailPrint "Database insert output: $1" + ${if} $0 != 0 + goto error + ${endif} + + goto done + error: + DetailPrint "Ant insertLocale-db failed." + MessageBox MB_OK|MB_ICONSTOP "LAMS configuration failed. Please check your LAMS configuration and try again.$\r$\nError:$\r$\n$\r$\n$1" + Abort "LAMS configuration failed." + + done: + ; remove the sql scripts + delete "$INSTDIR\updateLocales.sql" + delete "$INSTDIR\LanguagePack.xml" + delete "$INSTDIR\installer.properties" + rmdir /r "$INSTDIR\apache-ant-1.6.5" + +FunctionEnd +################################################################################ +# END CODE USED FOR LANGUAGE PACK # +################################################################################ + Index: win_installer/patch/src/sql/updateLocales.sql =================================================================== diff -u --- win_installer/patch/src/sql/updateLocales.sql (revision 0) +++ win_installer/patch/src/sql/updateLocales.sql (revision 1e8a5f06a79e03ae6e078f2e5544d9e38b3c9dde) @@ -0,0 +1,26 @@ +-- Fixing Japanese language string. See LDEV-1702 +-- checks if the languages in the language pack exist +-- inserts rows into lams_supported_locale iff the languages dont exist +drop table if exists locale_temp; + +create table locale_temp ( + language_iso_code VARCHAR(2) NOT NULL + , country_iso_code VARCHAR(2) + , description VARCHAR(255) NOT NULL + , direction VARCHAR(3) NOT NULL + , combined VARCHAR(5) NOT NULL + , fckeditor_code VARCHAR(10) +)TYPE=InnoDB; + +-- the combined column must be 'language_iso_code,country_iso_code' or 'language_iso_code'. It must match the value +-- given by SELECT CONCAT_WS(',',l.language_iso_code,l.country_iso_code) FROM lams_supported_locale l +INSERT INTO locale_temp (language_iso_code, country_iso_code, description, direction, combined, fckeditor_code) VALUES ('tr','TR','Türkçe','LTR','tr,TR', 'tr'); + +INSERT INTO lams_supported_locale (language_iso_code, country_iso_code, description, direction, fckeditor_code) +(SELECT t.language_iso_code, t.country_iso_code, t.description, t.direction, t.fckeditor_code +FROM locale_temp t WHERE t.combined NOT IN +(SELECT CONCAT_WS(',',l.language_iso_code,l.country_iso_code) FROM lams_supported_locale l)); +drop table if exists locale_temp; + +-- Update the lams-configuration table to have the correct value +UPDATE lams_configuration SET config_value="2008-09-05" WHERE config_key="DictionaryDateCreated"; \ No newline at end of file