我正在尝试使用IzPack来安装我的程序,我想在安装程序中添加桌面快捷方式,以下是来自IzPack网站的文档/说明。
http://izpack.org/documentation/desktop-shortcuts.html
然而,以下XML文件在编译后,只会在安装程序中创建一个空白屏幕,当你试图点击“下一步”时会卡住。这是在Windows 7 - 64位上运行时的屏幕截图。
这是我的install.xml和shortcutSpec.xml文件。
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>
和 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>
附加注释:
我没有得到任何编译错误。
没有添加快捷方式的情况下,安装程序可以正常工作。
我的程序是一个可执行的jar文件,为了自动运行它,我在Windows中创建了一个批处理脚本,名为autorun-win.bat,这就是桌面快捷方式应该链接的地方。
编辑:
我尝试了这个导入以及32位版本,但都对以上结果没有任何影响。如有更多贡献,将不胜感激。
<native type="izpack" name="ShellLink_x64.dll" />