spacer
AntInstaller

Ant tricks

The back end of AntInstaller is Ant so you can do anything with AntInstaller that Ant can do. However there are a few things that an installer should do that you may not be aware of and this page is a start at highlighting them.
Please get in contact if you have other tips and tricks that might help other users.

Windows Shortcuts

To get Ant to create Windows shortcuts you have to set up a few hooks into standard windows libraries. Essentilly you need to use RunDLL and pass a windows setup .INF file. You can not deliver the .INF file correct for every system so you should use the replace task on the delivered file to set the final location of the .ICO files that will be used and the final location of the executables or files to create shortcuts to.

installIcons.inf N.B. the ridiculous multiple quotes are obligatory. After deploying this file the @installDir@ must be replaced with the actual installation directory using Ant replace.
[version]
signature="$chicago$"

[DefaultInstall]
UpdateInis=Addlink

[AddLink]
setup.ini, progman.groups,, "group0=DBusViewer (enhanced)"
setup.ini, group0,, ""DBusViewer (enhanced)""
setup.ini, group0,, """DBusViewer (enhanced)"",""cmd /c """"@installDir@\bin\MessageViewer.cmd"""""",""@installDir@\bin\favicon.ico"",0,"

setup.ini, progman.groups,, "group0=DBusViewer (enhanced)"
setup.ini, group0,, ""DBusViewer (enhanced)""
setup.ini, group0,, """Edit Start Script"",""notepad.exe "@installDir@\bin\MessageViewer.cmd""",,0,"
To execute this install on Win32 systems the following command must be run, with appropriate replacements.
rundll32.exe setupapi,InstallHinfSection DefaultInstall 132 @deploymentDir@\installIcons.inf
The following is an except from a build.xml file to achieve the above.
<target name="Install Icons" depends="">
<echo message="Installing Icons"/>
	<replace file="${basedir}\installIcons.inf">
		<replacefilter token="@installDir@" value="${installDir}"/>
	</replace>

	<exec executable="rundll32.exe">
		<arg value="setupapi,InstallHinfSection"/>
		<arg value="DefaultInstall"/>
		<arg value="132"/>
		<arg value="${basedir}\installIcons.inf"/>
	</exec>
</target>
Clearly this will not work on Linux, there is a task in developent to run targets based on OS for the moment just add a target element that allows users to select this target if they are running on windows and want icons created. On Windoze95 the 16 bit rundll is required and the command is slightly different. Investigate on the web if you must support Windows95. P.S. does anyone know how to add KDE and of Gnome Icons
show menu