mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-06 21:00:22 +00:00
364 lines
16 KiB
XML
364 lines
16 KiB
XML
<project name="AutopsyTSKTargets">
|
|
|
|
<!-- Directory paths -->
|
|
<property name="amd64" location="${basedir}/Core/release/modules/lib/amd64" />
|
|
<property name="x86" location="${basedir}/Core/release/modules/lib/x86" />
|
|
<property name="x86_64" location="${basedir}/Core/release/modules/lib/x86_64" />
|
|
<property name="i386" location="${basedir}/Core/release/modules/lib/i386" />
|
|
<property name="i586" location="${basedir}/Core/release/modules/lib/i586" />
|
|
<property name="i686" location="${basedir}/Core/release/modules/lib/i686"/>
|
|
<property name="crt" location="${basedir}/thirdparty/crt" />
|
|
|
|
|
|
<target name="makeBaseLibDirs" description="Set up folder hierarchy under release/modules/lib">
|
|
<mkdir dir="${amd64}"/>
|
|
<mkdir dir="${x86_64}"/>
|
|
<mkdir dir="${x86}"/>
|
|
<mkdir dir="${i386}"/>
|
|
<mkdir dir="${i586}"/>
|
|
<mkdir dir="${i686}"/>
|
|
</target>
|
|
|
|
<target name="checkTskLibDirs">
|
|
<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."/>
|
|
|
|
<property name="win64.TskLib.path" value="${env.TSK_HOME}/win32/x64/Release"/>
|
|
<property name="win32.TskLib.path" value="${env.TSK_HOME}/win32/Release" />
|
|
<available property="win64.TskLib.exists" type="dir" file="${win64.TskLib.path}" />
|
|
<available property="win32.TskLib.exists" type="dir" file="${win32.TskLib.path}" />
|
|
</target>
|
|
|
|
<!-- copy 64-bit dlls into the installer folder -->
|
|
<target name="copyWinTskLibs64ToBaseDir" if="win64.TskLib.exists">
|
|
<fileset dir="${win64.TskLib.path}" id="win64dlls">
|
|
<include name="libewf.dll" />
|
|
<include name="zlib.dll"/>
|
|
</fileset>
|
|
|
|
<copy todir="${amd64}" overwrite="true">
|
|
<fileset refid="win64dlls" />
|
|
</copy>
|
|
|
|
<copy todir="${x86_64}" overwrite="true">
|
|
<fileset refid="win64dlls" />
|
|
</copy>
|
|
|
|
</target>
|
|
|
|
<!-- copy 32-bit dlls into the installer folder -->
|
|
<target name="copyWinTskLibs32ToBaseDir" if="win32.TskLib.exists">
|
|
<fileset dir="${win32.TskLib.path}" id="win32dlls">
|
|
<include name="zlib.dll" />
|
|
<include name="libewf.dll"/>
|
|
</fileset>
|
|
|
|
<copy todir="${i386}" overwrite="true">
|
|
<fileset refid="win32dlls" />
|
|
</copy>
|
|
|
|
<copy todir="${x86}" overwrite="true">
|
|
<fileset refid="win32dlls" />
|
|
</copy>
|
|
|
|
<copy todir="${i586}" overwrite="true">
|
|
<fileset refid="win32dlls" />
|
|
</copy>
|
|
|
|
<copy todir="${i686}" overwrite="true">
|
|
<fileset refid="win32dlls" />
|
|
</copy>
|
|
</target>
|
|
|
|
<!-- This gets called from the main build.xml -->
|
|
<target name="copyLibsToBaseDir" depends="checkTskLibDirs" description="Copy windows dlls to the correct location." >
|
|
<antcall target="makeBaseLibDirs" inheritRefs="true" />
|
|
<antcall target="copyWinTskLibs32ToBaseDir" inheritRefs="true" />
|
|
<antcall target="copyWinTskLibs64ToBaseDir" inheritRefs="true" />
|
|
</target>
|
|
|
|
|
|
<!-- CRT LIBS TO ZIP - gets called from build.xml -->
|
|
<target name="copyLibsToZip" depends="copyCRT32ToZIP,copyCRT64ToZIP"/>
|
|
|
|
<target name="copyCRT32ToZIP">
|
|
|
|
<!-- verify we have the 32-bit dlls -->
|
|
<property name="CRT32.path" value="${thirdparty.dir}/crt/win32"/>
|
|
<available file="${CRT32.path}" property="crtFound"/>
|
|
<fail unless="crtFound" message="32-bit CRT not found in the thirdparty repo in path: ${CRT32.path}"/>
|
|
|
|
<!-- copy them from third party -->
|
|
<property name="zip-lib-path" value="${zip-tmp}/${app.name}/${app.name}/modules/lib/"/>
|
|
<fileset dir="${CRT32.path}" id="crt32dlls">
|
|
<include name="*.dll"/>
|
|
</fileset>
|
|
|
|
<copy todir="${zip-lib-path}/x86" overwrite="true">
|
|
<fileset refid="crt32dlls"/>
|
|
</copy>
|
|
|
|
<copy todir="${zip-lib-path}/i386" overwrite="true">
|
|
<fileset refid="crt32dlls"/>
|
|
</copy>
|
|
|
|
<copy todir="${zip-lib-path}/i586" overwrite="true">
|
|
<fileset refid="crt32dlls"/>
|
|
</copy>
|
|
|
|
<copy todir="${zip-lib-path}/i686" overwrite="true">
|
|
<fileset refid="crt32dlls"/>
|
|
</copy>
|
|
</target>
|
|
|
|
<target name="copyCRT64ToZIP">
|
|
<!-- Verify we have the 64-bit -->
|
|
<property name="CRT64.path" value="${thirdparty.dir}/crt/win64"/>
|
|
<available file="${CRT64.path}" property="crtFound"/>
|
|
<fail unless="crtFound" message="64-bit CRT not found in the thirdparty repo in path: ${CRT64.path}"/>
|
|
|
|
<!-- Copy the libs -->
|
|
<property name="zip-lib-path" value="${zip-tmp}/${app.name}/${app.name}/modules/lib/"/>
|
|
<fileset dir="${CRT64.path}" id="crt64dlls">
|
|
<include name="*.dll"/>
|
|
</fileset>
|
|
|
|
<copy todir="${zip-lib-path}/x86_64" overwrite="true">
|
|
<fileset refid="crt64dlls"/>
|
|
</copy>
|
|
|
|
<copy todir="${zip-lib-path}/amd64" overwrite="true">
|
|
<fileset refid="crt64dlls"/>
|
|
</copy>
|
|
</target>
|
|
|
|
<!-- ADVANCED INSTALLER TARGETS -->
|
|
<target name="build-installer-windows" depends="getProps,init-advanced-installer"
|
|
description="Makes an installer from the opened ZIP file">
|
|
<antcall target="run-advanced-installer" inheritAll="true" />
|
|
</target>
|
|
|
|
<target name="init-advanced-installer" depends="autoAIPath,inputAIPath"
|
|
description="Find AdvancedInstaller executable.">
|
|
<fail unless="ai-exe-path" message="Could not locate Advanced Installer."/>
|
|
<property environment="env"/>
|
|
|
|
<property name="inst-path" value="${nbdist.dir}\${app.name}-installer"/>
|
|
|
|
<!-- see what JREs they have installed -->
|
|
<condition property="jre.home.32">
|
|
<isset property="env.JRE_HOME_32"/>
|
|
</condition>
|
|
<if>
|
|
<isset property="jre.home.32" />
|
|
<then>
|
|
<echo message="32-bit JRE found, 32 bit installer will be built."/>
|
|
</then>
|
|
<else>
|
|
<echo message="32-bit JRE not found. No 32 bit installer will be build. Set the JRE_HOME_32 environment variable to generate a 32-bit installer."/>
|
|
</else>
|
|
</if>
|
|
|
|
<condition property="jre.home.64">
|
|
<isset property="env.JRE_HOME_64"/>
|
|
</condition>
|
|
<if>
|
|
<isset property="jre.home.64" />
|
|
<then>
|
|
<echo message="64-bit JRE found, 64 bit installer will be built."/>
|
|
</then>
|
|
<else>
|
|
<echo message="64-bit JRE not found. No 64 bit installer will be build. Set the JRE_HOME_64 environment variable to generate a 64-bit installer."/>
|
|
</else>
|
|
</if>
|
|
</target>
|
|
|
|
<target name="autoAIPath" description="Attempt to find the AI path based on standard installation location">
|
|
<property name="AI.path" value="C:\Program Files (x86)\Caphyon\Advanced Installer 10.3\bin\x86\AdvancedInstaller.com" />
|
|
<available file="${AI.path}"
|
|
property="ai-exe-path"
|
|
value="${AI.path}"/>
|
|
<echo message="${ai-exe-path}" />
|
|
</target>
|
|
|
|
<target name="inputAIPath" unless="ai-exe-path" description="Have the user input the path to the AI executable">
|
|
<input addProperty="ai-exe-path"
|
|
message="Enter the location of AdvancedInstaller.com"/>
|
|
</target>
|
|
|
|
<target name="run-advanced-installer" depends="setup-aip-files">
|
|
<antcall target="build32" inheritAll="true" />
|
|
<antcall target="build64" inheritAll="true" />
|
|
</target>
|
|
|
|
|
|
<target name="setup-aip-files" description="Configure the base AIP file and then make 32- and 64-bit versions.">
|
|
<!-- Copy the template file to add details to -->
|
|
<property name="aip-path-base" value="${nbdist.dir}\installer_${app.name}_base.aip"/>
|
|
<copy file="${basedir}/installer_${app.name}/installer_${app.name}.aip" tofile="${aip-path-base}" overwrite="true"/>
|
|
|
|
<echo message="${ai-exe-path}" />
|
|
<echo>Product Version: ${app.version}</echo>
|
|
|
|
<!-- generate new product code -->
|
|
<exec executable="${ai-exe-path}">
|
|
<arg line="/edit ${aip-path-base} /SetProductCode -langid 1033"/>
|
|
</exec>
|
|
|
|
<!-- Edit the API file to update versions: manual approach allows us to use non-X.Y.Z versions -->
|
|
|
|
<replaceregexp file="${aip-path-base}"
|
|
match="ProductVersion" Value="\d+\.{1}\d+\.{1}\d+"
|
|
replace="ProductVersion" Value="${app.version}" />
|
|
|
|
<property name="aip-path-32" value="${nbdist.dir}\installer_${app.name}_32.aip"/>
|
|
<copy file="${aip-path-base}" tofile="${aip-path-32}" overwrite="true"/>
|
|
|
|
<property name="aip-path-64" value="${nbdist.dir}\installer_${app.name}_64.aip"/>
|
|
<copy file="${aip-path-base}" tofile="${aip-path-64}" overwrite="true"/>
|
|
</target>
|
|
|
|
|
|
<target name="copyJRE" description="Copy a given JRE to the installation folder">
|
|
<var name="new-jre-path" value="${inst-path}\jre"/>
|
|
<delete failonerror="false" dir="${new-jre-path}"/>
|
|
<mkdir dir="${new-jre-path}"/>
|
|
<copy todir="${new-jre-path}" overwrite="true">
|
|
<fileset dir="${jre-path}">
|
|
<include name="**/*"/>
|
|
</fileset>
|
|
</copy>
|
|
</target>
|
|
|
|
|
|
<target name="build32" if="jre.home.32" description="Builds the 32 bit installer IF JRE_HOME_32 is set.">
|
|
<property environment="env"/>
|
|
<var name="aip-path" value="${aip-path-32}"/>
|
|
|
|
<var name="aut-bin-name-todelete" value="${app.name}64.exe"/>
|
|
<var name="aut-bin-name" value="${app.name}.exe"/>
|
|
|
|
<var name="jvm.max.mem" value="512" />
|
|
|
|
<var name="jre-path" value="${env.JRE_HOME_32}"/>
|
|
<antcall target="copyJRE" inheritAll="true" />
|
|
|
|
<exec executable="${ai-exe-path}">
|
|
<arg line="/edit ${aip-path-base} /SetAppdir -buildname DefaultBuild -path [ProgramFilesFolder][ProductName]-${app.version}"/>
|
|
</exec>
|
|
|
|
<!-- gstreamer needs special path info to be set -->
|
|
<exec executable="${ai-exe-path}">
|
|
<arg line="/edit ${aip-path} /NewEnvironment -name GSTREAMER_PATH -value [APPDIR]gstreamer\bin -install_operation CreateUpdate -behavior Append -system_variable"/>
|
|
</exec>
|
|
<exec executable="${ai-exe-path}">
|
|
<arg line="/edit ${aip-path} /NewEnvironment -name GSTREAMER_PATH -value [APPDIR]gstreamer\lib\gstreamer-0.10 -install_operation CreateUpdate -behavior Append -system_variable"/>
|
|
</exec>
|
|
<exec executable="${ai-exe-path}">
|
|
<arg line="/edit ${aip-path} /NewEnvironment -name PATH -value %GSTREAMER_PATH% -install_operation CreateUpdate -behavior Append -system_variable"/>
|
|
</exec>
|
|
|
|
<antcall target="ai-build" inheritAll="true" />
|
|
|
|
<delete dir="${nbdist.dir}/installer_${app.name}_32-cache"/>
|
|
<move file="${nbdist.dir}/installer_${app.name}_32-SetupFiles/installer_${app.name}_32.msi" tofile="${nbdist.dir}/${app.name}-${app.version}-32bit.msi" />
|
|
</target>
|
|
|
|
|
|
|
|
<target name="build64" if="jre.home.64" description="Builds the 64 bit installer IF JRE_HOME_64 is set.">
|
|
<property environment="env"/>
|
|
<var name="aip-path" value="${aip-path-64}"/>
|
|
|
|
<var name="aut-bin-name" value="${app.name}64.exe"/>
|
|
<var name="aut-bin-name-todelete" value="${app.name}.exe"/>
|
|
|
|
<var name="jvm.max.mem" value="2048"/>
|
|
|
|
<var name="jre-path" value="${env.JRE_HOME_64}"/>
|
|
<antcall target="copyJRE" inheritAll="true" />
|
|
|
|
|
|
<echo message="aip-path: ${aip-path}" />
|
|
<exec executable="${ai-exe-path}">
|
|
<arg line="/edit ${aip-path} /SetAppdir -buildname DefaultBuild -path [ProgramFiles64Folder][ProductName]-${app.version}"/>
|
|
</exec>
|
|
<exec executable="${ai-exe-path}">
|
|
<arg line="/edit ${aip-path} /SetPackageType x64"/>
|
|
</exec>
|
|
|
|
<antcall target="ai-build" inheritAll="true" />
|
|
|
|
<delete dir="${nbdist.dir}/installer_${app.name}_64-cache"/>
|
|
<move file="${nbdist.dir}/installer_${app.name}_64-SetupFiles/installer_${app.name}_64.msi" tofile="${nbdist.dir}/${app.name}-${app.version}-64bit.msi" />
|
|
</target>
|
|
|
|
|
|
<!-- 32/64 specific since config settings are different -->
|
|
<target name="update-config" description="Updates configuration file with correct JVM args.">
|
|
<!-- Update configuration file to include jre -->
|
|
<property name="inst.property.file" value="${inst-path}/etc/${app.name}.conf" />
|
|
<!-- Sets max heap size to be ${jvm.max.mem} which is set in the run-ai-(32/64) target -->
|
|
<var name="jvm.args" value=""--branding ${app.name} -J-Xms24m -J-Xmx${jvm.max.mem}m -J-XX:MaxPermSize=128M -J-Xverify:none "" />
|
|
<propertyfile file="${inst.property.file}">
|
|
<!-- Note: can be higher on 64 bit systems, should be in sync with project.properties -->
|
|
<entry key="default_options" value="@JVM_OPTIONS" />
|
|
<entry key="jdkhome" value=""jre"" />
|
|
<entry key="default_userdir" value="${HOME}/${APPNAME}" />
|
|
</propertyfile>
|
|
<!-- workaround for ant escaping : and = when setting properties -->
|
|
<replace file="${inst.property.file}" token="@JVM_OPTIONS" value="${jvm.args}" />
|
|
</target>
|
|
|
|
|
|
<target name="add-ai-files" depends="update-config" description="Add the files in the installation path to the installer file">
|
|
<foreach target="add-file-or-dir" param="theFile" inheritall="true" inheritrefs="true">
|
|
<path>
|
|
<fileset dir="${inst-path}">
|
|
<include name="*" />
|
|
</fileset>
|
|
<dirset dir="${inst-path}">
|
|
<include name="*"/>
|
|
</dirset>
|
|
</path>
|
|
</foreach>
|
|
|
|
<echo message="Removing extra executable..."/>
|
|
<exec executable="${ai-exe-path}">
|
|
<arg line="/edit ${aip-path} /DelFile APPDIR\bin\${aut-bin-name-todelete}"/>
|
|
</exec>
|
|
</target>
|
|
|
|
<target name="add-file-or-dir">
|
|
<condition property="file-or-folder" value="File" else="Folder">
|
|
<available file="${theFile}" type="file" />
|
|
</condition>
|
|
<exec executable="${ai-exe-path}">
|
|
<arg line="/edit ${aip-path} /Add${file-or-folder} APPDIR ${theFile}" />
|
|
</exec>
|
|
</target>
|
|
|
|
<!-- 32/64 specific since exec changes -->
|
|
<target name="add-ai-shortcuts" description="Configure installer to have desktop short cuts">
|
|
<echo message="Adding desktop/menu shortcuts..."/>
|
|
<exec executable="${ai-exe-path}">
|
|
<arg line='/edit ${aip-path} /NewShortcut -name "${app.title} ${app.version}" -dir DesktopFolder -target APPDIR\bin\${aut-bin-name} -icon ${inst-path}\icon.ico'/>
|
|
</exec>
|
|
<exec executable="${ai-exe-path}">
|
|
<arg line='/edit ${aip-path} /NewShortcut -name "${app.title} ${app.version}" -dir SHORTCUTDIR -target APPDIR\bin\${aut-bin-name} -icon ${inst-path}\icon.ico'/>
|
|
</exec>
|
|
</target>
|
|
|
|
<target name="ai-build" description="Build the installer based on properties set by 32/64 targets.">
|
|
<antcall target="add-ai-files" inheritAll="true" />
|
|
<antcall target="add-ai-shortcuts" inheritAll="true" />
|
|
<exec executable="${ai-exe-path}">
|
|
<arg line="/build ${aip-path}"/>
|
|
</exec>
|
|
</target>
|
|
|
|
</project>
|