java - IzPack 快捷方式噩梦

标签 java izpack shortcut-file

我已经无计可施了。

我有一个非常简单的 izpack 安装描述符,用于 Windows 上的两包 Java 应用程序。除了创建快捷方式之外,一切都按预期进行。首先,快捷方式面板似乎不太正确。显示标签“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>

安装程序根本不会在任何地方创建任何快捷方式。它结束时没有错误消息,没有日志,没有堆栈跟踪,什么也没有。

帮助。

最佳答案

我通过进入 izPack/lib/izpack-core-5.0.9.jar 并打开 /com/izforge/izpack/bin/langpacks/installer/ 文件夹中。然后编辑 bra.xml 文件并添加以下行:

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

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

关于java - IzPack 快捷方式噩梦,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36506715/

相关文章:

java - IzPack 和辅助功能(使用屏幕阅读器)

windows-8 - 使用 Inno Setup 忽略开始屏幕图 block 的 .VisualElementsManifest.xml

windows - 在 Go 中创建 Windows 快捷方式 (.lnk)

java - 仅检查字母和数字字符的方法

java - 将枚举映射到表列,其中数据库值是枚举字段,而不是标签

java - 没有 java 就无法运行 izpack 安装程序

java - 如何使用 izPack 创建安装程序

PowerShell:在 'IF' 语句中使用 $env:userprofile

Java 数组定义

java - 基于反射的基本通用 DAO