Index: win_installer/graphics/favicon.ico =================================================================== diff -u Binary files differ Index: win_installer/src/build.xml =================================================================== diff -u -rff859f03f21f89a3c7c22622a65a09e48b1cd5ec -rce62da8c797dd3f95cb9160151e2128c32525800 --- win_installer/src/build.xml (.../build.xml) (revision ff859f03f21f89a3c7c22622a65a09e48b1cd5ec) +++ win_installer/src/build.xml (.../build.xml) (revision ce62da8c797dd3f95cb9160151e2128c32525800) @@ -58,6 +58,14 @@ + + + + + + + + Index: win_installer/src/installer.nsi =================================================================== diff -u -ra8e6dab9a52c98bfc9886b92c7794a3f5ef21cff -rce62da8c797dd3f95cb9160151e2128c32525800 --- win_installer/src/installer.nsi (.../installer.nsi) (revision a8e6dab9a52c98bfc9886b92c7794a3f5ef21cff) +++ win_installer/src/installer.nsi (.../installer.nsi) (revision ce62da8c797dd3f95cb9160151e2128c32525800) @@ -25,10 +25,8 @@ /* * TODO: uninstaller option to keep database/lams.xml/repository * TODO: detect if db exists and has data, ask whether to use or import fresh db - * TODO: custom lams admin user LDEV-27 + * TODO: custom lams admin user LI-27 * TODO: desktop icons, readme? - * TODO: open login page when start server LDEV-28 - * TODO: detect if already installed, prompt user to uninstall or first (or should the installer do this after getting the OK?) * TODO: transaction isolation */ @@ -48,8 +46,8 @@ !define REG_HEAD "Software\LAMS Foundation\LAMSv2" # installer settings -!define MUI_ICON "..\graphics\lams2.ico" -!define MUI_UNICON "..\graphics\lams2.ico" +!define MUI_ICON "..\graphics\favicon.ico" +!define MUI_UNICON "..\graphics\favicon.ico" Name "LAMS ${VERSION}" ;BrandingText "LAMS ${VERSION} -- built on ${__TIMESTAMP__}" BrandingText "LAMS ${VERSION} -- built on ${__DATE__} ${__TIME__}" @@ -302,6 +300,13 @@ # select language ;!insertmacro MUI_LANGDLL_DISPLAY + # Abort install if already installed + ReadRegStr $0 HKLM "${REG_HEAD}" "version" + ${If} $0 != "" + MessageBox MB_OK|MB_ICONSTOP "LAMS $0 is installed. Please uninstall before continuing." + Abort + ${EndIf} + # extract custom page display config !insertmacro MUI_INSTALLOPTIONS_EXTRACT "lams.ini" !insertmacro MUI_INSTALLOPTIONS_EXTRACT "lams2.ini" @@ -513,6 +518,7 @@ File "..\templates\server.xml" File "..\templates\run.bat" File "..\templates\wrapper.conf" + File "..\templates\index.html" # create installer.properties ClearErrors @@ -767,6 +773,7 @@ Delete "$TEMP\build.xml" Delete "$TEMP\installer.properties" Delete "$INSTDIR\wrapper.conf" + Delete "$TEMP\index.html" FunctionEnd Function .onInstFailed Index: win_installer/src/lams-start.nsi =================================================================== diff -u -r4f08a4b09d39d6ac6a50507d97eacda49bb40f96 -rce62da8c797dd3f95cb9160151e2128c32525800 --- win_installer/src/lams-start.nsi (.../lams-start.nsi) (revision 4f08a4b09d39d6ac6a50507d97eacda49bb40f96) +++ win_installer/src/lams-start.nsi (.../lams-start.nsi) (revision ce62da8c797dd3f95cb9160151e2128c32525800) @@ -24,6 +24,9 @@ !include "MUI.nsh" !include "LogicLib.nsh" +!include "Functions.nsh" + +!define REG_HEAD "Software\LAMS Foundation\LAMSv2" Name "Start LAMS" OutFile "..\build\lams-start.exe" @@ -35,72 +38,33 @@ SetSilent silent FunctionEnd -# http://nsis.sourceforge.net/StrStr -# -!define StrStr "!insertmacro StrStr" - -!macro StrStr ResultVar String SubString - Push `${String}` - Push `${SubString}` - Call StrStr - Pop `${ResultVar}` -!macroend - -Function StrStr -/*After this point: - ------------------------------------------ - $R0 = SubString (input) - $R1 = String (input) - $R2 = SubStringLen (temp) - $R3 = StrLen (temp) - $R4 = StartCharPos (temp) - $R5 = TempStr (temp)*/ - - ;Get input from user - Exch $R0 - Exch - Exch $R1 - Push $R2 - Push $R3 - Push $R4 - Push $R5 - - ;Get "String" and "SubString" length - StrLen $R2 $R0 - StrLen $R3 $R1 - ;Start "StartCharPos" counter - StrCpy $R4 0 - - ;Loop until "SubString" is found or "String" reaches its end - ${Do} - ;Remove everything before and after the searched part ("TempStr") - StrCpy $R5 $R1 $R2 $R4 - - ;Compare "TempStr" with "SubString" - ${IfThen} $R5 == $R0 ${|} ${ExitDo} ${|} - ;If not "SubString", this could be "String"'s end - ${IfThen} $R4 >= $R3 ${|} ${ExitDo} ${|} - ;If not, continue the loop - IntOp $R4 $R4 + 1 - ${Loop} - -/*After this point: - ------------------------------------------ - $R0 = ResultVar (output)*/ - - ;Remove part before "SubString" on "String" (if there has one) - StrCpy $R0 $R1 `` $R4 - - ;Return output to user - Pop $R5 - Pop $R4 - Pop $R3 - Pop $R2 - Pop $R1 - Exch $R0 -FunctionEnd - Section + ReadRegStr $9 HKLM "${REG_HEAD}" "db_user" + ReadRegStr $8 HKLM "${REG_HEAD}" "db_pass" + ReadRegStr $7 HKLM "${REG_HEAD}" "dir_inst" + ReadRegStr $6 HKLM "${REG_HEAD}" "dir_mysql" + + # check mysql password, mysql server status + StrLen $0 $8 + ${If} $0 == 0 + nsExec::ExecToStack '$6\bin\mysqladmin ping -u $9' + ${Else} + nsExec::ExecToStack '$6\bin\mysqladmin ping -u $9 -p$8' + ${EndIf} + Pop $0 + Pop $1 + # check mysql password is correct + ${StrStr} $2 $1 "Access denied" + ${If} $2 != "" + ; mysql password somehow changed - prompt user to update registry entry + ${EndIf} + # check mysql is running + ${StrStr} $2 $1 "mysqld is alive" + ${If} $2 == "" + MessageBox MB_OK|MB_ICONEXCLAMATION "MySQL does not appear to be running - please make sure it is running before starting LAMS." + Abort + ${EndIf} + nsExec::ExecToStack 'sc start LAMSv2' Pop $0 Pop $1 @@ -109,6 +73,7 @@ MessageBox MB_OK|MB_ICONSTOP "Could not start LAMSv2 service: $\r$\n$1" ${Else} MessageBox MB_OK "Started LAMSv2 service. Please wait a minute or two while LAMS starts up." + ExecShell "open" '"$7\index.html"' ${EndIf} SectionEnd Index: win_installer/templates/index.html =================================================================== diff -u --- win_installer/templates/index.html (revision 0) +++ win_installer/templates/index.html (revision ce62da8c797dd3f95cb9160151e2128c32525800) @@ -0,0 +1,64 @@ + + + + + LAMS :: Learning Activity Management System + + + + + + + + + + + +
+ +

 

+ +
+ +
+ + +
+ +
+

LAMS - Learning Activity Management System

+ +
+

Waiting for LAMS to finish starting...

+
+

You will be redirected in 60 seconds.  Click here to go to the login page.

+ +

+ + + + +
+
+ + +
+ + + + + + + + +
+ + + + + +