Statistics
| Revision:

root / tmp / org.txm.setups / BuildWin64bit.sh @ 2750

History | View | Annotate | Download (2.4 kB)

1
VERSION=`cat VERSION``cat SUBVERSION`
2
STEP=$1
3
ARCH="64"
4
ARCHCODE="x86_64"
5
TIMESTAMP=`date +"%Y-%m-%d"`
6
APP="TXM_${VERSION}_${TIMESTAMP}_Win${ARCH}_installer"
7

    
8
echo "BUILDING $APP..."
9
echo "Make dir"
10
rm -rf "${APP}"
11
mkdir "${APP}"
12

    
13
echo "copy shared files: css, xsl, scripts, samples..."
14
rsync -r  --exclude '.svn' "shared/all"/* "${APP}"
15

    
16
if [ $? != 0 ]; then
17
	echo "** ${APP}: copy Win shared files failed"
18
	exit 1;
19
fi
20

    
21
echo "convert licence files encoding to Windows-1252"
22
iconv -f utf8 -t WINDOWS-1252 shared/all/license_agreement_fr.txt > "$APP/license_agreement_fr.txt"
23
iconv -f utf8 -t WINDOWS-1252 shared/all/license_agreement.txt > "$APP/license_agreement.txt"
24
iconv -f utf8 -t WINDOWS-1252 shared/all/LICENSE_FR.TXT > "$APP/LICENSE_FR.TXT"
25
iconv -f utf8 -t WINDOWS-1252 shared/all/LICENSE.TXT > "$APP/LICENSE.TXT"
26

    
27
echo "copy win shared files: *.ico, TestPreInstall.jar..."
28
rsync -r  --exclude '.svn' "shared/win"/* "${APP}"
29

    
30
if [ $? != 0 ]; then
31
	echo "** ${APP}: copy Win arch files failed"
32
	exit 1;
33
fi
34

    
35
# ensure JRE files are here
36
if [ ! -d "${APP}/jre/bin" ]; then
37
	echo "** $APP: JRE files are missing."
38
	exit 1;
39
fi
40

    
41
rm -f "exportRCP/win32.win32.${ARCHCODE}/TXM/p2/org.eclipse.equinox.p2.engine/.settings/*" &&
42
rm -f "exportRCP/win32.win32.${ARCHCODE}/TXM/p2/org.eclipse.equinox.p2.engine/profileRegistry/profile.profile/.data/.settings/*"
43
if [ $? != 0 ]; then
44
	echo "** $APP: failed to remove p2 preferences"
45
	exit 1;
46
fi
47

    
48
echo "copy eclipse arch dependent build"
49
rsync -r  --exclude '.svn' "exportRCP/win32.win32.${ARCHCODE}/TXM/"* "${APP}"
50

    
51
if [ $? != 0 ]; then
52
	echo "** ${APP}: copy Win build files failed"
53
	exit 1;
54
fi
55

    
56
#echo "copy cqp JNI libs near TXM executable"
57
echo "copy CQP binary files"
58
cp "../org.txm.libs.cqp.win32/res/win64"/*.dll "${APP}/" &&
59
cp "../org.txm.libs.cqp.win32/res/win64"/*.dll "${APP}/TXM"
60

    
61
if [ $? != 0 ]; then
62
	echo "** ${APP}: copy Win lib files failed"
63
	exit 1;
64
fi
65

    
66

    
67
echo "clean"
68
bash directoryCleaner.sh "$APP"
69
if [ $? != 0 ]; then
70
	echo "** $APP: failed to clean win64 setup $APP"
71
	exit 1;
72
fi
73

    
74
echo "set TXMVERSION and TIMESTAMP in build files"
75
find "$APP/txm.nsi" -type f -exec sed -i "s/TXMDATEVERSION/${VERSION}_${TIMESTAMP}/g" {} \;
76
find "$APP/txm.nsi" -type f -exec sed -i "s/TXMVERSION/${VERSION}/g" {} \;
77

    
78
echo "build executable"
79
wine nsis/makensis.exe -V1 ${APP}/txm.nsi 2> logs64
80

    
81
if [ ! -e "${APP}.exe" ]; then
82
	echo "** ${APP}.exe : not builded"
83
	exit 1;
84
fi
85

    
86
chmod +x "${APP}.exe"