izpack: Create shortcut on windows 7

时光总嘲笑我的痴心妄想 提交于 2019-12-18 09:14:49

问题


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 6bits) 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:

<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>

And this is my install.xml file:

<?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>
  <natives>
    <native type="izpack" name="ShellLink_x64.dll"/>
</natives>
</installation>

But i can't display the shortcut panel in my installer ... !


回答1:


I compared this to a working installer file here which in contrast contains the following <natives> setting:

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

When using a 32-Bit Java Runtime the 32-Bit ShellLink.dll will be used which is missing in your setup.




回答2:


Unfortunately there are a few known issues with ShortcutPanel. After extensive trial-and-error testing I have found that the following requirements have to be satisfied in order for it to display correctly:

  • The <lateShortcutInstall/> tag in the shorctuts XML file must only be present if you want to show ShortcutPanel before InstallPanel. If your ShortcutPanel comes after the installation step, your shurtcut panel will not be shown!

  • Your <native> tags must be enclosed within a <natives> tag,

  • Add the <skipIfNotSupported /> tag to the beginning of the <shortcuts> element,

  • Double check your shortcuts XML file as it may have incorrect attribute names and/or missing quotes. Many users have reported such issues and it may be that there is an incorrect website that a lot of people copy-paste from. The specification for shortcut attributes can be found here.

  • Check whether the native DLLs are packaged into the installer JAR. For the ShellLink DLLs unpack the JAR and look inside: com/izforge/izpack/bin/native (and NOT com/izforge/izpack/bin/native/izpack/)1,

  • And finally, this is a bit trivial, but check whether your shortcuts XML file is where you think it is and that it has the correct name.


Footnotes:

  1. I am using IzPack version 5.0.6.


来源:https://stackoverflow.com/questions/33419830/izpack-create-shortcut-on-windows-7

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!