Index: win_installer/src/installer.nsi =================================================================== diff -u -rd4ac249eafcc49e86bc7eb9c67ad3d2812ad3bd9 -rda7934021df0f00885e918520301d62be37e0a85 --- win_installer/src/installer.nsi (.../installer.nsi) (revision d4ac249eafcc49e86bc7eb9c67ad3d2812ad3bd9) +++ win_installer/src/installer.nsi (.../installer.nsi) (revision da7934021df0f00885e918520301d62be37e0a85) @@ -750,14 +750,9 @@ ${EndIf} */ - ${if} $RETAIN_FILES == '1' - #replace the install dump with the retained dump - #MessageBox MB_OK|MB_ICONEXCLAMATION "Rebuilding datbase" - CopyFiles "$INSTDIR\backup\lamsDump.sql" "dump.sql" - DetailPrint "Using retained database: $INSTDIR\backup\lamsDump.sql" - ${endif} + # use Ant to import database DetailPrint '$INSTDIR\apache-ant-1.6.5\bin\ant.bat import-db' nsExec::ExecToStack '$INSTDIR\apache-ant-1.6.5\bin\newAnt.bat import-db' @@ -774,6 +769,23 @@ goto error ${EndIf} + ${if} $RETAIN_FILES == '1' + #replace the install dump with the retained dump + #CopyFiles "$INSTDIR\backup\lamsDump.sql" "$TEMP\dump.sql" + DetailPrint "Using retained database: $INSTDIR\backup\lamsDump.sql" + strcpy $0 "$MYSQL_DIR\bin\mysql $DB_NAME -uroot - p$MYSQL_ROOT_PASS < $INSTDIR\backup\lamsDump.sql" + nsExec::ExecToStack $0 + pop $1 + pop $2 + DetailPrint $0 + DetailPrint $1 + MessageBox MB_OK|MB_ICONEXCLAMATION "Rebuilding datbase $\n$0 $\n$1 $\n$2" + + ${if} $0 != 0 + goto error + ${endif} + ${endif} + goto done error: @@ -838,12 +850,12 @@ FunctionEnd Function SetupStartMenu - CreateDirectory "$SMPROGRAMS\LAMSv2" + CreateDirectory "$SMPROGRAMS\LAMSv2" CreateShortCut "$SMPROGRAMS\LAMSv2\Access LAMS.lnk" "http://$LAMS_DOMAIN:$LAMS_PORT/lams/" CreateShortCut "$SMPROGRAMS\LAMSv2\LAMS Community.lnk" "http://www.lamscommunity.org" - CreateShortCut "$SMPROGRAMS\LAMSv2\Start LAMS.lnk" "$INSTDIR\lams-start.exe" - CreateShortCut "$SMPROGRAMS\LAMSv2\Stop LAMS.lnk" "$INSTDIR\lams-stop.exe" - CreateShortCut "$SMPROGRAMS\LAMSv2\Uninstall LAMS.lnk" "$INSTDIR\lams-uninstall.exe" + CreateShortCut "$SMPROGRAMS\LAMSv2\Start LAMS.lnk" "$INSTDIR\lams-start.exe" + CreateShortCut "$SMPROGRAMS\LAMSv2\Stop LAMS.lnk" "$INSTDIR\lams-stop.exe" + CreateShortCut "$SMPROGRAMS\LAMSv2\Uninstall LAMS.lnk" "$INSTDIR\lams-uninstall.exe" FunctionEnd @@ -1124,4 +1136,4 @@ RMDir /r "$SMPROGRAMS\LAMSv2" DetailPrint "Removed start menu entries." DetailPrint "Uninstall complete." -SectionEnd +SectionEnd \ No newline at end of file Index: win_installer/src/language-pack.nsi =================================================================== diff -u -r2a39cfd01f97370e6c6b6f2678779703ccf8e409 -rda7934021df0f00885e918520301d62be37e0a85 --- win_installer/src/language-pack.nsi (.../language-pack.nsi) (revision 2a39cfd01f97370e6c6b6f2678779703ccf8e409) +++ win_installer/src/language-pack.nsi (.../language-pack.nsi) (revision da7934021df0f00885e918520301d62be37e0a85) @@ -192,15 +192,8 @@ ; \server\default\lams.ear\lams-central.war\flashxml call copyFlashxml - #################### - # TODO Work out what language files to copy to the 'library' directory - # TODO Copy the flshxml files - #################### - - #SELECT concat("@",learning_library_id,"@") FROM lams_learning_library SELECT concat("@",learning_library_id,"@") FROM lams_learning_library - - #lams_blah\conf\language\*.properties - # lams_central\flashxml\* + ; Finally, add rows in the database (lams_supported_locale) for all new language files + call updateDatase SectionEnd ;-------------------------------- @@ -422,27 +415,31 @@ ${FS_FOLDERS->Init} ${RF_FOLDERS->Init} + ; getting the rows for Chat and Scribe strcpy $SQL_QUERY '"SELECT learning_library_id FROM lams_learning_library WHERE title = $\'Chat 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 "0" call executeSQLScript pop $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" + ; 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" + ; copy all the folders for llid Chat and Scribe IntOp $R0 "$CS_FOLDERS_UBound" + 1 ${do} ${CS_FOLDERS->Get} $CS_FOLDERS_UBound $R1 @@ -456,6 +453,7 @@ ${loopuntil} $R0 == "0" + ; copy all the folders for llid Forum and Scribe IntOp $R0 "$FS_FOLDERS_UBound" + 1 ${do} ${FS_FOLDERS->Get} $FS_FOLDERS_UBound $R1 @@ -468,6 +466,7 @@ file /a "..\..\lams_build\librarypackages\forumscribe\language\*" ${loopuntil} $R0 == "0" + ; copy all the folders for llid Resource and Forum IntOp $R0 "$RF_FOLDERS_UBound" + 1 ${do} ${RF_FOLDERS->Get} $RF_FOLDERS_UBound $R1 @@ -478,8 +477,7 @@ detailprint "Copying language files for resource and forum" file /a "..\..\lams_build\librarypackages\shareresourcesforum\language\*" ${loopuntil} $R0 == "0" - - + FunctionEnd @@ -565,3 +563,16 @@ Exch Exch $R0 ;first FunctionEnd + +Function updateDatase + ; get the procedure scripts required + setoutpath "$INSTDIR\sqlscripts" + File /a + + + + ; remove the sql scripts + rmdir /r "$INSTDIR\sqlscripts" +FunctionEnd + +