Index: main/trunk/release-kits/shared/core/ant-scripts/create-installer.xml
===================================================================
--- main/trunk/release-kits/shared/core/ant-scripts/create-installer.xml	(revision 21623)
+++ main/trunk/release-kits/shared/core/ant-scripts/create-installer.xml	(revision 21630)
@@ -2,5 +2,5 @@
 <project name="create-installer">
 
-	<target name="create-installer">
+	<target name="create-installer" depends="init,gs${version.major}-init">
 
 		<!-- create installer directory -->
Index: main/trunk/release-kits/shared/core/ant-scripts/init.xml
===================================================================
--- main/trunk/release-kits/shared/core/ant-scripts/init.xml	(revision 21623)
+++ main/trunk/release-kits/shared/core/ant-scripts/init.xml	(revision 21630)
@@ -190,4 +190,15 @@
 	</target>
 
+	<!-- show the core properties of all release-kits -->
+	<target name="core-properties">
+		<echo>Required Properties:</echo>
+		<echo>version             the version string for the release</echo>
+		<echo/>
+		<echo>Optional Properties:</echo>
+		<echo>branch.path         the branch of Greenstone to make a release of. Eg: tags/2.81. Default: trunk.</echo>
+		<echo>branch.revision     the revision of Greenstone to make a release of. Eg: 18273. Default: HEAD.</echo>
+		<echo/>
+	</target>
+
 	<!-- a target to strip any directory of .svn folders -->
 	<target name="strip-svn-dirs">
@@ -224,4 +235,7 @@
 			manifest="${rk.home}/shared/core/uninstaller/manifest.mf"
 			basedir="compiled/uninstaller/build" />
+
+		<!-- clean up build directory -->
+		<delete dir="compiled/uninstaller"/>
 
 		<!-- put the associated script in place -->
Index: main/trunk/release-kits/shared/core/ant-scripts/wrap.xml
===================================================================
--- main/trunk/release-kits/shared/core/ant-scripts/wrap.xml	(revision 21630)
+++ main/trunk/release-kits/shared/core/ant-scripts/wrap.xml	(revision 21630)
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<project name="wrap" default="wrap">
+
+	<target name="wrap" depends="init,gs${version.major}-init">
+
+		<!-- create products directory -->
+		<mkdir dir="products"/>
+
+		<!-- (windows) -->
+		<if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
+
+			<!--create a directory to build the wrapped installer in -->
+			<mkdir dir="wrapped-installer"/>
+
+			<!-- copy wrapper source into place -->
+			<copy todir="wrapped-installer" overwrite="true">
+				<fileset dir="${rk.home}/shared/windows/wrapper"/>
+				<fileset file="${rk.home}/shared/core/icon/icon.ico"/>
+				<fileset dir="${rk.home}/shared/core/search4j" includes="libsearch4j.cpp,libsearch4j.h"/>
+			</copy>
+
+			<!-- substitute in concrete values -->
+			<rsr file="wrapped-installer/wrapper.cpp">
+				<job pattern="@java.installer@" replacement="${windows-java.installer}"/>
+				<job pattern="@java.min.version@" replacement="${java.min.version}"/>
+				<job pattern="@bundled.version.java@" replacement="${bundled.version.windows-java}"/>
+				<job pattern="@java.extracted@" replacement="${java.extracted}"/>
+			</rsr>
+
+			<!-- get the template resource script -->
+			<copy todir="wrapped-installer" file="${rk.home}/shared/windows/wrapper/wrapper.rc" overwrite="true"/>
+
+			<!-- split the resources into chunks, creating a resource script of the chunks -->
+			<rsplit
+				resource="${rk.home}/shared/windows/wrapper/${windows-java.installer}"
+				outputDir="wrapped-installer"					
+				resourceScript="wrapped-installer/wrapper.rc"
+				resourceName="JAVA"
+				resourceType="EXE"
+				chunkSize="${resources.chunksize}"/>
+			<rsplit
+				resource="installer/Greenstone-${version}-${os.suffix}.jar"
+				outputDir="wrapped-installer"
+				resourceScript="wrapped-installer/wrapper.rc"
+				resourceName="JAR"
+				resourceType="JAR"
+				chunkSize="${resources.chunksize}"
+				/>
+
+			<!-- compile the resources -->
+			<exec executable="rc" dir="wrapped-installer">
+				<arg line="wrapper.rc"/>
+			</exec>
+
+			<!-- compile the wrapper -->
+			<exec executable="cl" dir="wrapped-installer">
+				<arg line="/c -GX /DWINDOWS=yes libsearch4j.cpp /out:libsearch4j.obj"/>
+			</exec>
+			<exec executable="cl" dir="wrapped-installer">
+				<arg line="/c -GX /DWINDOWS=yes wrapper.cpp /out:wrapper.obj"/>
+			</exec>
+
+			<!-- link wrapper -->
+			<exec executable="link" dir="wrapped-installer">
+				<arg line="/OUT:..\products\Greenstone-${version}-${os.suffix}.exe gdi32.lib advapi32.lib shell32.lib user32.lib libsearch4j.obj wrapper.obj wrapper.res"/>
+			</exec>
+
+		<!-- (linux) -->
+		<else><if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
+			<!-- create the build directory -->
+			<mkdir dir="wrapped-installer/build"/>
+
+			<!-- copy the source into place --> 
+			<copy todir="wrapped-installer/build" overwrite="true">
+				<fileset file="${rk.home}/shared/linux/wrapper.cpp"/>
+				<fileset dir="${rk.home}/shared/core/search4j" includes="libsearch4j.cpp,libsearch4j.h"/>
+			</copy>
+
+			<!-- copy bundled files into place -->
+			<copy todir="wrapped-installer/build" file="${rk.home}/shared/linux/${linux-java.installer}"/>
+			<copy tofile="wrapped-installer/build/greenstone.jar" file="installer/Greenstone-${version}-${os.suffix}.jar"/>
+
+			<!-- substitute in real values -->
+			<rsr file="wrapped-installer/wrapper.cpp">
+				<job pattern="@java.installer@" replacement="${linux-java.installer}"/>
+				<job pattern="@java.extracted@" replacement="${java.extracted}"/>
+				<job pattern="@java.min.version@" replacement="${java.min.version}"/>
+			</rsr>
+
+			<!-- create an object file (extension .o) for each file to bundle -->
+			<exec executable="/usr/bin/objcopy" dir="wrapped-installer">
+				<arg line="-I binary -O elf32-i386 -B i386 --redefine-sym _binary_greenstone_jar_start=greenstonejar --readonly-text greenstone.jar greenstone.jar.o"/>
+			</exec>
+			<exec executable="/usr/bin/objcopy" dir="wrapped-installer">
+				<arg line="-I binary -O elf32-i386 -B i386 --redefine-sym _binary_${linux-java.installer}_start=java --readonly-text ${linux-java.installer} java.o"/>
+			</exec>
+
+			<!-- compile libsearch4j -->
+			<exec executable="g++" dir="wrapped-installer">
+				<arg line="-Wall -static -static-libgcc -c -o libsearch4j.o libsearch4j.cpp"/>
+			</exec>
+
+			<!-- figure out jar size (web jar) -->
+			<exec executable="ls" dir="wrapped-installer" outputproperty="greenstone.jar.ls"><arg line="-l greenstone.jar"/></exec>
+			<exec executable="sed" inputstring="${greenstone.jar.ls}" outputproperty="greenstone.jar.size"><arg line="-e 's/^[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *\([0-9]*\).*$/\1/g'"/></exec>
+
+			<!-- figure out java size -->
+			<exec executable="ls" dir="wrapped-installer" outputproperty="java.ls"><arg line="-l ${linux-java.installer}"/></exec>
+			<exec executable="sed" inputstring="${java.ls}" outputproperty="java.size"><arg line="-e 's/^[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *[^\ ]*\ *\([0-9]*\).*$/\1/g'"/></exec>
+
+			<!-- creating wrapper header file -->
+			<delete file="wrapper.h"/>
+			<exec executable="echo" output="wrapped-installer/wrapper.h"><arg line="extern const char greenstonejar[${greenstone.jar.size}];"/></exec>
+			<exec executable="echo" output="wrapped-installer/wrapper.h" append="true"><arg line="extern const char java[${java.size}];"/></exec>
+			<exec executable="echo" output="wrapped-installer/wrapper.h" append="true"><arg line="#define java_is_bundled yes"/></exec>
+
+			<!-- compile the wrapper program -->
+			<exec executable="g++" dir="wrapped-installer">
+				<arg line="-Wall -static -static-libgcc -c -o wrapper.o wrapper.cpp"/>
+			</exec>
+
+			<!-- link the compiled code and bundled files -->
+			<exec executable="g++" dir="wrapped-installer">
+				<arg line="-static -static-libgcc -o ../products/Greenstone-${version}-linux wrapper.o libsearch4j.o greenstone.jar.o java.o"/>
+			</exec>
+
+		<!-- (mac) -->
+		<else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
+
+			<!-- create and setup the build directory -->
+			<delete dir="wrapped-installer"/>
+			<mkdir dir="wrapped-installer"/>
+
+			<!-- create app for main installer -->
+			<copy todir="wrapped-installer/Greenstone${version}.app"><fileset dir="${rk.home}/shared/mac/Wrapper.app"/></copy>
+			<copy todir="wrapped-installer/Greenstone${version}.app/Contents/Resources" file="${rk.home}/shared/core/icon/icon.icns"/>
+			<chmod file="wrapped-installer/Greenstone${version}.app/Contents/MacOS/JavaApplicationStub" perm="ug+x"/>
+
+			<!-- copy bundled files -->
+			<copy todir="wrapped-installer/Greenstone${version}.app/Contents/Resources/Java" file="installer/Greenstone-${version}-${os.suffix}.jar"/>
+
+			<!-- substitute in real values -->
+			<rsr file="wrapped-installer/Greenstone${version}.app/Contents/Info.plist">
+				<job pattern="@jar@" replacement="Greenstone-${version}-${os.suffix}.jar"/>
+				<job pattern="@version@" replacement="${version}"/>
+			</rsr>
+
+			<!-- turn app into a dmg -->
+
+			<!-- get size of app -->
+			<exec executable="du" dir="wrapped-installer" outputproperty="app.du"><arg line="-ks Greenstone${version}.app"/></exec>
+			<exec executable="sed" inputstring="${app.du}" outputproperty="app.size"><arg line="-e 's/^\([0-9]*\).*$/\1/g'"/></exec>
+			<math result="dmg.size" operand1="${app.size}" operation="+" operand2="${dmg.overhead}" datatype="int"/>
+
+			<!-- create disk image -->
+			<property name="dmg.name" value="Greenstone-${version}-${os.suffix}"/>
+			<exec dir="products" executable="hdiutil"><arg line="create -ov -size ${dmg.size}k -fs HFS+ -volname ${dmg.name} ${dmg.name}.dmg"/></exec>
+			<!-- mount it -->
+			<exec executable="hdiutil" dir="products"><arg line="attach ${dmg.name}.dmg"/></exec>
+			<!-- copy file into it -->
+			<exec executable="cp"><arg line="-r wrapped-installer/Greenstone${version}.app /Volumes/${dmg.name}"/></exec>
+			<!-- unmount it-->
+			<exec executable="hdiutil"><arg line="detach /Volumes/${dmg.name}"/></exec>
+		</if></else></if></else></if>
+
+
+	</target>
+
+</project>
+
Index: main/trunk/release-kits/shared/greenstone2/ant-scripts/rk2-targets.xml
===================================================================
--- main/trunk/release-kits/shared/greenstone2/ant-scripts/rk2-targets.xml	(revision 21623)
+++ main/trunk/release-kits/shared/greenstone2/ant-scripts/rk2-targets.xml	(revision 21630)
@@ -7,8 +7,5 @@
 		..........................................................
 -->
-
-<project name="rk2-targets">
-
-	<property name="version.major" value="2"/>
+<project name="greenstone2-targets">
 
 	<target name="gs2-init">
Index: main/trunk/release-kits/shared/greenstone3/ant-scripts/rk3-targets.xml
===================================================================
--- main/trunk/release-kits/shared/greenstone3/ant-scripts/rk3-targets.xml	(revision 21623)
+++ main/trunk/release-kits/shared/greenstone3/ant-scripts/rk3-targets.xml	(revision 21630)
@@ -8,28 +8,5 @@
 -->
 
-<project name="rk3-targets">
-
-	<property name="version.major" value="3"/>
-
-	<!-- create the property set to be forwarded to greenstone3 -->
-	<propertyset id="forward.properties">
-		<propertyref prefix="forward."/>
-		<mapper type="glob" from="forward.*" to="*"/>
-		<propertyref name="app.version"/>
-		<propertyref name="branch.path"/>
-		<propertyref name="branch.revision"/>
-	</propertyset>
-
-	<target name="greenstone3-set-version-numbers">
-		<rsr
-			file="${greenstone3basedir}/resources/java/global.properties.in"
-			pattern="@gsdl3version@"
-			replacement="${version}" />
-		<rsr
-			file="${greenstone3basedir}/resources/java/server.properties"
-			pattern="^(Server3Control\.Version=).*$"
-			replacement="$1${version}" />
-
-	</target>
+<project name="greenstone3-targets">
 
 	<target name="gs3-init">
@@ -50,6 +27,14 @@
 	</target>
 
-	<target name="insert-uninstaller-jar">
-		<copy file="compiled/uninst.jar" tofile="distributions/web/uninst.jar"/>
+	<target name="greenstone3-set-version-numbers">
+		<rsr
+			file="${greenstone3basedir}/resources/java/global.properties.in"
+			pattern="@gsdl3version@"
+			replacement="${version}" />
+		<rsr
+			file="${greenstone3basedir}/resources/java/server.properties"
+			pattern="^(Server3Control\.Version=).*$"
+			replacement="$1${version}" />
+
 	</target>
 
@@ -72,5 +57,5 @@
 		<else><if><bool><or><equals arg1="${rk.os}" arg2="linux"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
 			<exec executable="cp">
-				<arg	value="-r"/>
+				<arg value="-r"/>
 				<arg value="${rk.home}/core/ant"/>
 				<arg value="compiled/packages"/>
@@ -95,69 +80,8 @@
 	</target>
 
-	<target name="checkout-greenstone3">
-		<svn>
-			<checkout url="${svn.root}/main/${branch.path}/greenstone3" destPath="compiled" revision="${branch.revision}"/>
-		</svn>
-	</target>
-
 	<target name="export-greenstone3">
 		<svn>
 			<export srcUrl="${svn.root}/main/${branch.path}/greenstone3" destPath="${dest}" revision="${branch.revision}"/>
 		</svn>
-	</target>
-
-	<target name="insert-xml-parser">
-		<copy todir="compiled/gs2build/perllib/cpan">
-			<fileset dir="${rk.home}/greenstone3" includes="XML-Parser/**/*"/>
-		</copy>
-	</target>
-
-	<target name="insert-documented-examples">
-		<echo>NOT IMPLEMENTED: Remember to put code in this target to grab and install the documented examples.</echo>
-		<!-- copy the doc eg colls from /home/nzdl - note we don't include the formatting ones -->
-	</target>
-
-	<target name="prepare-documentation">
-
-		<mkdir dir="compiled/gsdl-manuals"/>
-		<svn>
-			<checkout url="${svn.root}/documentation/${branch.path}/manuals" destPath="compiled/gsdl-manuals/manuals"/>
-			<checkout url="${svn.root}/documentation/${branch.path}/shared" destPath="compiled/gsdl-manuals/shared"/>
-		</svn>
-		<path id="documentation.compile.classpath">
-			<fileset dir="compiled/gsdl-manuals">
-				<include name="**/*.jar"/>
-			</fileset>
-			<pathelement path="compiled/gsdl-manuals/shared"/>
-			<pathelement path="compiled/gsdl-manuals/manuals"/>
-		</path>
-		<javac srcdir="compiled/gsdl-manuals/shared"
-			destdir="compiled/gsdl-manuals/shared"
-			debug="on"
-			classpathref="documentation.compile.classpath">
-			<include name="*.java"/>
-		</javac>
-		<unzip src="compiled/gsdl-manuals/shared/fop.zip" dest="compiled/gsdl-manuals/shared"/>
-
-		<java classname="ApplyXSLT" classpathref="documentation.compile.classpath" output="compiled/gsdl-manuals/manuals/xml-source/en/help-en.xml">
-			<arg value="compiled/gsdl-manuals/manuals/processing/gen-gli-help-to-manual-chapter.xsl" />
-			<arg value="compiled/gli/help/en/help.xml" />
-			<arg value="compiled" />
-		</java>
-
-		<chmod perm="a+x" file="compiled/gsdl-manuals/shared/fop/fop.sh"/>
-		<echo>Run generate-pdf script</echo>
-		<if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
-			<exec dir="compiled/gsdl-manuals/manuals" executable="cmd">
-				<arg value="/C" />
-				<arg file="${basedir}/compiled/gsdl-manuals/manuals/generate-pdf.bat" />
-				<arg value="u" />
-				<arg value="en" />
-			</exec>
-		<else>
-			<exec dir="compiled/gsdl-manuals/manuals" executable="/bin/bash">
-				<arg line="generate-pdf.sh u en" />
-			</exec>
-		</else></if>
 	</target>
 
@@ -195,7 +119,4 @@
 	</target>
 
-	<target name="clean-uninstaller">
-		<delete dir="distributions/web/uninstaller"/>
-	</target>
 
 	<target name="insert-windows-icon">
Index: main/trunk/release-kits/shared/linux/wrapper.cpp
===================================================================
--- main/trunk/release-kits/shared/linux/wrapper.cpp	(revision 21623)
+++ main/trunk/release-kits/shared/linux/wrapper.cpp	(revision 21630)
@@ -96,5 +96,5 @@
 	#ifndef CDROM
 
-	string jarfile = tempdir + "/@installer.name@.jar"; //where we will store the jar file
+	string jarfile = tempdir + "/greenstone.jar"; //where we will store the jar file
 	string javafile = tempdir + "/@java.installer@"; //where we will store the java tar file
 
@@ -102,5 +102,5 @@
 	//extract files
 	cout << "Extracting installer jar..." << endl;
-	succeeded = extract_bundled_file( @installer.name@jar, sizeof(@installer.name@jar), (char*)jarfile.c_str(), false);
+	succeeded = extract_bundled_file( greenstonejar, sizeof(greenstonejar), (char*)jarfile.c_str(), false);
 
 	#ifdef java_is_bundled
@@ -166,5 +166,5 @@
 		cout << "Launching Installer ..." << endl;
 		int launch_exit_code = 0;
-		launch_exit_code = system( (foundJvm.getExecutable() + " -Xmx85M -jar @installer.name@.jar" + (text_mode?" text":"") ).c_str() );
+		launch_exit_code = system( (foundJvm.getExecutable() + " -Xmx85M -jar greenstone.jar" + (text_mode?" text":"") ).c_str() );
 
 		//report how it went
