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

Last change on this file since 28822 was 28822, checked in by ak19, 10 years ago

Fixing up the Windows shortcuts for Expeditee (ak19)

File size: 8.0 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 <!-- <chmod dir="${installDir}/bin" includes="*" perm="775"/>
98 <chmod dir="${installDir}/cgi-bin/${shell.name}" includes="*" perm="775"/>
99 <chmod dir="${installDir}/bin/script" includes="**/*" perm="775"/>
100 <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/> -->
101 <!-- if linux|mac -->
102 <!-- <chmod dir="${installDir}/bin/${shell.name}" includes="**/*" perm="775"/> -->
103 <!-- /if -->
104
105 <!-- if linux|mac -->
106 <!--
107 <echo>Set the installation locale in config files</echo>
108 <rsr file="${installDir}/setup.bash" pattern="^gsdllang=.*" replacement="gsdllang=${language}"/>
109 <rsr file="${installDir}/gli/gli.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
110 <rsr file="${installDir}/gli/gems.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
111 -->
112 <!-- /if -->
113 <!--
114 <rsr
115 file="${installDir}/gli/classes/xml/config.xml"
116 pattern="(&lt;Argument name=&quot;general.locale&quot;&gt;).*(&lt;/Argument&gt;)"
117 replacement="$1${language}$2"/>
118
119 <echo file="${installDir}/etc/main.cfg" append="true"
120 >cgiarg shortname=l argdefault=${language}</echo>
121
122 <echo message="Creating installation properties file"/>
123 -->
124 <!-- if linux|mac -->
125 <!-- <echo file="${installDir}/etc/installation.properties">#this file is just a placeholder for now</echo> -->
126 <!-- /if -->
127 <!-- if windows -->
128 <!-- <echo file="${installDir}\etc\installation.properties">installed.startmenu.path:${startmenu.path.unix}</echo> -->
129 <!-- /if -->
130
131 <!-- if mac -->
132 <!--
133 <copy file="${installDir}/gli.app/Contents/document.wflow.in" tofile="${installDir}/gli.app/Contents/document.wflow"/>
134 <rsr file="${installDir}/gli.app/Contents/document.wflow" pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
135
136 <copy file="${installDir}/gs2-server.app/Contents/document.wflow.in" tofile="${installDir}/gs2-server.app/Contents/document.wflow"/>
137 <rsr file="${installDir}/gs2-server.app/Contents/document.wflow" pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
138
139 <copy file="${installDir}/gems.app/Contents/document.wflow.in" tofile="${installDir}/gems.app/Contents/document.wflow"/>
140 <rsr file="${installDir}/gems.app/Contents/document.wflow" pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
141
142 <copy file="${installDir}/client-gli.app/Contents/document.wflow.in" tofile="${installDir}/client-gli.app/Contents/document.wflow"/>
143 <rsr file="${installDir}/client-gli.app/Contents/document.wflow" pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
144
145 <chmod dir="${installDir}" includes="*.app" perm="755"/>
146 <chmod dir="${installDir}" includes="*.app/**/*" perm="755"/>
147 -->
148 <!-- /if -->
149 </target>
150
151 <!-- <target name="Initialising" if="bundled.java.exists"> -->
152 <!-- Java Runtime -->
153 <target name="Installing Java Runtime">
154 <echo>Installing the Java Runtime</echo>
155 <mkdir dir="${installDir}/packages"/>
156 <copy todir="${installDir}/packages/jre" failonerror="false">
157 <fileset dir="../@java.extracted@"/>
158 </copy>
159 <chmod dir="${installDir}/packages/jre/bin" includes="*" perm="775"/>
160 </target>
161
162 <!-- Start menu shortcuts -->
163 <target name="Installing Start Menu Shortcuts">
164
165 <!-- Expeditee shortcut -->
166 <property name="expediteeicon" value="${installDir}\bin\icon.ico"/>
167
168 <shortcut
169 file="${startmenu.path}\Expeditee.lnk"
170 execute="${installDir}\run.bat"
171 workingDirectory="${installDir}"
172 iconFile="${expediteeicon}"
173 iconIndex="0" />
174
175 </target>
176
177 <target name="Configuring Administration Pages" if="enable.admin.pages">
178 <echo>Enabling Admin Pages</echo>
179 <rsr file="${installDir}/etc/main.cfg" pattern="^\s*status\s+.*" replacement="status enabled"/>
180 <echo>Creating admin and demo users</echo>
181 <adduser txt2db="${installDir}/bin/${shell.name}/txt2db"
182 usersDb="${installDir}/etc/users.gdb"
183 username="admin"
184 password="${admin.password}"
185 groups="administrator,colbuilder,all-collections-editor"
186 comment="created at install time"/>
187 <adduser
188 txt2db="${installDir}/bin/${shell.name}/txt2db"
189 usersDb="${installDir}/etc/users.gdb"
190 username="demo"
191 password="demo"
192 groups="demo"
193 comment="Dummy 'demo' user with password 'demo' for authen-e collection"/>
194 </target>
195
196 <target name="Installing Documented Examples">
197 <unzip src="${orig.dir}/documented-examples.zip" dest="${installDir}/collect"/>
198 </target>
199
200</project>
Note: See TracBrowser for help on using the repository browser.