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