Developers, Developers, Developers! Maksim Sorokin IT Blog

30Mar/11Off

Panel for Reading Registry in IzPack 4

The panel called RegistryReaderPanel. It can be used in automated installation (silent installations). However, it can be used only once (can be easily extended). Code depends on IzPack COI tools. So COI tools classes need to be delivered together with the panel. Panel is built using Maven, so COI tools are shaded with Maven Shade Plugin. By default we are reading from HKEY_LOCAL_MACHINE registry root. You have to provide an xml file specifying what you want to read and to which variable to store the read value. Here is an example:

<registryReader>
  <registry key="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\myApp"
      name="DisplayVersion" default="null" variable="myApp.version" />
</registryReader>

You may have several registry entries to read multiple keys. name specifies registry key. variable specifies to which variable to store the value. default specifies what should be a default value, when key was not found.

You will also need to provide COI dlls in install.xml:

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

You will need to separate COI package yourself and add it to your Maven repository.

And here is the panel source:izpackExtensions-registryReader

Comments (0) Trackbacks (1)

Leave a comment