IzPack - 在Windows上创建桌面快捷方式 - 无法使用

8

我正在尝试使用IzPack来安装我的程序,我想在安装程序中添加桌面快捷方式,以下是来自IzPack网站的文档/说明。

http://izpack.org/documentation/desktop-shortcuts.html

然而,以下XML文件在编译后,只会在安装程序中创建一个空白屏幕,当你试图点击“下一步”时会卡住。这是在Windows 7 - 64位上运行时的屏幕截图。

enter image description here

这是我的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>

附加注释:

  1. 我没有得到任何编译错误。

  2. 没有添加快捷方式的情况下,安装程序可以正常工作。

  3. 我的程序是一个可执行的jar文件,为了自动运行它,我在Windows中创建了一个批处理脚本,名为autorun-win.bat,这就是桌面快捷方式应该链接的地方。

编辑:

我尝试了这个导入以及32位版本,但都对以上结果没有任何影响。如有更多贡献,将不胜感激。

<native type="izpack" name="ShellLink_x64.dll" />

看一下这个:http://stackoverflow.com/questions/33419830/izpack-create-shortcut-on-windows-7/35627201#35627201 - user2233125
4个回答

8

快捷方式的创建依赖于原生支持库ShellLink.dll,该库仅支持32位系统。对于64位Windows,您还必须添加以下条目以支持两种类型:

  <native type="izpack" name="ShellLink_x64.dll" />

1
不幸的是,我已经尝试过这个方法,但对结果没有影响。不过,我还是很感谢您的回复。 - CODe
1
请问您正在运行哪个izpack版本? - Torsten
当前稳定版本:IzPack 4.3.5。很抱歉回复晚了,我在遇到其他问题后就放弃了。总的来说,IzPack相当不稳定和难以预测,对于商业应用来说并不是很好。你因为提供了唯一有用的答案而获得了绿色勾号,希望这至少能帮助未来的某个人。 - CODe

2

虽然这个问题早已存在,但今天我在IzPack 4.3.5上遇到了这个问题。这里提供两点观察。

首先,http://docs.codehaus.org/pages/viewpage.action?pageId=230398023的文档显示本地语句放置在“natives”标签内。但对于v4版本来说,这似乎是不正确的。

其次,ShellLink_x64 DLL必须对编译器可见。我必须将“-h ${IZPACK_HOME}”添加到编译器执行行中才能实现此目的。不幸的是,如果找不到此文件,似乎没有警告,但安装程序会像描述的那样挂起。

修复这些问题对我解决了这个问题。


2
我从未使用过这个工具,因此这可能是一个完全错误的线索。 在你的快捷方式文件中,你没有CreateForPack语句。这是否与故障有关?

1
谢谢您的反馈,但不幸的是那并不是问题所在。 - CODe

0

我曾经遇到过这样一个情况,一个正常工作的izPack配置突然停止了创建快捷方式图标。 后来发现,使用convert命令在Linux下创建的图标文件有问题,我回退到旧的图标。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接