forked from sleuthkit/autopsy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-windows.xml
168 lines (149 loc) · 8.44 KB
/
build-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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
<project name="AutopsyTSKTargets">
<!-- Need a way to specify TSK Debug versus Release -->
<property name="TSK_BUILD_TYPE">Release</property>
<target name="copyTSKLibsToRelease">
<property environment="env"/>
<condition property="ewfFound">
<isset property="env.LIBEWF_HOME"/>
</condition>
<fail unless="ewfFound" message="LIBEWF_HOME must be set as an environment variable."/>
<copy file="${env.TSK_HOME}/win32/${TSK_BUILD_TYPE}/libtsk_jni.dll" tofile="${basedir}/Core/release/modules/lib/libtsk_jni.dll"/>
<copy file="${env.LIBEWF_HOME}/msvscpp/Release/libewf.dll" tofile="${basedir}/Core/release/modules/lib/libewf.dll"/>
<copy file="${env.LIBEWF_HOME}/msvscpp/Release/zlib.dll" tofile="${basedir}/Core/release/modules/lib/zlib.dll"/>
</target>
<target name="copyExternalLibsToZip">
<!-- Find CRT version we linked against from libtsk_jni manifest -->
<!-- disable auto-detection for CRT100
<property name="libtsk.manifest.path">${env.TSK_HOME}/win32/tsk_jni/${TSK_BUILD_TYPE}/libtsk_jni.dll.intermediate.manifest</property>
<loadfile property="libtsk.manifest" srcFile="${libtsk.manifest.path}" />
<propertyregex property="CRT.version"
input="${libtsk.manifest}"
regexp=".*Microsoft\.VC90.*?version\s*?=\s*?'(.*?)'"
select="\1"
casesensitive="false" />
<echo>Found CRT.version linked against: ${CRT.version}</echo>
-->
<!-- <property name="CRT.version">10.0.40219.1</property> -->
<!-- <property name="CRT.version">10.0.40219.325</property> -->
<property name="CRT.version">10.0.30319.1</property>
<!-- Get C++ Runtime dlls -->
<property environment="env"/>
<condition property="crtDetected">
<isset property="CRT.version"/>
</condition>
<fail unless="crtDetected" message="CRT version not detected, check libtsk_jni manifest."/>
<property name="CRT.path">${thirdparty.dir}/crt/x86-32/${CRT.version}/crt.zip</property>
<available file="${CRT.path}" property="crtFound"/>
<fail unless="crtFound" message="Detected CRT version ${CRT.version} not found in the thirdparty repo in path: ${CRT.path}"/>
<!-- unzip from thirdparty repo to modules/lib in staged dir -->
<!-- <unzip src="${CRT.path}" dest="${zip-tmp}/${app.name}/bin"/> -->
<unzip src="${CRT.path}" dest="${zip-tmp}/${app.name}/${app.name}/modules/lib"/>
<!-- delete 64 bit exe for now -->
<delete file="${zip-tmp}/${app.name}/bin/${app.name}64.exe" />
</target>
<target name="autoAIPath" >
<property name="AI.path">C:\Program Files (x86)\Caphyon\Advanced Installer 10.2\bin\x86\AdvancedInstaller.com</property>
<available file="${AI.path}"
property="aiPath"
value="${AI.path}"/>
</target>
<target name="inputAIPath" unless="aiPath">
<input addProperty="aiPath"
message="Enter the location of AdvancedInstaller.com"/>
</target>
<target name="run-advanced-installer" depends="autoAIPath,inputAIPath">
<fail unless="aiPath" message="Could not locate Advanced Installer."/>
<copy file="${basedir}/installer_${app.name}/installer_${app.name}.aip" tofile="${nbdist.dir}/installer_${app.name}.aip"/>
<scriptdef name="generateguid" language="javascript">
<attribute name="property" />
<![CDATA[
importClass( java.util.UUID );
project.setProperty( attributes.get( "property" ), UUID.randomUUID() );
]]>
</scriptdef>
<generateguid property="guid1" />
<property name="inst-path" value="${nbdist.dir}\${app.name}-installer"/>
<property name="proj-path" value="${nbdist.dir}\installer_${app.name}.aip"/>
<!-- automatically replace version name and productcode in the .aip file -->
<echo>Product Code: ${guid1}</echo>
<replaceregexp file="${proj-path}"
match="ProductCode" Value="(\d{4}+:.)\w{8}+-\w{4}+-\w{4}+-\w{4}+-\w{12}+"
replace="ProductCode" Value="\1${guid1}" />
<echo>Product Version: ${app.version}</echo>
<replaceregexp file="${proj-path}"
match="ProductVersion" Value="\d+\.{1}\d+\.{1}\d+"
replace="ProductVersion" Value="${app.version}" />
<echo message="Adding files to installer..."/>
<exec executable="${aiPath}">
<arg line="/edit ${proj-path} /AddFolder APPDIR ${inst-path}\bin"/>
</exec>
<exec executable="${aiPath}">
<arg line="/edit ${proj-path} /AddFolder APPDIR ${inst-path}\etc"/>
</exec>
<exec executable="${aiPath}">
<arg line="/edit ${proj-path} /AddFolder APPDIR ${inst-path}\gstreamer"/>
</exec>
<exec executable="${aiPath}">
<arg line="/edit ${proj-path} /AddFolder APPDIR ${inst-path}\harness"/>
</exec>
<exec executable="${aiPath}">
<arg line="/edit ${proj-path} /AddFolder APPDIR ${inst-path}\java"/>
</exec>
<exec executable="${aiPath}">
<arg line="/edit ${proj-path} /AddFolder APPDIR ${inst-path}\jre"/>
</exec>
<exec executable="${aiPath}">
<arg line="/edit ${proj-path} /AddFolder APPDIR ${inst-path}\platform"/>
</exec>
<exec executable="${aiPath}">
<arg line="/edit ${proj-path} /AddFolder APPDIR ${inst-path}\${app.name}"/>
</exec>
<exec executable="${aiPath}">
<arg line="/edit ${proj-path} /AddFile APPDIR ${inst-path}\icon.ico"/>
</exec>
<exec executable="${aiPath}">
<arg line="/edit ${proj-path} /AddFile APPDIR ${inst-path}\KNOWN_ISSUES.txt"/>
</exec>
<exec executable="${aiPath}">
<arg line="/edit ${proj-path} /AddFile APPDIR ${inst-path}\LICENSE-2.0.txt"/>
</exec>
<exec executable="${aiPath}">
<arg line="/edit ${proj-path} /AddFile APPDIR ${inst-path}\NEWS.txt"/>
</exec>
<exec executable="${aiPath}">
<arg line="/edit ${proj-path} /AddFile APPDIR ${inst-path}\README.txt"/>
</exec>
<!-- Need to find a way to deal with beta version -->
<!--<echo message="Setting ${app.name} version to ${app.version}..."/>
<exec executable="${aiPath}">
<arg line="/edit ${proj-path} /SetVersion ${app.version}"/>
</exec>-->
<echo message="Adding desktop/menu shortcuts..."/>
<exec executable="${aiPath}">
<arg line="/edit ${proj-path} /NewShortcut -name ${app.title} -dir DesktopFolder -target APPDIR\bin\${app.name}.exe -icon ${inst-path}\icon.ico"/>
</exec>
<exec executable="${aiPath}">
<arg line="/edit ${proj-path} /NewShortcut -name ${app.title} -dir SHORTCUTDIR -target APPDIR\bin\${app.name}.exe -icon ${inst-path}\icon.ico"/>
</exec>
<echo message="Setting environment variables..."/>
<exec executable="${aiPath}">
<arg line="/edit ${proj-path} /NewEnvironment -name GSTREAMER_PATH -value [APPDIR]gstreamer\bin -install_operation CreateUpdate -behavior Append -system_variable"/>
</exec>
<exec executable="${aiPath}">
<arg line="/edit ${proj-path} /NewEnvironment -name GSTREAMER_PATH -value [APPDIR]gstreamer\lib\gstreamer-0.10 -install_operation CreateUpdate -behavior Append -system_variable"/>
</exec>
<exec executable="${aiPath}">
<arg line="/edit ${proj-path} /NewEnvironment -name PATH -value %GSTREAMER_PATH% -install_operation CreateUpdate -behavior Append -system_variable"/>
</exec>
<exec executable="${aiPath}">
<arg line="/build ${proj-path}"/>
</exec>
<delete file="${proj-path}"/>
</target>
<target name="build-installer-windows">
<antcall target="run-advanced-installer" />
<!--<delete dir="${nbdist.dir}/${app.name}-installer"/>-->
<delete dir="${nbdist.dir}/installer_${app.name}-cache"/>
<move file="${nbdist.dir}/installer_${app.name}-SetupFiles/installer_${app.name}.msi" tofile="${nbdist.dir}/installer_${app.name}-${app.version}.msi" />
</target>
</project>