Changeset 15095
- Timestamp:
- 2008-03-20T10:48:10+13:00 (16 years ago)
- Location:
- release-kits/wirk3
- Files:
-
- 1 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
release-kits/wirk3
- Property svn:externals
-
old new 1 1 lib http://svn.greenstone.org/release-kits/shared/lib 2 search4j http://svn.greenstone.org/release-kits/shared/search4j 2 3 4
-
- Property svn:externals
-
release-kits/wirk3/ant-scripts/build.xml
r15053 r15095 15 15 <import file="compile.xml"/> 16 16 <import file="create-distribution.xml"/> 17 <import file="create-launcher.xml"/>18 17 <import file="create-installer.xml"/> 19 18 <import file="wrap.xml"/> … … 24 23 <addressedcall target="compile"/> 25 24 <addressedcall target="create-distribution"/> 26 <addressedcall target="create-launcher"/>27 25 <addressedcall target="create-installer"/> 28 26 <addressedcall target="wrap"/> -
release-kits/wirk3/ant-scripts/create-distribution.xml
r15053 r15095 59 59 <target name="create-distributions-2"> 60 60 <if><bool><istrue value="${execute}"/></bool> 61 <ant antfile="${wirk3.home}/ant-scripts/operations-on-gs3home.xml" dir="distribution/greenstone3" target="create-distribution-2" 61 <ant antfile="${wirk3.home}/ant-scripts/operations-on-gs3home.xml" dir="distribution/greenstone3" target="create-distribution-2" inheritAll="false"> 62 62 <property name="app.version" value="${version}"/> 63 63 <property name="branch.path" value="${branch.path}"/> … … 69 69 <target name="create-distributions-3"> 70 70 <if><bool><istrue value="${execute}"/></bool> 71 <ant antfile="${wirk3.home}/ant-scripts/operations-on-gs3home.xml" dir="distribution/greenstone3" target="create-distribution-3" 71 <ant antfile="${wirk3.home}/ant-scripts/operations-on-gs3home.xml" dir="distribution/greenstone3" target="create-distribution-3" inheritall="false"> 72 72 <property name="app.version" value="${version}"/> 73 73 <property name="branch.path" value="${branch.path}"/> -
release-kits/wirk3/ant-scripts/wrap.xml
r15023 r15095 11 11 <project name="wirk3-wrap" default="wrap"> 12 12 <property name="java.installer" value="jre-6u3-windows-i586-p-s.exe"/> 13 <property name="java.min.version" value="1.5.0_00"/> 13 14 14 15 … … 23 24 <if><bool><istrue value="${execute}"/></bool> 24 25 26 <!--create a directory to build the wrapped installer in --> 25 27 <mkdir dir="${basedir}/wrapped-installer/build"/> 26 28 <copy todir="${basedir}/wrapped-installer/build" file="${wirk3.home}/wrapper/wrapper.cpp"/> … … 28 30 <copy todir="${basedir}/wrapped-installer/build" file="${wirk3.home}/wrapper/wrapper-with-jre.rc"/> 29 31 30 <!-- resources to bundle -->32 <!-- copy resources to bundle --> 31 33 <copy todir="${basedir}/wrapped-installer/build" file="${wirk3.home}/icon/gs3.ico"/> 32 34 <copy todir="${basedir}/wrapped-installer/build" file="${wirk3.home}/wrapper/${java.installer}"/> 35 <copy todir="${basedir}/wrapped-installer/build" file="${wirk3.home}/search4j/search4j.exe"/> 33 36 <copy tofile="${basedir}/wrapped-installer/build/greenstone3.jar" file="${basedir}/installer/greenstone-${version}-win32.jar"/> 34 <copy todir="${basedir}/wrapped-installer/build" file="${basedir}/launcher/launch-installer.exe"/>37 35 38 36 <!-- substitute in the real java installer filename-->39 <!-- substitute the real java installer filename and min version into various files --> 37 40 <rsr file="${basedir}/wrapped-installer/build/wrapper.rc" pattern="@java.installer@" replacement="${java.installer}"/> 38 41 <rsr file="${basedir}/wrapped-installer/build/wrapper-with-jre.rc" pattern="@java.installer@" replacement="${java.installer}"/> 39 42 <rsr file="${basedir}/wrapped-installer/build/wrapper.cpp" pattern="@java.installer@" replacement="${java.installer}"/> 43 <rsr file="${basedir}/wrapped-installer/build/wrapper.cpp" pattern="@java.min.version@" replacement="${java.min.version}"/> 40 44 41 45 … … 65 69 </exec> 66 70 <exec executable="link" dir="${basedir}/wrapped-installer/build"> 67 <arg line="/OUT:..\greenstone-${version}-win32-with-j re.exe wrapper.obj wrapper-with-jre.res"/>71 <arg line="/OUT:..\greenstone-${version}-win32-with-java.exe wrapper.obj wrapper-with-jre.res"/> 68 72 </exec> 69 73 </if> -
release-kits/wirk3/installer/antinstall-config.xml
r15053 r15095 43 43 <page type="input" name="tomcatports" displayText="Tomcat Ports"> 44 44 45 <comment displayText="Please select the ports which the web server (Apache Tomcat) will use will use. It is usually safe to accept the defaults by just clicking Next. The exception is when you are running other services on these ports - if this is the case, select some free ports and click Next."/>45 <comment name="tomcatportsdescription" displayText="Please select the ports which the web server (Apache Tomcat) will use will use. It is usually safe to accept the defaults by just clicking Next. The exception is when you are running other services on these ports - if this is the case, select some free ports and click Next."/> 46 46 47 47 <text property="tomcat.server" defaultValue="localhost" displayText="Tomcat Server"/> … … 56 56 displayText="Components to install"> 57 57 <comment 58 name="choosecomponents" 58 59 displayText="Choose the components you want to install" 59 60 bold="true"/> -
release-kits/wirk3/installer/build.xml
r15053 r15095 16 16 <typedef name="rsr" classname="RegexSearchReplace" classpathref="project.classpath"/> 17 17 18 <!-- create a local installDir String --> 19 <path id="installDir.path"> 20 <pathelement location="${installDir}"/> 21 </path> 22 <property name="installDir.local" refid="installDir.path"/> 23 24 18 25 <target name="default" depends=""> 19 26 … … 84 91 <!-- change the tomcat ports in tomcats server.xml --> 85 92 <echo message="Changing tomcat ports tomcat's server.xml"/> 86 <copy file="${installDir}/resources/tomcat/server.xml" tofile="${installDir }/packages/tomcat/conf/server.xml" overwrite="true"/>87 <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern=" (.*)@port@(.*)" replacement="$1${tomcat.port}$2" />88 <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern=" (.*)@shutdown-port@(.*)" replacement="$1${tomcat.shutdown.port}$2" />93 <copy file="${installDir}/resources/tomcat/server.xml" tofile="${installDir.local}/packages/tomcat/conf/server.xml" overwrite="true"/> 94 <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="@port@" replacement="${tomcat.port}" /> 95 <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="@shutdown-port@" replacement="${tomcat.shutdown.port}" /> 89 96 90 97 <!-- copy the greenstone3.xml file to tomcat --> 91 98 <echo message="Copying greenstone3.xml to tomcat directory"/> 92 99 <copy file="${installDir}/resources/tomcat/greenstone3.xml" tofile="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" overwrite="true"/> 93 <rsr file="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" pattern=" (.*)@gsdl3webhome@(.*)" replacement="$1${installDir}/web$2" />100 <rsr file="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" pattern="@gsdl3webhome@" replacement="${installDir.local}\web" /> 94 101 95 102 <!-- set up global properties --> 96 103 <echo message="Setting up global properties"/> 97 104 <copy file="${installDir}/resources/java/global.properties.in" tofile="${installDir}/web/WEB-INF/classes/global.properties" overwrite="true"/> 98 <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern=" (.*)@gsdl3home@(.*)" replacement="$1${installDir}/web$2" />99 <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern=" (.*)@tomcat.server@(.*)" replacement="$1localhost$2" />100 <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern=" (.*)@tomcat.port@(.*)" replacement="$1${tomcat.port}$2" />105 <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="@gsdl3home@" replacement="${installDir.local}\web" /> 106 <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="@tomcat.server@" replacement="${tomcat.server}" /> 107 <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="@tomcat.port@" replacement="${tomcat.port}" /> 101 108 102 109 <!-- set up log4j properties--> 103 110 <echo message="Setting up log4j properties"/> 104 111 <copy file="${installDir}/resources/java/log4j.properties.in" tofile="${installDir}/web/WEB-INF/classes/log4j.properties" overwrite="true"/> 105 <rsr file="${installDir}/web/WEB-INF/classes/log4j.properties" pattern=" (.*)@gsdl3home@(.*)" replacement="$1${installDir}/web$2" />112 <rsr file="${installDir}/web/WEB-INF/classes/log4j.properties" pattern="@gsdl3home@" replacement="${installDir.local}\web" /> 106 113 107 114 <!-- get the found JRE_HOME --> 108 <exec executable=" cmd" dir="${installDir}" outputproperty="backup.jre.home"><arg line="/C launch-installer.exe -find"/></exec>115 <exec executable="search4j.exe" outputproperty="backup.jre.home"><arg line="-m @java.min.version@"/></exec> 109 116 110 117 <!-- in the gs3-setup.sh file, set ANT_HOME and put it in PATH, and set the fallback JRE_HOME --> 111 118 <echo>In the gs3-setup.sh file, set ANT_HOME and put it in PATH</echo> 112 <exec executable="cmd" output="${installDir}/machine.bat" append="true"><arg line="/C echo set ANT_HOME=${installDir}/packages/ant"/></exec> 113 <exec executable="cmd" output="${installDir}/machine.bat" append="true"><arg line="/C echo set PATH=\%ANT_HOME\%/bin:\%PATH\%"/></exec> 114 <exec executable="cmd" output="${installDir}/machine.bat" append="true"><arg line="/C echo set BACKUP_JRE_HOME=${backup.jre.home}"/></exec> 119 <concat destfile="${installDir}/machine.bat" append="yes"> 120 set ANT_HOME=${installDir}\packages\ant 121 set PATH=%ANT_HOME%\bin;%PATH% 122 set BACKUP_JAVA_HOME=${backup.jre.home} 123 </concat> 124 115 125 116 126 <!-- delete unneeded files --> -
release-kits/wirk3/src/wirk3.cpp
r15023 r15095 84 84 //command = command + "."; 85 85 86 cout << "---------" << endl << " WiRK3" << endl << "---------" << endl; 86 cout 87 << "O-----------------------------------------O" << endl 88 << "| |" << endl 89 << "| WiRK3 |" << endl 90 << "| Windows Release Kit for Greenstone3 |" << endl 91 << "| |" << endl 92 << "O-----------------------------------------O" << endl 93 ; 87 94 88 95 cout << "pwd: " << pwd << endl; -
release-kits/wirk3/wrapper/wrapper-with-jre.rc
r15023 r15095 1 1 GREENSTONE_JAR JAR "greenstone3.jar" 2 LAUNCHER EXE "launch-installer.exe"2 SEARCH4J EXE "search4j.exe" 3 3 JAVA EXE "@java.installer@" 4 4 MAINICON ICON "gs3.ico" -
release-kits/wirk3/wrapper/wrapper.cpp
r15053 r15095 3 3 #include <fstream> 4 4 #include <iostream> 5 #include <conio.h> 6 #include <string> 7 #include <time.h> 5 8 6 9 using namespace std; … … 37 40 } 38 41 39 void main() 40 { 41 42 void cleanup( string dir, string file ) { 43 string command = "if EXIST "; 44 command.append( dir ); 45 command.append( "\\" ); 46 command.append( file ); 47 command.append( " del " ); 48 command.append( dir ); 49 command.append( "\\" ); 50 command.append( file ); 51 system( command.c_str() ); 52 } 53 54 void main() { 55 string command; 56 srand( time(0) ); 57 42 58 cout << "Greenstone3 Installer" << endl; 43 59 44 60 //create the temp folder 45 cout << "Creating temp folder 'greenstone3.tmp' ..." << endl; 46 system("mkdir greenstone3.tmp"); 61 char id[6]; for( int i=0; i<5; i++ ) id[i] = (char)((rand()%26) + 97); id[5] = '\0'; //id for this instance 62 string tempdir = "greenstone3.tmp"; tempdir.append( id ); //the temp dir 63 64 cout << "Creating temp folder '"; 65 cout << tempdir; 66 cout << "' ..." << endl; 67 command = "mkdir "; command.append(tempdir); 68 system( command.c_str() ); 47 69 48 70 //extract the resources 49 cout << "Extracting jar launcher ..." << endl; 50 extractResource( "LAUNCHER", "EXE", "greenstone3.tmp\\launch-installer.exe" ); 71 cout << "Extracting search4j tool ..." << endl; 72 string search4jLocation = ""; search4jLocation.append( tempdir ); search4jLocation.append( "\\search4j.exe" ); 73 extractResource( "SEARCH4J", "EXE", (char*) search4jLocation.c_str() ); 51 74 52 75 cout << "Extracting jar installer ..." << endl; 53 extractResource( "GREENSTONE_JAR", "JAR", "greenstone3.tmp\\greenstone3.jar" ); 54 76 string jarLocation = ""; jarLocation.append( tempdir ); jarLocation.append( "\\greenstone3.jar" ); 77 extractResource( "GREENSTONE_JAR", "JAR", (char*) jarLocation.c_str() ); 78 55 79 //change to the temp directory and start the jar 56 SetCurrentDirectory( "greenstone3.tmp");80 SetCurrentDirectory( tempdir.c_str() ); 57 81 58 //launch the jar with launch4j, taking a note of the exit code or info in the log 59 cout << "Launching Installer ..." << endl; 60 int launch_exit_code = 0; 61 launch_exit_code = system("launch-installer.exe"); 62 63 //if it failed, launch the installer for the bundled java, then try again 64 if ( launch_exit_code == 1 ) { 65 cout << "Greenstone requires Java Runtime Enviromnent (JRE) 1.4.0 or greater" << endl; 66 cout << "It appears that you do not have an a suitible JRE installed" << endl; 67 82 //check if an appropriate java is found 83 bool jvmFound = (system( "search4j.exe -m @java.min.version@" ) == 0); 84 85 //if the jvm was not found, try to fix it and find it 86 if ( !jvmFound ) { 87 //did not find a good java 88 cout << "Greenstone requires java @java.min.version@ or greater" << endl; 89 90 //tell them if java is absent or just too old 91 if ( system( "search4j.exe" ) == 0 ) { 92 cout << "Your java is too old." << endl; 93 } else { 94 cout << "Could not find java." << endl; 95 } 68 96 69 97 //is this an installer with the bundled JRE? 70 cout << " Extracting java installer..." << endl;98 cout << "Checking for bundled java ..." << endl; 71 99 int extract_result = extractResource( "JAVA", "EXE", "@java.installer@" ); 72 100 if ( extract_result == 0 ) { 73 74 101 //yes, JRE is bundled 75 cout << "Starting the installation process for the bundled JRE" << endl; 76 system( "@java.installer@" ); 77 launch_exit_code = system("launch-installer.exe"); 78 if ( launch_exit_code == 1 ) { 79 cout << "Still could not find a JRE. Please install a JRE and try again." << endl; 102 cout 103 << "This installer comes bundled with a suitible version of java: " << endl 104 << " @java.installer@" << endl 105 << "Do you want to install this java? (y/n)" << endl; 106 char r[1024]; cin >> r; 107 if ( _stricmp( r, "y" ) == 0 ) { 108 system( "@java.installer@" ); 80 109 } 81 110 jvmFound = true; //assume the java installation went well 82 111 } else { 83 84 112 //no, JRE is not bundled 85 cout << "Sorry, there is no bundled JRE" << endl; 86 cout << "Install a JRE and try again (make sure JRE_HOME is set)" << endl; 87 cout << "Or, download a greentsone3 installer with a bundled JRE and use that instead of this one" << endl; 113 cout << "Sorry, there is no bundled java with this installer" << endl; 114 cout << "Install java (@java.min.version@ or newer) and try again" << endl; 115 cout << "Or, download a greentsone3 installer with bundled java and use that instead of this one" << endl; 116 } 117 } 118 119 //if we have found it by now, launch the installer 120 if ( jvmFound ) { 121 //launch the jar with search4j, taking a note of the exit code 122 cout << "Launching Installer ..." << endl; 123 int launch_exit_code = 0; 124 launch_exit_code = system("search4j.exe -m @java.min.version@ -l greenstone3.jar"); 88 125 126 //if it failed, launch the installer for the bundled java, then try again 127 if ( launch_exit_code == 0 ) { 128 cout << "Setup complete" << endl; 129 } else { 130 cout << "Still could not find a suitible version of java" << endl; 131 cout << "Please install java and try again" << endl; 89 132 } 90 system("if EXISTS greenstone3.tmp\\@java.installer@ del greenstone3.tmp\\@java.installer@");91 92 133 } 93 134 94 135 //change back to the original directory and clean up the temp directory 95 136 SetCurrentDirectory(".."); 96 system("if EXISTS greenstone3.tmp\\greenstone3.jar del greenstone3.tmp\\greenstone3.jar"); 97 system("if EXISTS greenstone3.tmp\\launch-installer.exe del greenstone3.tmp\\launch-installer.exe"); 98 system("if EXISTS greenstone3.tmp\\ant.install.log del greenstone3.tmp\\ant.install.log"); 99 system("rmdir greenstone3.tmp"); 137 138 cleanup(tempdir, "greenstone3.jar" ); 139 cleanup(tempdir, "search4j.exe"); 140 cleanup(tempdir, "ant.install.log"); 141 cleanup(tempdir, "@java.installer@"); 100 142 143 command = "rmdir "; 144 command.append( tempdir ); 145 system( command.c_str() ); 146 cout << "Press any key to exit..." << endl; 147 getch(); 101 148 102 149 } -
release-kits/wirk3/wrapper/wrapper.rc
r15023 r15095 1 1 GREENSTONE_JAR JAR "greenstone3.jar" 2 LAUNCHER EXE "launch-installer.exe"2 SEARCH4J EXE "search4j.exe" 3 3 MAINICON ICON "gs3.ico" 4 4
Note:
See TracChangeset
for help on using the changeset viewer.