Index: win_installer/src/language-pack.nsi =================================================================== diff -u -rb774997180e1f25228b59a70714036cdc22c3ae6 -r9d6fcf6e3965c390f8c55f79623a33fb673a4906 --- win_installer/src/language-pack.nsi (.../language-pack.nsi) (revision b774997180e1f25228b59a70714036cdc22c3ae6) +++ win_installer/src/language-pack.nsi (.../language-pack.nsi) (revision 9d6fcf6e3965c390f8c55f79623a33fb673a4906) @@ -32,10 +32,19 @@ # constants -!define VERSION "2006-12-12" ; DATE of language pack in fromat YYYYMMDD +!define VERSION "2006-20-12" ; DATE of language pack in fromat YYYYMMDD !define SOURCE_JBOSS_HOME "D:\jboss-4.0.2" ; location of jboss where lams was deployed !define REG_HEAD "Software\LAMS Foundation\LAMSv2" +# display finish page stuff +!define MUI_FINISHPAGE_RUN $LAMS_DIR\lams-start.exe +!define MUI_FINISHPAGE_RUN_TEXT "Start LAMS now" +;!define MUI_FINISHPAGE_TEXT "The LAMS Server has been successfully installed on your computer." +!define MUI_FINISHPAGE_SHOWREADME $LAMS_DIR\readme.txt +!define MUI_FINISHPAGE_SHOWREADME_TEXT "Open the readme file" +!define MUI_FINISHPAGE_LINK "Visit LAMS Community" +!define MUI_FINISHPAGE_LINK_LOCATION "http://www.lamscommunity.org" + # installer settings !define MUI_ICON "..\graphics\lams2.ico" @@ -77,16 +86,6 @@ !define MUI_FINISHPAGE_NOAUTOCLOSE !define MUI_UNFINISHPAGE_NOAUTOCLOSE -# display finish page stuff -!define MUI_FINISHPAGE_RUN $INSTDIR\lams-start.exe -!define MUI_FINISHPAGE_RUN_TEXT "Start LAMS now" -!define MUI_FINISHPAGE_TEXT "The LAMS Server has been successfully installed on your computer." -!define MUI_FINISHPAGE_SHOWREADME $INSTDIR\readme.txt -;!define MUI_FINISHPAGE_SHOWREADME_TEXT "Open the readme file" -!define MUI_FINISHPAGE_LINK "Visit LAMS Community" -!define MUI_FINISHPAGE_LINK_LOCATION "http://www.lamscommunity.org" - - # installer screen pages ;-------------------------------- !insertmacro MUI_PAGE_WELCOME @@ -163,6 +162,7 @@ Var FLASHXML_DIR Var SQL_QUERY Var FOLDER_FLAG +Var OLD_VERSION ${Array} RF_FOLDERS ${Array} CS_FOLDERS ${Array} FS_FOLDERS @@ -235,7 +235,9 @@ MessageBox MB_OK|MB_ICONSTOP "Your current language pack is a newer version than this version: LAMS-LanguagePack-$0" Abort ${EndIf} + strcpy $OLD_VERSION $0 + # Abort if there is no version of LAMS2 installed ReadRegStr $0 HKLM "${REG_HEAD}" "version" ${If} $0 = "" @@ -255,6 +257,17 @@ RMDir /r "$EXEDIR\build" FunctionEnd +Function .onInstFailed + WriteRegStr HKLM "${REG_HEAD}" "language_pack" $OLD_VERSION + RMDir /r "$EXEDIR\zip" + RMDir /r "$EXEDIR\build" + delete "$INSTDIR\updateLocales.sql" + delete "$INSTDIR\LanguagePack.xml" + delete "$INSTDIR\installer.properties" + rmdir /r $TEMP + rmdir /r "$INSTDIR\apache-ant-1.6.5" +FunctionEnd + ;backup existing language files ;zip to $INSTDIR\jboss-4.0.2\server\default\deploy\lams.ear\lams-dictionary.jar\lams-dictionary-bak.zip Function zipLanguages @@ -420,23 +433,23 @@ strcpy $FOLDER_FLAG "0" call executeSQLScript pop $0 - detailprint "SQL script result for Chat and Scribe: $\n$0" + #detailprint "SQL script result for Chat and Scribe: $\n$0" ; getting the rows for Forum and Scribe strcpy $SQL_QUERY '"SELECT learning_library_id FROM lams_learning_library WHERE title = $\'Forum and Scribe$\';"' strcpy $SQL_QUERY '"$MYSQL_DIRbin\mysql.exe" -u"$DB_USER" -p"$DB_PASS" -s -i -B $DB_NAME -e $SQL_QUERY' strcpy $FOLDER_FLAG "1" call executeSQLScript pop $0 - detailprint "SQL script result for Forum and Scribe: $\n$0" + #detailprint "SQL script result for Forum and Scribe: $\n$0" ; getting the rows for Resources and Forum strcpy $SQL_QUERY '"SELECT learning_library_id FROM lams_learning_library WHERE title = $\'Resources and Forum$\';"' strcpy $SQL_QUERY '"$MYSQL_DIRbin\mysql.exe" -u"$DB_USER" -p"$DB_PASS" -s -i -B $DB_NAME -e $SQL_QUERY' strcpy $FOLDER_FLAG "2" call executeSQLScript pop $0 - detailprint "SQL script result for Resource and Forum: $\n$0" + #detailprint "SQL script result for Resource and Forum: $\n$0" ; copy all the folders for llid Chat and Scribe IntOp $R0 "$CS_FOLDERS_UBound" + 1 @@ -513,8 +526,6 @@ ${endif} ${endwhile} - - #check for errors and write result to install window ${if} $0 != 0 goto Errors @@ -530,37 +541,37 @@ 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 + Exch $R0 + Exch + Exch $R1 + Push $R2 + Push $R3 + StrCpy $R3 $R1 + StrLen $R1 $R0 IntOp $R1 $R1 + 1 - StrCpy $R0 $R0 -$R1 - StrCpy $R1 $R2 - exit2: - Pop $R3 - Pop $R2 - Exch $R1 ;rest - Exch - Exch $R0 ;first + 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 @@ -621,7 +632,7 @@ error: DetailPrint "Ant configure-deploy 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." + Abort "LAMS configuration failed." done: ; remove the sql scripts @@ -630,7 +641,7 @@ delete "$INSTDIR\installer.properties" rmdir /r $TEMP rmdir /r "$INSTDIR\apache-ant-1.6.5" - + FunctionEnd