source: other-projects/expeditee-release-kits/kits/rke/installer/build.xml@ 28832

Last change on this file since 28832 was 28832, checked in by ak19, 8 years ago

Moving Windows shortcut icon from the bin folder to a new resources folder in the install location

File size: 5.4 KB
Line 
1<?xml version="1.0"?>
2<!--
3This is the build.xml run by AntInstaller for the installer
4-->
5
6<project name="Installation">
7
8 <!-- this is required to pick up the properties generated during the install pages -->
9 <property file="${basedir}/ant.install.properties"/>
10
11 <!-- set some properties to keep track of the OS -->
12 <!-- if windows -->
13 <property name="rk.os" value="windows"/>
14 <property name="shell.name" value="windows"/>
15 <!-- /if -->
16 <!-- if linux -->
17 <property name="rk.os" value="linux"/>
18 <property name="shell.name" value="linux"/>
19 <!-- /if -->
20 <!-- if mac -->
21 <property name="rk.os" value="mac"/>
22 <property name="shell.name" value="darwin"/>
23 <!-- /if -->
24
25 <!-- classpath -->
26 <path id="project.classpath">
27 <pathelement path="${antinstaller.jar}"/>
28 </path>
29
30 <!-- custom tasks -->
31 <taskdef name="if" classname="ise.antelope.tasks.IfTask" classpathref="project.classpath"/>
32 <typedef name="rsr" classname="org.greenstone.anttasks.RegexSearchReplace" classpathref="project.classpath"/>
33 <typedef name="adduser" classname="org.greenstone.anttasks.AddGreenstoneUserToDatabase" classpathref="project.classpath"/>
34 <!-- if windows -->
35 <taskdef name="shortcut" classname="com.orangevolt.tools.ant.Win32ShortcutTask" classpathref="project.classpath"/>
36 <taskdef name="winprops" classname="com.orangevolt.tools.ant.Win32PropertiesTask" classpathref="project.classpath"/>
37 <typedef name="getfreepath" classname="org.greenstone.anttasks.GetFreePath" classpathref="project.classpath"/>
38 <!-- /if -->
39 <!-- if linux|mac -->
40 <taskdef name="sevenzip" classname="org.apache.tools.ant.SevenZip" classpathref="project.classpath"/>
41 <!-- /if -->
42
43 <!-- determine if a bundled java exists -->
44 <condition property="bundled.java.exists">
45 <or>
46 <available file="../@java.extracted@/bin/java"/>
47 <available file="../@java.extracted@/bin/java.exe"/>
48 </or>
49 </condition>
50
51 <!-- determine if there is an existing installation in the installDir-->
52 <available file="${installDir}\etc\installation.properties" property="is.overinstall"/>
53
54 <!-- create a local installDir String -->
55 <path id="installDir.path"><pathelement location="${installDir}"/></path>
56 <property name="installDir.local" refid="installDir.path"/>
57
58 <!-- if windows -->
59 <!-- load windows properties -->
60 <winprops/>
61 <!-- /if -->
62
63 <!-- load the properties of the previous installation if this is an overinstall -->
64 <target name="Looking For Previous Installation" if="is.overinstall">
65 <property file="${installDir}\etc\installation.properties"/>
66 <delete dir="${installed.startmenu.path}" failonerror="false"/>
67 </target>
68
69
70 <!-- core system -->
71 <target name="Installing Core System">
72
73 <!-- if windows -->
74 <!-- figure out the start menu path -->
75 <getfreepath path="${win32.personal.programs_menu}\@projectname@" property="startmenu.path"/>
76 <path id="startmenu.path.path" path="${startmenu.path}"/>
77 <pathconvert targetos="unix" property="startmenu.path.unix" refid="startmenu.path.path"/>
78
79 <!-- extract 7za tool -->
80 <unzip src="${antinstaller.jar}" dest="${basedir}">
81 <patternset><include name="7za.exe"/></patternset>
82 </unzip>
83 <!-- /if -->
84
85 <!-- start web -->
86 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="core.lzma"/></patternset></unzip>
87 <!-- if linux|mac --><sevenzip task="decode" input="${basedir}/core.lzma" output="${basedir}/core.comp"/><!-- /if -->
88 <!-- if windows --><exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x core.lzma"/></exec><!-- /if -->
89 <delete file="core.lzma"/>
90 <unzip src="${basedir}/core.comp" dest="${installDir}"/>
91 <delete file="core.comp"/>
92 <!-- end web -->
93
94 <echo>Setting Binaries to Executable</echo>
95 <chmod dir="${installDir}" includes="*.sh,*.bash" perm="775"/>
96 <chmod dir="${installDir}/bin" includes="*" perm="755"/>
97
98 </target>
99
100 <!-- <target name="Initialising" if="bundled.java.exists"> -->
101 <!-- Java Runtime -->
102 <target name="Installing Java Runtime">
103 <echo>Installing the Java Runtime</echo>
104 <mkdir dir="${installDir}/packages"/>
105 <copy todir="${installDir}/packages/jre" failonerror="false">
106 <fileset dir="../@java.extracted@"/>
107 </copy>
108 <chmod dir="${installDir}/packages/jre/bin" includes="*" perm="775"/>
109 </target>
110
111 <!-- Start menu shortcuts -->
112 <target name="Installing Start Menu Shortcuts">
113
114 <!-- Expeditee shortcut -->
115 <property name="expediteeicon" value="${installDir}\resources\icon.ico"/>
116
117 <shortcut
118 file="${startmenu.path}\Expeditee.lnk"
119 execute="${installDir}\run.bat"
120 workingDirectory="${installDir}"
121 iconFile="${expediteeicon}"
122 iconIndex="0" />
123
124 </target>
125
126 <target name="Configuring Administration Pages" if="enable.admin.pages">
127 <echo>Enabling Admin Pages</echo>
128 <rsr file="${installDir}/etc/main.cfg" pattern="^\s*status\s+.*" replacement="status enabled"/>
129 <echo>Creating admin and demo users</echo>
130 <adduser txt2db="${installDir}/bin/${shell.name}/txt2db"
131 usersDb="${installDir}/etc/users.gdb"
132 username="admin"
133 password="${admin.password}"
134 groups="administrator,colbuilder,all-collections-editor"
135 comment="created at install time"/>
136 <adduser
137 txt2db="${installDir}/bin/${shell.name}/txt2db"
138 usersDb="${installDir}/etc/users.gdb"
139 username="demo"
140 password="demo"
141 groups="demo"
142 comment="Dummy 'demo' user with password 'demo' for authen-e collection"/>
143 </target>
144
145 <target name="Installing Documented Examples">
146 <unzip src="${orig.dir}/documented-examples.zip" dest="${installDir}/collect"/>
147 </target>
148
149</project>
Note: See TracBrowser for help on using the repository browser.