izpack:在 Windows 上创建快捷方式

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7295544/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 17:59:24  来源:igfitidea点击:

izpack: create shortcut on windows

windowsshortcutizpack

提问by Angelo Fuchs

I use izpack to create an installer for my application. So far I was able to create the installer and on my linux machine everything is fine. The problem is that on the windows machines I tested it on (Win7 and WinXP) the installer did not show the shortcut panel. I did read the documentation troubleshooting section and took care that I have the natives in my installer. Same goes for the shortcut xml file, they are in the installer in the resources path. I also read that most likely it is a case sensitive typo or something similar simple but could not figure it out. Here is my shortcut xml:

我使用 izpack 为我的应用程序创建安装程序。到目前为止,我能够创建安装程序,并且在我的 linux 机器上一切正常。问题是在我在(Win7 和 WinXP)上测试的 Windows 机器上,安装程序没有显示快捷方式面板。我确实阅读了文档故障排除部分,并注意我的安装程序中有本机。快捷方式 xml 文件也是如此,它们位于资源路径中的安装程序中。我还读到它很可能是一个区分大小写的错字或类似的简单但无法弄清楚的东西。这是我的快捷方式xml:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
This is the shortcut specification for windows. Its considered default so on
Systems that are not shortcut compatible the information is taken from here.
-->
<shortcuts>
<programGroup defaultName="SteamNet" location="applications"/>
<shortcut
    name = "One Click Wonder"
    target = "$INSTALL_PATH\oneclickwonder.bat"
    commandLine = ""
    workingDirectory= "$INSTALL_PATH"
    description="Minimal Desktop Timer"
    iconFile="$INSTALL_PATH\images\windows_icon.ico"
    iconIndex="0"
    initialState="noShow"
    programGroup="yes"
    desktop="yes"
    applications="yes"
    startMenu="yes"
    startup="yes"/>
</shortcuts>

采纳答案by Juan Mellado

I have created this (dummy) installation file just for testing the shortcut panel:

我创建了这个(虚拟)安装文件只是为了测试快捷面板:

<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
<installation version="1.0">
  <info>
    <appname>Test</appname>
    <appversion>1</appversion>
  </info>
  <guiprefs width="600" height="480" resizable="no">
  </guiprefs>
  <locale>
    <langpack iso3="eng"/>
  </locale>
  <panels>
    <panel classname="ShortcutPanel"/>
  </panels>
  <packs>
    <pack name="Test" required="yes">
      <description>Description</description>
    </pack>
  </packs>
  <resources>
    <res src="shortcutSpec.xml" id="shortcutSpec.xml"/>
  </resources>
  <native type="izpack" name="ShellLink.dll"/>
</installation>

Where shortcutSpec.xmlhave the exact same content showed on your question.

shortcutSpec.xml您的问题中哪里显示了完全相同的内容。

I build it using IzPack 4.3.5 in Ubuntu (left) and tested on Windows 7 64 bits (right).

我在 Ubuntu(左)中使用 IzPack 4.3.5 构建它并在 Windows 7 64 位(右)上测试。

IzPack shortcut panel

IzPack 快捷面板

Shortcut panel open here and there.

快捷面板在这里和那里打开。

Step by step:

一步步:

  1. Download IzPack-install-4.3.5.jar
  2. Install IzPack: java -jar IzPack-install-4.3.5.jar
  3. Generate installer: /usr/local/IzPack/bin/compile ./test.xml
  4. Test installer (Linux): java -jar test.jar
  5. Test installer (Windows): copy test.jarfrom Linux, start cmd, set path=C:\Program Files (x86)\Java\jdk1.6.0_26\binand execute java -jar test.jar
  1. 下载 IzPack-install-4.3.5.jar
  2. 安装 IzPack: java -jar IzPack-install-4.3.5.jar
  3. 生成安装程序: /usr/local/IzPack/bin/compile ./test.xml
  4. 测试安装程序(Linux): java -jar test.jar
  5. 测试安装程序 (Windows):test.jar从 Linux复制、启动cmd、设置path=C:\Program Files (x86)\Java\jdk1.6.0_26\bin和执行java -jar test.jar

回答by TheKaptain

As per the IzPack documentation, are you including the required .dll in the installer? http://izpack.org/documentation/desktop-shortcuts.html

根据 IzPack 文档,您是否在安装程序中包含所需的 .dll? http://izpack.org/documentation/desktop-shortcuts.html

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