autopsy-flatpak/build-windows.xml

167 lines
8.2 KiB
XML

<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>
<!-- 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}/${app.name}/modules/lib"/> -->
<unzip src="${CRT.path}" dest="${zip-tmp}/${app.name}/bin"/>
<!-- 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 9.6.1\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&quot; Value=&quot;(\d{4}+:.)\w{8}+-\w{4}+-\w{4}+-\w{4}+-\w{12}+"
replace="ProductCode&quot; Value=&quot;\1${guid1}" />
<echo>Product Version: ${app.version}</echo>
<replaceregexp file="${proj-path}"
match="ProductVersion&quot; Value=&quot;\d+\.{1}\d+\.{1}\d+"
replace="ProductVersion&quot; Value=&quot;${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}\jre6"/>
</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"/>
</target>
</project>