1 | #!/bin/bash
|
---|
2 |
|
---|
3 | # Creates an josm-setup-xy.exe File
|
---|
4 | #
|
---|
5 | # for working on a debian-unix system install the nsis package with
|
---|
6 | # apt-get install nsis
|
---|
7 | # replace the /usr/share/nsis/Plugins/System.dll with the Version from the nsis .zip File
|
---|
8 | # The one comming with the debian package is missing the Call:: Function
|
---|
9 | # See also /usr/share/doc/nsis/README.Debian
|
---|
10 | #
|
---|
11 | # Then download launch4j from http://launch4j.sourceforge.net/
|
---|
12 | # wget http://mesh.dl.sourceforge.net/sourceforge/launch4j/launch4j-3.0.0-pre2-linux.tgz
|
---|
13 | # and unpack it to /usr/share/launch4j
|
---|
14 |
|
---|
15 | ## settings ##
|
---|
16 | LAUNCH4J="java -jar /usr/share/launch4j/launch4j.jar"
|
---|
17 |
|
---|
18 | svncorerevision=`svnversion ../core`
|
---|
19 | svnpluginsrevision=`svnversion ../plugins`
|
---|
20 | svnrevision="$svncorerevision-$svnpluginsrevision"
|
---|
21 |
|
---|
22 | #export VERSION=latest
|
---|
23 | export VERSION=custom-${svnrevision}
|
---|
24 |
|
---|
25 | echo "Creating Windows Installer for josm-$VERSION"
|
---|
26 |
|
---|
27 | ##################################################################
|
---|
28 | ### Build the Complete josm + Plugin Stuff
|
---|
29 | if true; then
|
---|
30 | (
|
---|
31 | echo "Build the Complete josm Stuff"
|
---|
32 |
|
---|
33 | echo "Compile Josm"
|
---|
34 | cd ../core
|
---|
35 | ant -q clean
|
---|
36 | ant -q compile || exit -1
|
---|
37 | cd ..
|
---|
38 |
|
---|
39 | echo "Compile Josm Plugins"
|
---|
40 | cd plugins
|
---|
41 | ant -q clean
|
---|
42 | ant -q dist || exit -1
|
---|
43 | ) || exit -1
|
---|
44 | fi
|
---|
45 |
|
---|
46 | echo
|
---|
47 | echo "##################################################################"
|
---|
48 | echo "### convert jar to exe with launch4j"
|
---|
49 | # (an exe file makes attaching to file extensions a lot easier)
|
---|
50 | # launch4j - http://launch4j.sourceforge.net/
|
---|
51 | # delete old exe file first
|
---|
52 | rm josm.exe
|
---|
53 | $LAUNCH4J ./launch4j.xml
|
---|
54 |
|
---|
55 | if ! [ -s josm.exe ]; then
|
---|
56 | echo "NO Josm File Created"
|
---|
57 | exit -1
|
---|
58 | fi
|
---|
59 |
|
---|
60 | echo
|
---|
61 | echo "##################################################################"
|
---|
62 | echo "### create the installer exe with makensis"
|
---|
63 | # NSIS - http://nsis.sourceforge.net/Main_Page
|
---|
64 | # apt-get install nsis
|
---|
65 | makensis -V2 -DVERSION=$VERSION josm.nsi
|
---|
66 |
|
---|
67 | # delete the intermediate file, just to avoid confusion
|
---|
68 | rm josm.exe
|
---|