source: release-kits/wirk2/installer/build.xml@ 17125

Last change on this file since 17125 was 17125, checked in by oranfry, 16 years ago

simplified the installation.properties system in wirk3

File size: 6.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 <!-- classpath -->
9 <path id="project.classpath"><pathelement path="${antinstaller.jar}"/></path>
10
11 <!-- custom tasks -->
12 <taskdef name="shortcut" classname="com.orangevolt.tools.ant.Win32ShortcutTask" classpathref="project.classpath"/>
13 <taskdef name="winprops" classname="com.orangevolt.tools.ant.Win32PropertiesTask" classpathref="project.classpath"/>
14 <typedef name="rsr" classname="org.greenstone.anttasks.RegexSearchReplace" classpathref="project.classpath"/>
15 <typedef name="getfreepath" classname="org.greenstone.anttasks.GetFreePath" classpathref="project.classpath"/>
16 <typedef name="adduser" classname="org.greenstone.anttasks.AddGreenstoneUserToDatabase" classpathref="project.classpath"/>
17
18 <!-- pick up the properties generated during the install pages -->
19 <property file="${basedir}/ant.install.properties"/>
20
21 <!-- determine if there is an existing installation in the installDir-->
22 <available file="${installDir}\etc\installation.properties" property="is.overinstall"/>
23
24 <!-- load windows properties -->
25 <winprops/>
26
27 <!-- create a local installDir String -->
28 <path id="installDir.path"><pathelement location="${installDir}"/></path>
29 <property name="installDir.local" refid="installDir.path"/>
30
31 <target name="load-previous-props" if="is.overinstall">
32 <property file="${installDir}\etc\installation.properties"/>
33 </target>
34
35 <target name="install-core-components" depends="load-previous-props">
36
37 <!-- figure out the start menu path (if not already set from previous installation) -->
38 <getfreepath path="${win32.personal.programs_menu}\Greenstone-@version@" property="startmenu.path"/>
39
40 <echo>basedir: ${basedir}</echo>
41 <echo>installDir: ${installDir}</echo>
42 <echo>antinstaller.jar: ${antinstaller.jar}</echo>
43 <echo>startmenu.path: ${startmenu.path}</echo>
44
45 <!-- create the installation directory -->
46 <echo message="Creating Installation directory"/>
47 <mkdir dir="${installDir}"/>
48
49 <!-- install files -->
50 <echo message="Installing Files"/>
51 <unzip src="${antinstaller.jar}" dest="${installDir}">
52 <patternset>
53
54 <include name="gli/**/*"/>
55 <include name="bin/**/*"/>
56 <include name="cgi-bin/**/*"/>
57 <include name="etc/**/*"/>
58 <include name="mappings/**/*"/>
59 <include name="images/**/*"/>
60 <include name="perllib/**/*"/>
61 <include name="indexers/**/*"/>
62 <include name="macros/**/*"/>
63 <include name="collect/**/*"/>
64
65 <include name="LICENSE.txt"/>
66 <include name="READMEar.txt"/>
67 <include name="READMEes.txt"/>
68 <include name="READMEen.txt"/>
69 <include name="READMEfr.txt"/>
70 <include name="READMEru.txt"/>
71 <include name="setup.bat"/>
72 <include name="server.exe"/>
73 <include name="gsdlsite.cfg"/>
74
75 </patternset>
76 </unzip>
77 <echo/>
78
79 <echo message="Creating admin and demo users"/>
80 <adduser txt2db="${installDir}/bin/windows/txt2db"
81 usersDb="${installDir}/etc/users.db"
82 username="admin"
83 password="${admin.password}"
84 groups="administrator,colbuilder"
85 comment="created at install time"/>
86 <adduser
87 txt2db="${installDir}/bin/windows/txt2db"
88 usersDb="${installDir}/etc/users.db"
89 username="demo"
90 password="demo"
91 groups="demo"
92 comment="Dummy 'demo' user with password 'demo' for authen-e collection"/>
93
94 <!-- delete unneeded files -->
95 <echo message="Deleting some unneeded files"/>
96 <delete dir="${installDir}/resources/icons"/>
97 <delete file="${installDir}/resources/*.png"/>
98
99 <echo message="Filling in concrete values in config files"/>
100 <rsr
101 file="${installDir}/setup.bat"
102 pattern="\*\*GSDLHOME\*\*"
103 replacement="${installDir}"/>
104 <rsr
105 file="${installDir}/cgi-bin/gsdlsite.cfg"
106 pattern="\*\*GSDLHOME\*\*"
107 replacement="${installDir}"/>
108
109 <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="^(#?httpprefix).*" replacement="$1 /gsdl"/>
110 <rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="^(#?httpimg).*" replacement="$1 /gsdl/images"/>
111
112 <rsr file="${installDir}/gsdlsite.cfg" pattern="@gsdlhome@" replacement="${installDir}"/>
113
114 <echo message="Creating installation properties file"/>
115 <echo file="${installDir}\etc\installation.properties">startmenu.path:${startmenu.path}</echo>
116
117 <echo message="Finished"/>
118
119 </target>
120
121 <!-- Source -->
122 <target name="install-source-code" depends="">
123
124 <echo message="Installing Source Code"/>
125 <unzip src="${antinstaller.jar}" dest="${installDir}">
126 <patternset>
127 <include name="common-src/**/*"/>
128 <include name="runtime-src/**/*"/>
129 <include name="build-src/**/*"/>
130 <include name="packages/**/*"/>
131 </patternset>
132 </unzip>
133
134 </target>
135
136 <!-- Start menu shortcuts -->
137 <target name="install-start-menu-shortcuts">
138
139 <mkdir dir="${startmenu.path}\Documentation"/>
140
141 <shortcut
142 file="${startmenu.path}\Greenstone2 Server.lnk"
143 execute="${installDir}\server.exe"
144 workingDirectory="${installDir}"
145 iconFile="${installDir}\images\icon.ico"
146 iconIndex="0" />
147 <shortcut
148 file="${startmenu.path}\Greenstone Librarian Interface (GLI).lnk"
149 execute="${installDir}\gli\gli.bat"
150 workingDirectory="${installDir}\gli"
151 iconFile="${installDir}\images\icon.ico"
152 iconIndex="0" />
153 <shortcut
154 file="${startmenu.path}\Greenstone Editor for Metadata Sets (GEMS).lnk"
155 execute="${installDir}\gli\gems4gs3.bat"
156 workingDirectory="${installDir}\gli"
157 iconFile="${installDir}\images\icon.ico"
158 iconIndex="0" />
159 <shortcut
160 file="${startmenu.path}\Documentation\READMEen.lnk"
161 execute="${installDir}\READMEen.txt" />
162 <shortcut
163 file="${startmenu.path}\Documentation\READMEes.lnk"
164 execute="${installDir}\READMEes.txt" />
165 <shortcut
166 file="${startmenu.path}\Documentation\READMEar.lnk"
167 execute="${installDir}\READMEar.txt" />
168 <shortcut
169 file="${startmenu.path}\Documentation\READMEfr.lnk"
170 execute="${installDir}\READMEfr.txt" />
171 <shortcut
172 file="${startmenu.path}\Documentation\READMEru.lnk"
173 execute="${installDir}\READMEru.txt" />
174 </target>
175
176 <target name="cleanuptarget"></target>
177
178
179</project>
Note: See TracBrowser for help on using the repository browser.