IzPack Shortcut Nightmare

时间:2016-04-08 18:25:33

标签: java izpack desktop-shortcut

我的智慧结束了。

对于Windows上的双包Java应用程序,我有一个非常简单的izpack安装描述符。一切都按预期工作除了快捷方式创建。一开始,快捷方式面板似乎不正确。标签" ShortcutPanel.regular.startup"显示而不是"在启动时运行"或启动执行复选框中的任何类型。

Something's not quite right...

运行安装程序后,根本无法创建快捷方式。这是我的install.xml的样子,非常简单:

<izpack:installation version="5.0"
xmlns:izpack="http://izpack.org/schema/installation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://izpack.org/schema/installation http://izpack.org/schema/5.0/izpack-installation-5.0.xsd">

<info>
    <appname>application_name</appname>
    <appversion>2.0.0</appversion>
    <appsubpath>myapp</appsubpath>
    <javaversion>1.8</javaversion>
</info>

<locale>
    <langpack iso3="bra" />
</locale>

<resources>
    <res src="shortcutSpec.xml" id="shortcutSpec.xml"/>
</resources>

<variables>
    <variable name="TargetPanel.dir.windows" value="C:/Sistemas"/>
</variables>

<guiprefs width="800" height="600" resizable="no">
    <laf name="substance">
        <os family="windows" />
        <os family="unix" />
        <param name="variant" value="mist-silver" />
    </laf>
    <modifier key="useHeadingPanel" value="yes" />
</guiprefs>

<panels>
    <panel classname="HelloPanel" />
    <panel classname="DefaultTargetPanel" />
    <panel classname="ShortcutPanel" />
    <panel classname="InstallPanel" />
    <panel classname="FinishPanel" />
</panels>

<natives>
    <native type="izpack" name="ShellLink.dll">
        <os family="windows"/>
    </native>
    <native type="izpack" name="ShellLink_x64.dll">
        <os family="windows"/>
    </native>
</natives>

<packs>
    <pack name="Pack1" required="yes">
        <description>one of the packs it's a jar</description>
        <file src="lib/pack1.jar" targetdir="$INSTALL_PATH/pack1subdir"
            override="true">
        </file>
        <file src="imagens/logo.ico" targetdir="$INSTALL_PATH/pack1subdir/imagens/"
            override="true" />
        <executable targetfile="lib/pack1.jar" type="jar"
            stage="never"></executable>
    </pack>
    <pack name="Pack2" required="yes">
        <description>the other pack</description>
        <file src="lib/pack2.jar" targetdir="$INSTALL_PATH/pack2subdir"
            override="true">
        </file>
        <file src="imagens/update.ico" targetdir="$INSTALL_PATH/pack2subdir/imagens/"
            override="true" />
        <executable targetfile="lib/pack2.jar" type="jar"
            stage="never"></executable>
    </pack>
</packs>

然后是shortcutSpec.xml。我的pom将它移动到我的临时目录:

<izpack:shortcuts version="5.0"
xmlns:izpack="http://izpack.org/schema/shortcuts" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://izpack.org/schema/shortcuts http://izpack.org/schema/5.0/izpack-shortcuts-5.0.xsd">

<lateShortcutInstall />

<shortcut name="pack1" programGroup="false"
    desktop="true" applications="false" startMenu="no" startup="true"
    target="java -jar $INSTALL_PATH/pack1subdir/pack1.jar"
    workingDirectory="$INSTALL_PATH/pack1subdir/">
    <createForPack name="pack1" />
</shortcut>

<shortcut name="pack2" programGroup="false"
    desktop="true" applications="false" startMenu="no" startup="true"
    target="java -jar $INSTALL_PATH/pack2subdir/pack1.jar"
    workingDirectory="$INSTALL_PATH/pack2subdir/">
    <createForPack name="pack2" />
</shortcut>

安装程序根本无法在任何地方创建任何快捷方式。它完成没有错误消息没有日志没有堆栈跟踪没有任何东西。

帮助。

1 个答案:

答案 0 :(得分:1)

我通过进入 izPack / lib / izpack-core-5.0.9.jar 并打开 / com / izforge / izpack / bin / langpacks / installer / <修复了这个问题。 / em>文件夹。然后编辑bra.xml文件并添加以下行:

<str id="ShortcutPanel.regular.startup" txt="Iniciar com o Windows"/>

然后保存并更新jar中的文件并重建您的安装程序。