Added new 32 and 64 installer logic in build files

This commit is contained in:
Jeff Wallace 2013-09-10 14:44:42 -04:00
parent a8ad1d872b
commit 23245c0f3a
2 changed files with 76 additions and 13 deletions

View File

@ -8,18 +8,25 @@
description="Makes an installer from the opened ZIP file"> description="Makes an installer from the opened ZIP file">
<antcall target="run-advanced-installer" /> <antcall target="run-advanced-installer" />
<!--<delete dir="${nbdist.dir}/${app.name}-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> </target>
<target name="init-advanced-installer" depends="autoAIPath,inputAIPath" <target name="init-advanced-installer" depends="autoAIPath,inputAIPath"
description="Find AdvancedInstaller executable."> description="Find AdvancedInstaller executable.">
<fail unless="ai-exe-path" message="Could not locate Advanced Installer."/> <fail unless="ai-exe-path" message="Could not locate Advanced Installer."/>
<property environment="env"/>
<!-- Copy the template file to add details to --> <!-- Copy the template file to add details to -->
<copy file="${basedir}/installer_${app.name}/installer_${app.name}.aip" tofile="${nbdist.dir}/installer_${app.name}.aip" overwrite="true"/> <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="inst-path" value="${nbdist.dir}\${app.name}-installer"/>
<property name="aip-path" value="${nbdist.dir}\installer_${app.name}.aip"/> <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}" /> <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>
<target name="autoAIPath" description="Attempt to find the AI path based on standard installation location"> <target name="autoAIPath" description="Attempt to find the AI path based on standard installation location">
@ -35,18 +42,57 @@
message="Enter the location of AdvancedInstaller.com"/> message="Enter the location of AdvancedInstaller.com"/>
</target> </target>
<target name="run-advanced-installer" depends="add-ai-productinfo,add-ai-files,add-ai-shortcuts,add-ai-env"> <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">
<property name="aip-path" value="${aip-path-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-32,add-ai-shortcuts,add-ai-env">
<!-- Leaving this commented out bit for documentation purposes. Not sure what its supposed to do. --> <!-- 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 --> <!-- Need to find a way to deal with beta version -->
<!--<echo message="Setting ${app.name} version to ${app.version}..."/> <!--<echo message="Setting ${app.name} version to ${app.version}..."/>
<exec executable="${ai-exe-path}"> <exec executable="${ai-exe-path}">
<arg line="/edit ${aip-path} /SetVersion ${app.version}"/> <arg line="/edit ${aip-path} /SetVersion ${app.version}"/>
</exec>--> </exec>-->
<!--<delete file="${aip-path}"/>--> <!--<delete file="${aip-path}"/>-->
</target> </target>
<target name="check-ai-64" if="jre.home.64">
<var name="aip-path" unset="true"/>
<property name="aip-path" value="${aip-path-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-64,add-ai-shortcuts,add-ai-env"/>
<target name="add-ai-productinfo" description="Add product information to the aip file"> <target name="add-ai-productinfo" description="Add product information to the aip file">
<scriptdef name="generateguid" language="javascript"> <scriptdef name="generateguid" language="javascript">
<attribute name="property" /> <attribute name="property" />
@ -98,6 +144,23 @@
</condition> </condition>
</target> </target>
<target name="add-ai-jre-32" description="Adds 32-bit JRE to Advanced Installer project">
<property environment="env"/>
<echo message="${ai-exe-path}" />
<echo message="Adding JRE to installer: ${env.JRE_HOME_32}"/>
<exec executable="${ai-exe-path}">
<arg line="/edit ${aip-path} /AddFolder APPDIR &quot;${env.JRE_HOME_32}&quot;" />
</exec>
</target>
<target name="add-ai-jre-64" description="Adds 64-bit JRE to Advanced Installer project">
<echo message="${ai-exe-path}" />
<echo message="Adding JRE to installer: ${env.JRE_HOME_64}"/>
<exec executable="${ai-exe-path}">
<arg line="/edit ${aip-path} /AddFolder APPDIR &quot;${env.JRE_HOME_64}&quot;" />
</exec>
</target>
<target name="add-ai-shortcuts" description="Add shortcuts to the aip file"> <target name="add-ai-shortcuts" description="Add shortcuts to the aip file">
<echo message="Adding desktop/menu shortcuts..."/> <echo message="Adding desktop/menu shortcuts..."/>
<exec executable="${ai-exe-path}"> <exec executable="${ai-exe-path}">

View File

@ -46,14 +46,14 @@
<echo> TSK_HOME: ${env.TSK_HOME}</echo> <echo> TSK_HOME: ${env.TSK_HOME}</echo>
</target> </target>
<!-- Verify that the JRE_HOME env variable is set --> <!-- Verify that the JRE_HOME env variable is set
<target name="findJRE"> <target name="findJRE">
<property environment="env"/> <property environment="env"/>
<condition property="jreFound"> <condition property="jreFound">
<isset property="env.JRE_HOME"/> <isset property="env.JRE_HOME"/>
</condition> </condition>
<fail unless="jreFound" message="JRE_HOME must be set as an environment variable."/> <fail unless="jreFound" message="JRE_HOME must be set as an environment variable."/>
</target> </target>-->
<target name="getJunit"> <target name="getJunit">
<property name="junit.dir" value="${thirdparty.dir}/junit/${netbeans-plat-version}" /> <property name="junit.dir" value="${thirdparty.dir}/junit/${netbeans-plat-version}" />
@ -63,7 +63,7 @@
<!-- This target will create a custom ZIP file for us. It first uses the general <!-- This target will create a custom ZIP file for us. It first uses the general
ZIP target and then opens it up and adds in any files that we want. This is where we customize the ZIP target and then opens it up and adds in any files that we want. This is where we customize the
version number. --> version number. -->
<target name="build-zip" depends="suite.build-zip,findJRE"> <target name="build-zip" depends="suite.build-zip"> <!--,findJRE" -->
<property name="nbdist.dir" value="dist"/> <property name="nbdist.dir" value="dist"/>
<property name="release.dir" value="${nbdist.dir}/${app.name}"/> <property name="release.dir" value="${nbdist.dir}/${app.name}"/>
@ -80,9 +80,9 @@
<copy file="${basedir}/KNOWN_ISSUES.txt" tofile="${zip-tmp}/${app.name}/KNOWN_ISSUES.txt"/> <copy file="${basedir}/KNOWN_ISSUES.txt" tofile="${zip-tmp}/${app.name}/KNOWN_ISSUES.txt"/>
<unzip src="${thirdparty.dir}/gstreamer/${os.family}/i386/0.10.7/gstreamer.zip" dest="${zip-tmp}/${app.name}/gstreamer"/> <unzip src="${thirdparty.dir}/gstreamer/${os.family}/i386/0.10.7/gstreamer.zip" dest="${zip-tmp}/${app.name}/gstreamer"/>
<copy todir="${zip-tmp}/${app.name}/jre"> <!-- <copy todir="${zip-tmp}/${app.name}/jre">
<fileset dir="${env.JRE_HOME}"/> <fileset dir="${env.JRE_HOME}"/>
</copy> </copy>-->
<copy file="${basedir}/branding_${app.name}/icon.ico" tofile="${zip-tmp}/${app.name}/icon.ico" overwrite="true"/> <copy file="${basedir}/branding_${app.name}/icon.ico" tofile="${zip-tmp}/${app.name}/icon.ico" overwrite="true"/>
<property name="app.property.file" value="${zip-tmp}/${app.name}/etc/${app.name}.conf" /> <property name="app.property.file" value="${zip-tmp}/${app.name}/etc/${app.name}.conf" />
@ -90,7 +90,7 @@
<propertyfile file="${app.property.file}"> <propertyfile file="${app.property.file}">
<!-- Note: can be higher on 64 bit systems, should be in sync with project.properties --> <!-- Note: can be higher on 64 bit systems, should be in sync with project.properties -->
<entry key="default_options" value="@JVM_OPTIONS" /> <entry key="default_options" value="@JVM_OPTIONS" />
<entry key="jdkhome" value="&quot;jre&quot;" /> <entry key="jdkhome" value="&quot;jre7&quot;" />
</propertyfile> </propertyfile>
<!-- workaround for ant escaping : and = when setting properties --> <!-- workaround for ant escaping : and = when setting properties -->
<replace file="${app.property.file}" token="@JVM_OPTIONS" value="${jvm.options}" /> <replace file="${app.property.file}" token="@JVM_OPTIONS" value="${jvm.options}" />