I'm trying to use IzPack to install my program and I'd like to add Desktop Shortcuts to the installer, here is the documentation/instructions from the IzPack website.
http://izpack.org/documentation/desktop-shortcuts.html
However, the below XML files, when compiled, only create a blank screen in the installer that hangs when you try to click "Next" to go past it. Here's what the screen looks like when running on Windows 7 - 64 bit.
Here is my install.xml and shortcutSpec.xml files.
install.xml
<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
<installation version="1.0">
<!-- The info section. -->
<info>
<appname>Application Name</appname>
<appversion>1.0</appversion>
<url>http://www.example.com/</url>
<javaversion>1.6</javaversion>
<run-privileged condition="izpack.macinstall|izpack.windowsinstall.vista|izpack.windowsinstall.7"/>
</info>
<!-- The gui preferences indication. -->
<guiprefs width="640" height="480" resizable="yes"/>
<!-- The locale section. -->
<locale>
<langpack iso3="eng"/>
</locale>
<!-- The resources section. -->
<resources>
<res id="LicencePanel.licence" src="licence.txt"/>
<res id="InfoPanel.info" src="readme.txt"/>
<res id="shortcutSpec.xml" src="shortcutSpec.xml"/>
</resources>
<native type="izpack" name="ShellLink.dll"/>
<!-- The panels section. -->
<panels>
<panel classname="HelloPanel"/>
<panel classname="InfoPanel"/>
<panel classname="LicencePanel"/>
<panel classname="TargetPanel"/>
<panel classname="ShortcutPanel"/>
<panel classname="PacksPanel"/>
<panel classname="InstallPanel"/>
<panel classname="SimpleFinishPanel"/>
</panels>
<native type="izpack" name="ShellLink.dll"/>
<!-- The packs section. -->
<packs>
<pack name="Program and Dependencies" required="yes">
<description>Program, libraries and other dependencies</description>
<file src="ExecutableJar.jar" targetdir="$INSTALL_PATH"/>
<file src="lib" targetdir="$INSTALL_PATH"/>
<file src="save" targetdir="$INSTALL_PATH"/>
<file src="HelpContents.chm" targetdir="$INSTALL_PATH"/>
<file src="icon.png" targetdir="$INSTALL_PATH"/>
<file src="application.ini" targetdir="$INSTALL_PATH"/>
<file src="readme.txt" targetdir="$INSTALL_PATH"/>
<file src="licence.txt" targetdir="$INSTALL_PATH"/>
<file src="autorun-win.bat" targetdir="$INSTALL_PATH"/>
</pack>
<pack name="Samples" required="no">
<description>Word Document Samples</description>
<file src="samples" targetdir="$INSTALL_PATH"/>
</pack>
<pack name="Templates" required="no">
<description>Word Document Templates</description>
<file src="templates" targetdir="$INSTALL_PATH"/>
</pack>
</packs>
And the shortcutSpec.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<shortcuts>
<skipIfNotSupported/>
<programGroup defaultName="AppGroupName" location="applications"/>
<shortcut
name="Application - Startup"
target="$INSTALL_PATH\autorun-win.bat"
workingDirectory="$INSTALL_PATH"
programGroup="no"
desktop="yes"
applications="yes"
startMenu="yes"
startup="yes"/>
</shortcuts>
Additional Notes:
I am getting zero compilation errors.
Without the shortcut stuff added, the installer works fine.
My program is an executable jar, to run it automatically I've created a batch script in Windows named autorun-win.bat, which is the what the desktop shortcut should be linked to.
EDIT:
I have tried this import as well as the 32-bit flavor. Neither had any effect on the above results. Any more contributions would be greatly appreciated.
<native type="izpack" name="ShellLink_x64.dll" />
Shortcut creation depends on the native support lib ShellLink.dll which only supports 32 bit systems. For 64-Bit windows you must add the following entry as well to support both flavors:
<native type="izpack" name="ShellLink_x64.dll" />
I've never used this tool, so this may be a total red hering. In your shortcuts file you don't have a CreateForPack statement. Could that be something to do with the fault?
Although this issue is old, I have experienced this problem today on IzPack 4.3.5. Two observations are provided here.
First, the documentation at http://docs.codehaus.org/pages/viewpage.action?pageId=230398023 shows the native statements placed inside a 'natives' tag. This appears to be incorrect for the v4 release.
Second, the ShellLink_x64 DLL must be visible to the compiler. I had to add '-h ${IZPACK_HOME}' to the compiler execution line to make this happen. Sadly there seems to be no warnings if this file cannot be found, but the installer then hangs as described.
Fixing these issues fixed this problem for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With