mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-06 21:00:22 +00:00
193 lines
9.8 KiB
XML
193 lines
9.8 KiB
XML
<project name="AutopsyTSKTargets">
|
|
|
|
<!-- Need a way to specify TSK Debug versus Release -->
|
|
<property name="TSK_BUILD_TYPE">Release</property>
|
|
|
|
|
|
<target name="build-installer-windows" depends="init-advanced-installer"
|
|
description="Makes an installer from the opened ZIP file">
|
|
<antcall target="run-advanced-installer" />
|
|
<!--<delete dir="${nbdist.dir}/${app.name}-installer"/>-->
|
|
</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"/>
|
|
<!-- Copy the template file to add details to -->
|
|
<copy file="${basedir}/installer_${app.name}/installer_${app.name}.aip" tofile="${nbdist.dir}/installer_${app.name}_32.aip" overwrite="true"/>
|
|
<copy file="${basedir}/installer_${app.name}/installer_${app.name}.aip" tofile="${nbdist.dir}/installer_${app.name}_64.aip" overwrite="true"/>
|
|
<property name="inst-path" value="${nbdist.dir}\${app.name}-installer"/>
|
|
<property name="aip-path-32" value="${nbdist.dir}\installer_${app.name}_32.aip"/>
|
|
<property name="aip-path-64" value="${nbdist.dir}\installer_${app.name}_64.aip"/>
|
|
<echo message="${ai-exe-path}" />
|
|
<condition property="jre.home.32">
|
|
<isset property="env.JRE_HOME_32"/>
|
|
</condition>
|
|
<condition property="jre.home.64">
|
|
<isset property="env.JRE_HOME_64"/>
|
|
</condition>
|
|
</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="ai-diog-msg,check-ai-32,check-ai-64" />
|
|
|
|
<target name="ai-diog-msg" description="Print information about installers to be built.">
|
|
<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>
|
|
<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="check-ai-32" 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="extra-bin-name" value="${app.name}64.exe"/>
|
|
<var name="aut-bin-name" value="${app.name}.exe"/>
|
|
<var name="jre-path" value="${env.JRE_HOME_32}"/>
|
|
<antcall target="run-ai-32" inheritAll="true" inheritRefs="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}/installer_${app.name}_32-${app.version}.msi" />
|
|
</target>
|
|
|
|
<target name="run-ai-32" depends="add-ai-productinfo,add-ai-files,add-ai-jre,add-ai-shortcuts,add-ai-env" description="Builds the 64 bit installer.">
|
|
<!-- Leaving this commented out bit for documentation purposes. Not sure what its supposed to do. -->
|
|
<!-- Need to find a way to deal with beta version -->
|
|
<!--<echo message="Setting ${app.name} version to ${app.version}..."/>
|
|
<exec executable="${ai-exe-path}">
|
|
<arg line="/edit ${aip-path} /SetVersion ${app.version}"/>
|
|
</exec>-->
|
|
<!--<delete file="${aip-path}"/>-->
|
|
</target>
|
|
|
|
<target name="check-ai-64" 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="extra-bin-name" value="${app.name}.exe"/>
|
|
<var name="aut-bin-name" value="${app.name}64.exe"/>
|
|
<var name="jre-path" value="${env.JRE_HOME_64}"/>
|
|
<echo message="aip-path: ${aip-path}" />
|
|
<antcall target="run-ai-64" inheritAll="true" inheritRefs="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}/installer_${app.name}_64-${app.version}.msi" />
|
|
</target>
|
|
|
|
<target name="run-ai-64" depends="add-ai-productinfo,add-ai-files,add-ai-jre,add-ai-shortcuts,add-ai-env" description="Builds the 64 bit installer."/>
|
|
|
|
<target name="add-ai-productinfo" description="Add product information to the aip file">
|
|
<scriptdef name="generateguid" language="javascript">
|
|
<attribute name="property" />
|
|
<![CDATA[
|
|
importClass( java.util.UUID );
|
|
|
|
project.setProperty( attributes.get( "property" ), UUID.randomUUID() );
|
|
]]>
|
|
</scriptdef>
|
|
<generateguid property="guid1" />
|
|
<!-- automatically replace version name and productcode in the .aip file -->
|
|
<echo>Product Code: ${guid1}</echo>
|
|
<echo>Product Version: ${app.version}</echo>
|
|
|
|
<!-- Edit the API file to update versions: manual approach allows us to use non-X.Y.Z versions -->
|
|
<replaceregexp file="${aip-path}"
|
|
match="ProductCode" Value="(\d{4}+:.)\w{8}+-\w{4}+-\w{4}+-\w{4}+-\w{12}+"
|
|
replace="ProductCode" Value="\1${guid1}" />
|
|
|
|
<replaceregexp file="${aip-path}"
|
|
match="ProductVersion" Value="\d+\.{1}\d+\.{1}\d+"
|
|
replace="ProductVersion" Value="${app.version}" />
|
|
</target>
|
|
|
|
<target name="add-ai-files" 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\${extra-bin-name}"/>
|
|
</exec>
|
|
</target>
|
|
|
|
<target name="add-file-or-dir" depends="is-file-or-folder">
|
|
<echo message="${ai-exe-path}" />
|
|
<echo message="Adding ${file-or-folder} to installer: ${theFile}"/>
|
|
<exec executable="${ai-exe-path}">
|
|
<arg line="/edit ${aip-path} /Add${file-or-folder} APPDIR ${theFile}" />
|
|
</exec>
|
|
</target>
|
|
|
|
<target name="is-file-or-folder">
|
|
<condition property="file-or-folder" value="File" else="Folder">
|
|
<available file="${theFile}" type="file" />
|
|
</condition>
|
|
</target>
|
|
|
|
<target name="add-ai-jre" description="Adds JRE to Advanced Installer project">
|
|
<echo message="${ai-exe-path}" />
|
|
<echo message="Adding JRE to installer: ${jre-path}"/>
|
|
<exec executable="${ai-exe-path}">
|
|
<arg line="/edit ${aip-path} /AddFolder APPDIR "${jre-path}"" />
|
|
</exec>
|
|
</target>
|
|
|
|
<target name="add-ai-shortcuts" description="Add shortcuts to the aip file">
|
|
<echo message="Adding desktop/menu shortcuts..."/>
|
|
<exec executable="${ai-exe-path}">
|
|
<arg line="/edit ${aip-path} /NewShortcut -name ${app.title} -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} -dir SHORTCUTDIR -target APPDIR\bin\${aut-bin-name} -icon ${inst-path}\icon.ico"/>
|
|
</exec>
|
|
</target>
|
|
|
|
<!-- TODO: does this always need to be done, or just for 64 bit files? -->
|
|
<target name="add-ai-env" description="Add the enviornment variables to the aip file">
|
|
<echo message="Setting environment variables..."/>
|
|
<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>
|
|
<exec executable="${ai-exe-path}">
|
|
<arg line="/build ${aip-path}"/>
|
|
</exec>
|
|
</target>
|
|
</project>
|