This repository has been archived by the owner on Oct 29, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
installer.xml
221 lines (205 loc) · 12 KB
/
installer.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!-- README: Building GeoGebra Installer for Windows and Mac OS X
This script assumes that the several kinds of GeoGebra *.jar files
already exist in the build/ folder. Please read the details in
build.xml.
To learn more on building GeoGebra installers by using this script, please
read the following web pages:
http://www.geogebra.org/trac/wiki/NSISonUnix
-->
<!--
GeoGebra installer build script
@author Markus Hohenwarter <[email protected]>
@author Yves Kreis <[email protected]>
@author Zoltan Kovacs <[email protected]>
-->
<project default="installer">
<import file="common.xml"/>
<target name="installer" depends="installer-clean, installer-windows, installer-macosx"/>
<target name="installer-clean">
<delete dir="${build.dir}/installer" followsymlinks="false" removeNotFollowedSymlinks="true"/>
<mkdir dir="${build.dir}/installer"/>
<mkdir dir="${build.dir}/installer/windows"/>
<mkdir dir="${build.dir}/installer/windows/unsigned"/>
<mkdir dir="${build.dir}/installer/windows/temp"/>
<mkdir dir="${build.dir}/installer/macosx"/>
</target>
<!-- defines the launch4j and nsis tasks used to create the Windows installer -->
<taskdef name="launch4j" classname="net.sf.launch4j.ant.Launch4jTask" classpath="installer/launch4j/launch4j.jar" />
<taskdef name="nsis" classname="net.sf.nsisant.Task" classpath="installer/nsisant-1.2.jar" />
<!-- defines the conditions used during creation of the Windows installer -->
<condition property="installer-windows">
<or>
<os family="winnt"/>
<and>
<os family="mac"/>
<available file="/Applications/Wine.app"/>
</and>
<and>
<os family="unix"/>
<available file="/usr/bin/wine"/>
</and>
</or>
</condition>
<condition property="installer-windows-keystore">
<and>
<available file="${workspace.dir}/igi-keystore.spc"/>
<or>
<and>
<os family="winnt"/>
<available file="${workspace.dir}/igi-keystore.pvk"/>
</and>
<and>
<os family="mac"/>
<available file="${workspace.dir}/igi-keystore.der"/>
</and>
<and>
<os family="unix"/>
<available file="${workspace.dir}/igi-keystore-CL.spc.der"/>
</and>
</or>
</and>
</condition>
<condition property="installer-windows-uninstaller" value="${build.dir}\installer\windows\unsigned\">
<os family="winnt"/>
</condition>
<condition property="installer-windows-uninstaller" value="C:\">
<os family="mac"/>
</condition>
<condition property="installer-windows-uninstaller" value="${build.dir}\installer\windows\unsigned\">
<os family="unix"/>
</condition>
<condition property="installer-windows-osfamily-mac">
<os family="mac"/>
</condition>
<condition property="installer-windows-osfamily-unix">
<os family="unix"/>
</condition>
<!-- creates a GeoGebra.exe installer for Windows -->
<target name="installer-windows" depends="readVersion" if="installer-windows">
<launch4j configFile="${src.dir}/installer/geogebra.xml"
outfile="${build.dir}/installer/windows/unsigned/geogebra.exe"
fileVersion="${fullversion}"
txtFileVersion="${fullversion}"
productVersion="${fullversion}"
txtProductVersion="${fullversion}"/>
<copy file="${build.dir}/installer/windows/unsigned/geogebra.exe" tofile="${build.dir}/installer/windows/geogebra.exe"/>
<tstamp />
<nsis script="installer/geogebra.nsi" verbosity="1" path="${src.dir}/installer/nsis">
<define name="build.dir" value="${build.dir}"/>
<define name="fullversion" value="${fullversion}"/>
<define name="versionname" value="${versionname}"/>
<define name="builddate" value="${TODAY}"/>
<define name="outfile" value="${build.dir}/installer/windows/temp/uninstaller.exe"/>
<define name="uninstaller" value="${installer-windows-uninstaller}"/>
</nsis>
<exec executable="${build.dir}/installer/windows/temp/uninstaller.exe" osfamily="winnt"/>
<exec dir="/Applications/Wine.app/Contents/MacOS" executable="/Applications/Wine.app/Contents/MacOS/startwine" osfamily="mac">
<arg file="${build.dir}/installer/windows/temp/uninstaller.exe"/>
<env key="WINEPREFIX" value="${workspace.dir}/wine"/>
</exec>
<exec executable="/usr/bin/wine" osfamily="unix">
<arg file="${build.dir}/installer/windows/temp/uninstaller.exe"/>
<env key="WINEPREFIX" value="${workspace.dir}/wine"/>
</exec>
<antcall target="installer-windows-move-uninstaller-mac"/>
<antcall target="installer-windows-move-uninstaller-unix"/>
<copy file="${build.dir}/installer/windows/unsigned/uninstaller.exe" tofile="${build.dir}/installer/windows/uninstaller.exe"/>
<antcall target="installer-windows-sign-components"/>
<nsis script="installer/geogebra.nsi" verbosity="1" path="${src.dir}/installer/nsis">
<define name="build.dir" value="${build.dir}"/>
<define name="fullversion" value="${fullversion}"/>
<define name="versionname" value="${versionname}"/>
<define name="builddate" value="${TODAY}"/>
<define name="outfile" value="${build.dir}/installer/windows/unsigned/GeoGebra-Windows-Installer-${versionname}.exe"/>
</nsis>
<copy file="${build.dir}/installer/windows/unsigned/GeoGebra-Windows-Installer-${versionname}.exe" tofile="${build.dir}/installer/windows/GeoGebra-Windows-Installer-${versionname}.exe"/>
<antcall target="installer-windows-sign-installer"/>
<move file="${build.dir}/installer/windows/GeoGebra-Windows-Installer-${versionname}.exe" tofile="${build.dir}/installer/GeoGebra-Windows-Installer-${versionname}.exe"/>
<delete dir="${build.dir}/installer/windows" followsymlinks="false" removeNotFollowedSymlinks="true"/>
</target>
<target name="installer-windows-move-uninstaller-mac" if="installer-windows-osfamily-mac">
<move file="${workspace.dir}/wine/drive_c/uninstaller.exe" tofile="${build.dir}/installer/windows/unsigned/uninstaller.exe"/>
</target>
<target name="installer-windows-move-uninstaller-unix" if="installer-windows-osfamily-unix">
<move file="${build.dir}/installer/windows/temp/uninstaller.exe" tofile="${build.dir}/installer/windows/unsigned/uninstaller.exe"/>
</target>
<target name="installer-windows-sign-uninstall-generator" if="installer-windows-keystore">
<exec executable="${src.dir}/installer/signcode" osfamily="winnt">
<arg line="-spc '${workspace.dir}/igi-keystore.spc' -v '${workspace.dir}/igi-keystore.pvk' -n GeoGebra -i http://www.geogebra.org/ -t http://timestamp.verisign.com/scripts/timstamp.dll '${build.dir}/installer/windows/temp/uninstaller.exe'"/>
</exec>
</target>
<target name="installer-windows-sign-components" if="installer-windows-keystore">
<exec executable="${src.dir}/installer/signcode" osfamily="winnt">
<arg line="-spc '${workspace.dir}/igi-keystore.spc' -v '${workspace.dir}/igi-keystore.pvk' -n GeoGebra -i http://www.geogebra.org/ -t http://timestamp.verisign.com/scripts/timstamp.dll '${build.dir}/installer/windows/geogebra.exe'"/>
</exec>
<exec executable="${src.dir}/installer/signcode" osfamily="winnt">
<arg line="-spc '${workspace.dir}/igi-keystore.spc' -v '${workspace.dir}/igi-keystore.pvk' -n GeoGebra -i http://www.geogebra.org/ -t http://timestamp.verisign.com/scripts/timstamp.dll '${build.dir}/installer/windows/uninstaller.exe'"/>
</exec>
<exec executable="${src.dir}/installer/osslsigncode" osfamily="mac">
<arg line="-spc '${workspace.dir}/igi-keystore.spc' -key '${workspace.dir}/igi-keystore.der' -n GeoGebra -i http://www.geogebra.org/ -t http://timestamp.verisign.com/scripts/timstamp.dll -in '${build.dir}/installer/windows/unsigned/geogebra.exe' -out '${build.dir}/installer/windows/geogebra.exe'"/>
</exec>
<exec executable="${src.dir}/installer/osslsigncode" osfamily="mac">
<arg line="-spc '${workspace.dir}/igi-keystore.spc' -key '${workspace.dir}/igi-keystore.der' -n GeoGebra -i http://www.geogebra.org/ -t http://timestamp.verisign.com/scripts/timstamp.dll -in '${build.dir}/installer/windows/unsigned/uninstaller.exe' -out '${build.dir}/installer/windows/uninstaller.exe'"/>
</exec>
<exec executable="${src.dir}/installer/osslsigncode" osfamily="unix">
<arg line="-spc '${workspace.dir}/igi-keystore-CL.spc.der' -key '${workspace.dir}/igi-keystore-CL.key.der' -n GeoGebra -i http://www.geogebra.org/ -t http://timestamp.verisign.com/scripts/timstamp.dll -in '${build.dir}/installer/windows/unsigned/geogebra.exe' -out '${build.dir}/installer/windows/geogebra.exe'"/>
</exec>
<exec executable="${src.dir}/installer/osslsigncode" osfamily="unix">
<arg line="-spc '${workspace.dir}/igi-keystore-CL.spc.der' -key '${workspace.dir}/igi-keystore-CL.key.der' -n GeoGebra -i http://www.geogebra.org/ -t http://timestamp.verisign.com/scripts/timstamp.dll -in '${build.dir}/installer/windows/unsigned/uninstaller.exe' -out '${build.dir}/installer/windows/uninstaller.exe'"/>
</exec>
</target>
<target name="installer-windows-sign-installer" if="installer-windows-keystore">
<exec executable="${src.dir}/installer/signcode" osfamily="winnt">
<arg line="-spc '${workspace.dir}/igi-keystore.spc' -v '${workspace.dir}/igi-keystore.pvk' -n GeoGebra -i http://www.geogebra.org/ -t http://timestamp.verisign.com/scripts/timstamp.dll '${build.dir}/installer/windows/GeoGebra-Windows-Installer-${versionname}.exe'"/>
</exec>
<exec executable="${src.dir}/installer/osslsigncode" osfamily="mac">
<arg line="-spc '${workspace.dir}/igi-keystore.spc' -key '${workspace.dir}/igi-keystore.der' -n GeoGebra -i http://www.geogebra.org/ -t http://timestamp.verisign.com/scripts/timstamp.dll -in '${build.dir}/installer/windows/unsigned/GeoGebra-Windows-Installer-${versionname}.exe' -out '${build.dir}/installer/windows/GeoGebra-Windows-Installer-${versionname}.exe'"/>
</exec>
<exec executable="${src.dir}/installer/osslsigncode" osfamily="unix">
<arg line="-spc '${workspace.dir}/igi-keystore-CL.spc.der' -key '${workspace.dir}/igi-keystore-CL.key.der' -n GeoGebra -i http://www.geogebra.org/ -t http://timestamp.verisign.com/scripts/timstamp.dll -in '${build.dir}/installer/windows/unsigned/GeoGebra-Windows-Installer-${versionname}.exe' -out '${build.dir}/installer/windows/GeoGebra-Windows-Installer-${versionname}.exe'"/>
</exec>
</target>
<!-- defines the jarbundler task used to create the Mac OS X bundle -->
<taskdef name="jarbundler" classname="net.sourceforge.jarbundler.JarBundler" classpath="installer/jarbundler-2.1.0.jar" />
<!-- creates a GeoGebra.app bundle for Mac OS X -->
<target name="installer-macosx" depends="readVersion">
<jarbundler
dir="${build.dir}/installer/macosx"
name="GeoGebra"
mainclass="geogebra.GeoGebra"
jar="${build.dir}/unpacked/geogebra.jar"
build="${build}"
bundleid="geogebra.GeoGebra"
icon="installer/geogebra.icns"
infostring="GeoGebra ${fullversion}, (C) 2001-2011 International GeoGebra Institute"
jvmversion="1.5.0+"
shortname="GeoGebra"
signature="GGB"
stubfile="installer/JavaApplicationStub"
version="${version}">
<javaproperty name="apple.laf.useScreenMenuBar" value="true" />
<javafileset dir="${build.dir}/unpacked" />
<javafileset dir="${build.dir}/unsigned" includes="unpacked/*.jar" />
<documenttype
name="GeoGebra File"
extensions="ggb"
mimetypes="application/vnd.geogebra.file"
iconfile="installer/geogebra.icns"
role="Editor" />
<documenttype
name="GeoGebra Tool"
extensions="ggt"
mimetypes="application/vnd.geogebra.tool"
iconfile="installer/geogebra.icns"
role="Editor" />
</jarbundler>
<copy file="${src.dir}/installer/gpl-3.0.txt" tofile="${build.dir}/installer/macosx/GeoGebra.app/Contents/Resources/gpl-3.0.txt" />
<move file="${build.dir}/installer/macosx/GeoGebra.app/Contents/Resources/Java/unpacked" tofile="${build.dir}/installer/macosx/GeoGebra.app/Contents/Resources/Java/unsigned" />
<zip destfile="${build.dir}/installer/GeoGebra_${versionname}.zip">
<zipfileset dir="${build.dir}/installer/macosx" excludes="GeoGebra.app/Contents/MacOS/JavaApplicationStub" />
<zipfileset dir="${build.dir}/installer/macosx" includes="GeoGebra.app/Contents/MacOS/JavaApplicationStub" filemode="755" />
</zip>
<delete dir="${build.dir}/installer/macosx" followsymlinks="false"/>
</target>
</project>