Browse Source

Work on making the windows installer buildable on windows.

Change-Id: I164ae6e2a11ebec24289ac467e8d2cbffeff08bb
Reviewed-on: http://gerrit.dmdirc.com/1229
Automatic-Compile: DMDirc Local Commits <dmdirc@googlemail.com>
Reviewed-by: Gregory Holmes <greg@dmdirc.com>
tags/0.6.4rc1
Shane Mc Cormack 14 years ago
parent
commit
d3365b6296
3 changed files with 65 additions and 21 deletions
  1. 33
    17
      installer/windows/makeInstallerWindows.sh
  2. 6
    1
      launcher/windows/compile.sh
  3. 26
    3
      updateBundledPlugins.sh

+ 33
- 17
installer/windows/makeInstallerWindows.sh View File

35
 # Get 7zip path
35
 # Get 7zip path
36
 ZIP=`which 7z`
36
 ZIP=`which 7z`
37
 
37
 
38
+PWDIR="${PWD}"
39
+# Windows binaries need real paths not cygwin-y pathhs.
40
+if [ "${WINDIR}" != "" ]; then
41
+	PWDIR=`echo "${PWDIR}" | sed 's#^/c/#c:/#'`
42
+fi;
43
+
38
 if [ "" = "${ZIP}" ]; then
44
 if [ "" = "${ZIP}" ]; then
39
 	echo "7Zip not found, failing."
45
 	echo "7Zip not found, failing."
40
 	exit 1;
46
 	exit 1;
42
 
48
 
43
 # Compress stuff!
49
 # Compress stuff!
44
 compress() {
50
 compress() {
45
-	${ZIP} a -yl ${INTNAME} $@ 2>/dev/null || {
51
+	FLAGS="-y"
52
+	if [ "${WINDIR}" = "" ]; then
53
+		FLAGS="${FLAGS}l"
54
+	fi;
55
+	
56
+	"${ZIP}" a ${FLAGS} "${INTNAME}" $@ 2>/dev/null || {
46
 		echo "Compression failed."
57
 		echo "Compression failed."
47
 		kill -15 $$;
58
 		kill -15 $$;
48
 	};
59
 	};
78
 	OUTPUT=${2}
89
 	OUTPUT=${2}
79
 
90
 
80
 	if [ "${WGET}" != "" ]; then
91
 	if [ "${WGET}" != "" ]; then
81
-		${WGET} -O ${OUTPUT} ${URL}
92
+		"${WGET}" -O "${OUTPUT}" ${URL}
82
 	elif [ "${FETCH}" != "" ]; then
93
 	elif [ "${FETCH}" != "" ]; then
83
-		${FETCH} -o ${OUTPUT} ${URL}
94
+		"${FETCH}" -o "${OUTPUT}" ${URL}
84
 	elif [ "${CURL}" != "" ]; then
95
 	elif [ "${CURL}" != "" ]; then
85
-		${CURL} -o ${OUTPUT} ${URL}
96
+		"${CURL}" -o "${OUTPUT}" ${URL}
86
 	fi;
97
 	fi;
87
 }
98
 }
88
 
99
 
255
 # Icon Res file
266
 # Icon Res file
256
 if [ -e ${jarPath}"/src/com/dmdirc/res/icon.ico" ]; then
267
 if [ -e ${jarPath}"/src/com/dmdirc/res/icon.ico" ]; then
257
 	ln -sf ${jarPath}"/src/com/dmdirc/res/icon.ico" ./icon.ico
268
 	ln -sf ${jarPath}"/src/com/dmdirc/res/icon.ico" ./icon.ico
258
-	FILES="${FILES} icon.ico"
269
+	FILES="${FILES} ${PWDIR}/icon.ico"
259
 fi
270
 fi
260
 echo "icon.ico ICON icon.ico" > icon.rc
271
 echo "icon.ico ICON icon.ico" > icon.rc
261
 
272
 
277
 	TEXTVER="${isRelease}"
288
 	TEXTVER="${isRelease}"
278
 	PRIVATE="1"
289
 	PRIVATE="1"
279
 	USER=`whoami`
290
 	USER=`whoami`
291
+	USER=`echo "${USER}" | sed 's#\\\\#\\\\\\\\#g'`
280
 	HOST=`hostname`
292
 	HOST=`hostname`
281
 	DATE=`date`
293
 	DATE=`date`
282
 else
294
 else
384
 
396
 
385
 windres -F pe-i386 -i most.rc -o most.res
397
 windres -F pe-i386 -i most.rc -o most.res
386
 
398
 
387
-FILES="${FILES} DMDirc.jar Setup.exe";
399
+FILES="${FILES} ${PWDIR}/DMDirc.jar ${PWDIR}/Setup.exe";
388
 if [ "" != "${jre}" ]; then
400
 if [ "" != "${jre}" ]; then
389
 	if [ ! -e "../common/${jrename}.exe" ]; then
401
 	if [ ! -e "../common/${jrename}.exe" ]; then
390
 		echo "Downloading JRE to include in installer"
402
 		echo "Downloading JRE to include in installer"
391
 		getFile "${jre}" "../common/${jrename}.exe"
403
 		getFile "${jre}" "../common/${jrename}.exe"
392
 	fi
404
 	fi
393
 	ln -sf ../common/${jrename}.exe jre.exe
405
 	ln -sf ../common/${jrename}.exe jre.exe
394
-	FILES="${FILES} jre.exe"
406
+	FILES="${FILES} ${PWDIR}/jre.exe"
395
 fi;
407
 fi;
396
 DELETEFILES=${FILES}
408
 DELETEFILES=${FILES}
397
 if [ "" != "${DMDIRC_FPC}" ]; then
409
 if [ "" != "${DMDIRC_FPC}" ]; then
404
 	lazarusDir="/usr/lib/lazarus/"
416
 	lazarusDir="/usr/lib/lazarus/"
405
 fi;
417
 fi;
406
 
418
 
419
+
407
 compilerFlags="-Sd -Twin32 ${compilerFlags}";
420
 compilerFlags="-Sd -Twin32 ${compilerFlags}";
408
 extraFlags=""
421
 extraFlags=""
409
 if [ ! -e "Setup.exe"  -o "${compileSetup}" = "true" ]; then
422
 if [ ! -e "Setup.exe"  -o "${compileSetup}" = "true" ]; then
413
 		exit 1;
426
 		exit 1;
414
 	else
427
 	else
415
 		echo "Building Setup.exe..."
428
 		echo "Building Setup.exe..."
416
-		extraFlags="-dKOL -Fu${PWD}/../../libwin/kolfpc -Fu{$PWD}/../../libwin/lcore -Fu{$PWD} -Fu${PWD}/../../libwin"
429
+		extraFlags="-dKOL -Fu${PWDIR}/../../libwin/kolfpc -Fu{$PWDIR}/../../libwin/lcore -Fu{$PWDIR} -Fu${PWDIR}/../../libwin"
430
+		echo ${FPC} ${compilerFlags} ${extraFlags} Setup.dpr
417
 		${FPC} ${compilerFlags} ${extraFlags} Setup.dpr
431
 		${FPC} ${compilerFlags} ${extraFlags} Setup.dpr
418
 		if [ $? -ne 0 ]; then
432
 		if [ $? -ne 0 ]; then
419
 			if [ -e "Setup.exe" -a "${useOldSetup}" = "true" ]; then
433
 			if [ -e "Setup.exe" -a "${useOldSetup}" = "true" ]; then
440
 	unzip -q Shortcut.zip Shortcut.exe
454
 	unzip -q Shortcut.zip Shortcut.exe
441
 	rm Shortcut.zip
455
 	rm Shortcut.zip
442
 fi
456
 fi
443
-FILES="${FILES} Shortcut.exe"
457
+FILES="${FILES} ${PWDIR}/Shortcut.exe"
444
 DELETEFILES="${DELETEFILES} Shortcut.exe"
458
 DELETEFILES="${DELETEFILES} Shortcut.exe"
445
 
459
 
446
 if [ "${isRelease}" != "" ]; then
460
 if [ "${isRelease}" != "" ]; then
451
 
465
 
452
 if [ -e "${DOCSDIR}/README.TXT" ]; then
466
 if [ -e "${DOCSDIR}/README.TXT" ]; then
453
 	ln -sf "${DOCSDIR}/README.TXT" .
467
 	ln -sf "${DOCSDIR}/README.TXT" .
454
-	FILES="${FILES} README.TXT"
468
+	FILES="${FILES} ${PWDIR}/README.TXT"
455
 	DELETEFILES="${DELETEFILES} README.TXT"
469
 	DELETEFILES="${DELETEFILES} README.TXT"
456
 fi
470
 fi
457
 
471
 
458
 if [ -e "${DOCSDIR}/CHANGES.TXT" ]; then
472
 if [ -e "${DOCSDIR}/CHANGES.TXT" ]; then
459
 	ln -sf "${DOCSDIR}/CHANGES.TXT" .
473
 	ln -sf "${DOCSDIR}/CHANGES.TXT" .
460
-	FILES="${FILES} CHANGES.TXT"
474
+	FILES="${FILES} ${PWDIR}/CHANGES.TXT"
461
 	DELETEFILES="${DELETEFILES} CHANGES.TXT"
475
 	DELETEFILES="${DELETEFILES} CHANGES.TXT"
462
 elif [ -e "${DOCSDIR}/CHANGELOG.TXT" ]; then
476
 elif [ -e "${DOCSDIR}/CHANGELOG.TXT" ]; then
463
 	ln -sf "${DOCSDIR}/CHANGELOG.TXT" .
477
 	ln -sf "${DOCSDIR}/CHANGELOG.TXT" .
464
-	FILES="${FILES} CHANGELOG.TXT"
478
+	FILES="${FILES} ${PWDIR}/CHANGELOG.TXT"
465
 	DELETEFILES="${DELETEFILES} CHANGELOG.TXT"
479
 	DELETEFILES="${DELETEFILES} CHANGELOG.TXT"
466
 fi
480
 fi
467
 
481
 
474
 	# Now add to file list.
488
 	# Now add to file list.
475
 	for thisfile in `ls -1 ${jarPath}/launcher/windows/*.exe`; do
489
 	for thisfile in `ls -1 ${jarPath}/launcher/windows/*.exe`; do
476
 		ln -sf ${thisfile} .
490
 		ln -sf ${thisfile} .
477
-		FILES="${FILES} ${thisfile}"
491
+		FILES="${FILES} ${PWDIR}/${thisfile}"
478
 	done
492
 	done
479
 fi
493
 fi
480
 
494
 
481
-extraFlags="-dKOL -Fu${PWD}/../../libwin/kolfpc -Fu{$PWD} -Fu${PWD}/../../libwin"
495
+extraFlags="-dKOL -Fu${PWDIR}/../../libwin/kolfpc -Fu{$PWDIR} -Fu${PWDIR}/../../libwin"
496
+echo ${FPC} ${compilerFlags} ${extraFlags} ${3}Uninstaller.dpr
482
 ${FPC} ${compilerFlags} ${extraFlags} ${3}Uninstaller.dpr
497
 ${FPC} ${compilerFlags} ${extraFlags} ${3}Uninstaller.dpr
483
 if [ -e "Uninstaller.exe" ]; then
498
 if [ -e "Uninstaller.exe" ]; then
484
-	FILES="${FILES} Uninstaller.exe"
485
-#	DELETEFILES="${DELETEFILES} Uninstaller.exe"
499
+	FILES="${FILES} ${PWDIR}/Uninstaller.exe"
500
+#	DELETEFILES="${DELETEFILES} ${PWDIR}/Uninstaller.exe"
486
 fi
501
 fi
487
 
502
 
488
 # Add wget to allow downloading jre
503
 # Add wget to allow downloading jre
495
 	exit 1;
510
 	exit 1;
496
 fi;
511
 fi;
497
 
512
 
498
-FILES="${FILES} wget.exe"
513
+FILES="${FILES} ${PWDIR}/wget.exe"
499
 
514
 
500
 compress $FILES
515
 compress $FILES
501
 
516
 
577
 
592
 
578
 windres -F pe-i386 -i all.rc -o all.res
593
 windres -F pe-i386 -i all.rc -o all.res
579
 
594
 
595
+echo ${FPC} ${compilerFlags} ${3}Launcher.dpr
580
 ${FPC} ${compilerFlags} ${3}Launcher.dpr
596
 ${FPC} ${compilerFlags} ${3}Launcher.dpr
581
 if [ $? -ne 0 ]; then
597
 if [ $? -ne 0 ]; then
582
 	if [ -e "Launcher.exe" ]; then
598
 	if [ -e "Launcher.exe" ]; then

+ 6
- 1
launcher/windows/compile.sh View File

12
 fi
12
 fi
13
 
13
 
14
 rm -Rf ./*.exe
14
 rm -Rf ./*.exe
15
+PWDIR="${PWD}"
16
+# Windows binaries need real paths not cygwin-y pathhs.
17
+if [ "${WINDIR}" != "" ]; then
18
+	PWDIR=`echo "${PWDIR}" | sed 's#^/c/#c:/#'`
19
+fi;
15
 compilerFlags="-Xs -XX -O2 -Or -Op1"
20
 compilerFlags="-Xs -XX -O2 -Or -Op1"
16
-extraFlags="-Fu${PWD}/../../libwin"
21
+extraFlags="-Fu${PWDIR}/../../libwin"
17
 fpc -Sd -Twin32 ${compilerFlags} ${extraFlags} DMDirc.dpr
22
 fpc -Sd -Twin32 ${compilerFlags} ${extraFlags} DMDirc.dpr
18
 fpc -Sd -Twin32 ${compilerFlags} ${extraFlags} DMDircUpdater.dpr
23
 fpc -Sd -Twin32 ${compilerFlags} ${extraFlags} DMDircUpdater.dpr
19
 rm -Rf ./*.o ./*.or ./*.ppu
24
 rm -Rf ./*.o ./*.or ./*.ppu

+ 26
- 3
updateBundledPlugins.sh View File

4
 # Reads the version of each bundled plugin in the specified jar, and writes
4
 # Reads the version of each bundled plugin in the specified jar, and writes
5
 # the names and versions to the jar's version.config file.
5
 # the names and versions to the jar's version.config file.
6
 
6
 
7
-. build-functions.sh
7
+# Find out where we are
8
+BASEDIR=${0%/*}
9
+if [ "${BASEDIR}" = "${0}" ]; then
10
+	BASEDIR=`which $0`
11
+	BASEDIR="${BASEDIR%/*}"
12
+fi
13
+CHECKBASEDIR=`echo "${BASEDIR}" | sed 's#^/##'`
14
+
15
+if [ "${CHECKBASEDIR}" = "${BASEDIR}" -a "${PWD}" != "${CHECKBASEDIR}" -a "${PWD}/." != "${CHECKBASEDIR}" ]; then
16
+	BASEDIR="${PWD}/${BASEDIR}"
17
+fi;
18
+
19
+if [ -e "${BASEDIR}/build-functions.sh" ]; then
20
+	. "${BASEDIR}/build-functions.sh"
21
+else
22
+	echo "Unable to find build-functions.sh. '${BASEDIR}/build-functions.sh'"
23
+	exit 1;
24
+fi;
25
+
8
 
26
 
9
 jar=$1
27
 jar=$1
10
-dir=`safe_mktemp $jar`
28
+dir=`safe_mktemp ${jar##*/}`
11
 config="$dir/com/dmdirc/version.config"
29
 config="$dir/com/dmdirc/version.config"
12
-jar="`pwd`/$jar"
30
+
31
+CHECKJAR=`echo "${jar}" | sed 's#^/##'`
32
+if [ "${CHECKJAR}" = "$jar" ]; then
33
+	jar="`pwd`/$jar"
34
+fi;
35
+
13
 
36
 
14
 cd $dir
37
 cd $dir
15
 # Read the jar's version.config out
38
 # Read the jar's version.config out

Loading…
Cancel
Save