Changeset 15095


Ignore:
Timestamp:
2008-03-20T10:48:10+13:00 (16 years ago)
Author:
oranfry
Message:

checking in a few weeks work on wirk3

Location:
release-kits/wirk3
Files:
1 added
10 edited

Legend:

Unmodified
Added
Removed
  • release-kits/wirk3

    • Property svn:externals
      •  

        old new  
        11lib http://svn.greenstone.org/release-kits/shared/lib
         2search4j http://svn.greenstone.org/release-kits/shared/search4j
        23
         4
  • release-kits/wirk3/ant-scripts/build.xml

    r15053 r15095  
    1515    <import file="compile.xml"/>
    1616    <import file="create-distribution.xml"/>
    17     <import file="create-launcher.xml"/>
    1817    <import file="create-installer.xml"/>
    1918    <import file="wrap.xml"/>
     
    2423        <addressedcall target="compile"/>
    2524        <addressedcall target="create-distribution"/>
    26         <addressedcall target="create-launcher"/>
    2725        <addressedcall target="create-installer"/>
    2826        <addressedcall target="wrap"/>
  • release-kits/wirk3/ant-scripts/create-distribution.xml

    r15053 r15095  
    5959    <target name="create-distributions-2">
    6060        <if><bool><istrue value="${execute}"/></bool>
    61             <ant antfile="${wirk3.home}/ant-scripts/operations-on-gs3home.xml" dir="distribution/greenstone3" target="create-distribution-2"  inheritAll="false">
     61            <ant antfile="${wirk3.home}/ant-scripts/operations-on-gs3home.xml" dir="distribution/greenstone3" target="create-distribution-2" inheritAll="false">
    6262                <property name="app.version" value="${version}"/>
    6363                <property name="branch.path" value="${branch.path}"/>
     
    6969    <target name="create-distributions-3">
    7070        <if><bool><istrue value="${execute}"/></bool>
    71             <ant antfile="${wirk3.home}/ant-scripts/operations-on-gs3home.xml" dir="distribution/greenstone3" target="create-distribution-3"  inheritall="false">
     71            <ant antfile="${wirk3.home}/ant-scripts/operations-on-gs3home.xml" dir="distribution/greenstone3" target="create-distribution-3" inheritall="false">
    7272                <property name="app.version" value="${version}"/>
    7373                <property name="branch.path" value="${branch.path}"/>
  • release-kits/wirk3/ant-scripts/wrap.xml

    r15023 r15095  
    1111<project name="wirk3-wrap" default="wrap">
    1212    <property name="java.installer" value="jre-6u3-windows-i586-p-s.exe"/>
     13    <property name="java.min.version" value="1.5.0_00"/>
    1314
    1415
     
    2324        <if><bool><istrue value="${execute}"/></bool>
    2425
     26            <!--create a directory to build the wrapped installer in -->
    2527            <mkdir dir="${basedir}/wrapped-installer/build"/>
    2628            <copy todir="${basedir}/wrapped-installer/build" file="${wirk3.home}/wrapper/wrapper.cpp"/>
     
    2830            <copy todir="${basedir}/wrapped-installer/build" file="${wirk3.home}/wrapper/wrapper-with-jre.rc"/>
    2931
    30             <!-- resources to bundle -->
     32            <!-- copy resources to bundle -->
    3133            <copy todir="${basedir}/wrapped-installer/build" file="${wirk3.home}/icon/gs3.ico"/>
    3234            <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"/>
    3336            <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           
    3538
    36             <!-- substitute in the real java installer filename -->
     39            <!-- substitute the real java installer filename and min version into various files -->
    3740            <rsr file="${basedir}/wrapped-installer/build/wrapper.rc" pattern="@java.installer@" replacement="${java.installer}"/>
    3841            <rsr file="${basedir}/wrapped-installer/build/wrapper-with-jre.rc" pattern="@java.installer@" replacement="${java.installer}"/>
    3942            <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}"/>
    4044
    4145           
     
    6569            </exec>
    6670            <exec executable="link" dir="${basedir}/wrapped-installer/build">
    67                 <arg line="/OUT:..\greenstone-${version}-win32-with-jre.exe wrapper.obj wrapper-with-jre.res"/>
     71                <arg line="/OUT:..\greenstone-${version}-win32-with-java.exe wrapper.obj wrapper-with-jre.res"/>
    6872            </exec>
    6973        </if>
  • release-kits/wirk3/installer/antinstall-config.xml

    r15053 r15095  
    4343    <page type="input" name="tomcatports" displayText="Tomcat Ports">
    4444
    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."/>
    4646
    4747        <text property="tomcat.server" defaultValue="localhost" displayText="Tomcat Server"/>
     
    5656            displayText="Components to install">
    5757        <comment
     58                name="choosecomponents"
    5859                displayText="Choose the components you want to install"
    5960                bold="true"/>
  • release-kits/wirk3/installer/build.xml

    r15053 r15095  
    1616    <typedef name="rsr" classname="RegexSearchReplace" classpathref="project.classpath"/>
    1717
     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   
    1825    <target name="default" depends="">
    1926
     
    8491        <!-- change the tomcat ports in tomcats server.xml -->
    8592        <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}" />
    8996       
    9097        <!-- copy the greenstone3.xml file to tomcat -->
    9198        <echo message="Copying greenstone3.xml to tomcat directory"/>
    9299        <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" />
    94101
    95102        <!-- set up global properties -->
    96103        <echo message="Setting up global properties"/>
    97104        <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}" />
    101108
    102109        <!-- set up log4j properties-->
    103110        <echo message="Setting up log4j properties"/>
    104111        <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" />
    106113
    107114        <!-- 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>
    109116               
    110117        <!-- in the gs3-setup.sh file, set ANT_HOME and put it in PATH, and set the fallback JRE_HOME -->
    111118        <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">
     120set ANT_HOME=${installDir}\packages\ant
     121set PATH=%ANT_HOME%\bin;%PATH%
     122set BACKUP_JAVA_HOME=${backup.jre.home}
     123</concat>
     124       
    115125
    116126        <!-- delete unneeded files -->     
  • release-kits/wirk3/src/wirk3.cpp

    r15023 r15095  
    8484    //command = command + ".";
    8585
    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        ;
    8794   
    8895    cout << "pwd: " << pwd << endl;
  • release-kits/wirk3/wrapper/wrapper-with-jre.rc

    r15023 r15095  
    11GREENSTONE_JAR JAR "greenstone3.jar"
    2 LAUNCHER EXE "launch-installer.exe"
     2SEARCH4J EXE "search4j.exe"
    33JAVA EXE "@java.installer@"
    44MAINICON ICON "gs3.ico"
  • release-kits/wirk3/wrapper/wrapper.cpp

    r15053 r15095  
    33#include <fstream>
    44#include <iostream>
     5#include <conio.h>
     6#include <string>
     7#include <time.h>
    58
    69using namespace std;
     
    3740}
    3841
    39 void main()
    40 {
    41    
     42void 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
     54void main() {
     55    string command;
     56    srand( time(0) );
     57
    4258    cout << "Greenstone3 Installer" << endl;
    4359       
    4460    //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() );
    4769   
    4870    //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() );
    5174   
    5275    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   
    5579    //change to the temp directory and start the jar
    56     SetCurrentDirectory("greenstone3.tmp");
     80    SetCurrentDirectory( tempdir.c_str() );
    5781
    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        }
    6896       
    6997        //is this an installer with the bundled JRE?
    70         cout << "Extracting java installer ..." << endl;
     98        cout << "Checking for bundled java ..." << endl;
    7199        int extract_result = extractResource( "JAVA", "EXE", "@java.installer@" );
    72100        if ( extract_result == 0 ) {
    73            
    74101            //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@" );
    80109            }
    81            
     110            jvmFound = true; //assume the java installation went well
    82111        } else {
    83            
    84112            //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");
    88125       
     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;
    89132        }
    90         system("if EXISTS greenstone3.tmp\\@java.installer@ del greenstone3.tmp\\@java.installer@");
    91        
    92133    }
    93134   
    94135    //change back to the original directory and clean up the temp directory
    95136    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@");
    100142   
     143    command = "rmdir ";
     144    command.append( tempdir );
     145    system( command.c_str() );
     146    cout << "Press any key to exit..." << endl;
     147    getch();
    101148   
    102149}
  • release-kits/wirk3/wrapper/wrapper.rc

    r15023 r15095  
    11GREENSTONE_JAR JAR "greenstone3.jar"
    2 LAUNCHER EXE "launch-installer.exe"
     2SEARCH4J EXE "search4j.exe"
    33MAINICON ICON "gs3.ico"
    44
Note: See TracChangeset for help on using the changeset viewer.