简体   繁体   中英

How do I get IzPack to add my program to the Windows Registry?

I understand this question has been asked before, however the "solutions" offered there and in the IzPack documentation do not actually work. Furthermore I do not have the reputation on this website to comment or anything on other questions or solutions, so I'm forced to just ask this again. I have a working installer that can add shortcuts and I have followed numerous examples to look for my error to no avail. IzPack is a poorly documented and squirrely beast.

Everything works, the program is placed in the correct directory and start menu group and I can run it. The only part not happening at this point is the Registry edit.

I did learn when getting the shortcut panel to work that you have to manually add the Shelllink Dlls to your %JAVA_HOME%\\bin directory. Since this isn't explicitly stated in the documentation and the files aren't included with the IzPack install, I assume it is not supposed to be needed, but that was the only way I finally got it to work. I added the COIOSHelper Dlls to the same locations but that did not change anything. I suspect it has to do with actually having the Dlls included into the final jar installer, but there is no documentation on how to ensure that happens correctly.

install.xml

<installation version="1.0">

  <info>
    <appname>MyApp</appname>
    <appversion>1.0.0</appversion>
    <appsubpath>MyApp</appsubpath>
    <javaversion>1.7</javaversion>
  <authors>
    <author name="ME" email="support@me.com"/>
  </authors>
  <url>http://www.me.com</url>
  <run-privileged/>
  </info>

  <guiprefs resizable="no" width="480" height="360">
    <laf name="looks">
      <param name="variant" value="windows" />
      <os family="windows" />
    </laf>
  </guiprefs>

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

  <resources>
    <res id="shortcutSpec.xml" src="shortcutSpec.xml"/>
    <res src="MyApp.ico" id="MyApp.ico"/>  
    <res src="MyLicense.txt" id="LicencePanel.licence"/>  

  </resources>

  <natives>
    <native type="izpack" name="ShellLink.dll"/>
    <native type="izpack" name="ShellLink_x64.dll"/>
    <native type="3rdparty" name="COIOSHelper.dll" stage="both">
      <os family="windows"/>
    </native>
    <native type="3rdparty" name="COIOSHelper_x64.dll" stage="both">
      <os family="windows"/>
    </native>
  </natives>

  <listeners>
    <listener classname="RegistryInstallerListener" stage="install"/>
    <listener classname="RegistryUninstallerListener" stage="uninstall"/>
  </listeners>

  <panels>
    <panel classname="CheckedHelloPanel" />
    <panel classname="LicencePanel" />
    <panel classname="TargetPanel" />
    <panel classname="InstallPanel" />
    <panel classname="ShortcutPanel" id="shortcutpanel" />
    <panel classname="SimpleFinishPanel" />
  </panels>

  <packs>
    <pack name="Core" required="yes" preselected="yes">
      <description>The core files needed for correct operation of the MyApp Application</description>
      <file src="myapp-1.0.0.jar" targetdir="$INSTALL_PATH"/>
      <file src="MyApp.ico" targetdir="$INSTALL_PATH\images"/>
    </pack>
  </packs>


</installation>

Where did you get the COIOSHelper DLLs? Those don't seem to be included in my IzPack installation. I didn't have to do anything for the ShellLink DLLs, they're just there and work. Also of note, I've found that my "native" entries for the ShellLink DLLs can't be inside the "natives" tag. If I put them there the installer breaks. They have to be right under the "installation" tag.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM