forked from onmyee/Flashtool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-windows.xml
108 lines (96 loc) · 4.56 KB
/
setup-windows.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
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project default="all" name="Create Windows Package">
<target name="all" depends="loadprops, clean, binaries, dodrivers, dosetup"/>
<target name="main_lib">
<tstamp>
<format property="TODAY" pattern="yyyy-MM-dd HH:mm:ss" />
</tstamp>
<jar destfile="../Deploy/FlashTool/x10flasher.jar">
<manifest>
<attribute name="Main-Class" value="gui.Main"/>
<attribute name="Implementation-Version" value="Version ${Internal-Version} built on ${TODAY}"/>
<attribute name="Internal-Version" value="${Internal-Version}"/>
</manifest>
<fileset dir="./bin" excludes="/gui/ressources/icons/**"/>
</jar>
</target>
<target name="clean">
<delete dir="../Deploy/FlashTool/x10flasher_lib/winjre32"/>
<delete dir="../Deploy/FlashTool/x10flasher_lib/winjre64"/>
<delete dir="../Deploy/FlashTool/x10flasher_lib/linjre32"/>
<delete dir="../Deploy/FlashTool/x10flasher_lib/linjre64"/>
<delete dir="../Deploy/FlashTool/x10flasher_lib/macjre64"/>
<delete file="../Deploy/FlashTool/FlashTool.exe"/>
<delete file="../Deploy/FlashTool/FlashTool64.exe"/>
<delete file="../Deploy/FlashTool/FlashToolConsole"/>
<delete file="../Deploy/FlashTool/FlashTool"/>
<delete file="../Deploy/FlashTool/x10flasher_lib/7z.exe"/>
<delete file="../Deploy/FlashTool/x10flasher_lib/adb.exe"/>
<delete file="../Deploy/FlashTool/x10flasher_lib/bin2elf.exe"/>
<delete file="../Deploy/FlashTool/x10flasher_lib/bin2sin.exe"/>
<delete file="../Deploy/FlashTool/x10flasher_lib/fastboot.exe"/>
<delete file="../Deploy/FlashTool/x10flasher_lib/unyaffs.windows.exe"/>
<delete file="../Deploy/FlashTool/x10flasher_lib/7z.dll"/>
<delete file="../Deploy/FlashTool/x10flasher_lib/AdbWinApi.dll"/>
<delete file="../Deploy/FlashTool/x10flasher_lib/AdbWinUsbApi.dll"/>
<delete file="../Deploy/FlashTool/x10flasher_lib/cygwin1.dll"/>
<delete file="../Deploy/FlashTool/x10flasher_lib/adb.linux"/>
<delete file="../Deploy/FlashTool/x10flasher_lib/fastboot.linux"/>
<delete file="../Deploy/FlashTool/x10flasher_lib/unyaffs.linux"/>
<delete file="../Deploy/FlashTool/x10flasher_lib/bin2elf"/>
<delete file="../Deploy/FlashTool/x10flasher_lib/bin2sin"/>
<delete dir="../Deploy/FlashTool/x10flasher_lib/linux"/>
<delete file="../Deploy/FlashTool/x10flasher_lib/adb.mac"/>
<delete file="../Deploy/FlashTool/x10flasher_lib/fastboot.mac"/>
<delete file="../Deploy/FlashTool/x10flasher_lib/unyaffs.mac"/>
<delete dir="../Deploy/FlashTool/x10flasher_lib/swtlin"/>
<delete dir="../Deploy/FlashTool/x10flasher_lib/swtmac"/>
<delete dir="../Deploy/FlashTool/x10flasher_lib/mac"/>
<delete file="../Deploy/FlashTool/config.properties"/>
</target>
<target name="JRE">
<unzip src="./jre/winjre.zip" dest="../Deploy/FlashTool/x10flasher_lib"/>
</target>
<target name="loadprops">
<loadmf jar="../Deploy/FlashTool/x10flasher_lib/x10flasher-res.jar" prefix=""/>
</target>
<target name="dodrivers">
<nsis script="drivers.nsi" path="C:\Program Files (x86)\NSIS\Unicode"/>
</target>
<target name="binaries" depends="clean, main_lib, JRE">
<copy file="./ProgramExe/FlashTool.exe" todir="../Deploy/FlashTool"/>
<copy file="./ProgramExe/FlashTool64.exe" todir="../Deploy/FlashTool"/>
<copy todir="../Deploy/FlashTool/x10flasher_lib">
<fileset dir="./win32"/>
</copy>
</target>
<target name="dosetup">
<delete file="../Deploy/FlashTool/config.properties"/>
<copy file="setup.nsi" tofile="setup_new.nsi"/>
<replace file="setup_new.nsi" token="FLASHTOOLVERSION" value="${Internal-Version}"/>
<nsis script="setup_new.nsi" path="C:\Program Files (x86)\NSIS\Unicode"/>
<delete file="setup_new.nsi"/>
</target>
<!--
Loads entries from a manifest file.
@jar The jar from where to read
@prefix A prefix to prepend
-->
<macrodef name="loadmf">
<attribute name="jar"/>
<attribute name="prefix" default=""/>
<sequential>
<loadproperties>
<!-- Load the manifest entries -->
<zipentry zipfile="@{jar}" name="META-INF/MANIFEST.MF"/>
<!-- Add the prefix -->
<filterchain>
<prefixlines prefix="@{prefix}"/>
</filterchain>
</loadproperties>
</sequential>
</macrodef>
<taskdef name="nsis" classname="com.danielreese.nsisant.Task">
<classpath location="libs/nsisant-1.3.jar"/>
</taskdef>
</project>