<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Developers, Developers, Developers! &#187; IzPack</title>
	<atom:link href="http://maksim.sorokin.dk/it/tag/izpack/feed/" rel="self" type="application/rss+xml" />
	<link>http://maksim.sorokin.dk/it</link>
	<description>Maksim Sorokin IT Blog</description>
	<lastBuildDate>Sun, 05 Feb 2012 19:37:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.3</generator>
		<item>
		<title>IzPack: Installing Only When Version Was Changed</title>
		<link>http://maksim.sorokin.dk/it/2011/04/08/izpack-installing-only-when-version-was-changed/</link>
		<comments>http://maksim.sorokin.dk/it/2011/04/08/izpack-installing-only-when-version-was-changed/#comments</comments>
		<pubDate>Fri, 08 Apr 2011 19:56:50 +0000</pubDate>
		<dc:creator>Maksim Sorokin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[IzPack]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[registry]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://maksim.sorokin.dk/it/?p=694</guid>
		<description><![CDATA[This post describes a concept of updating a product only when a Maven version of it was changed. Assume you have a product A, installable by IzPack and built by Maven. When you install product A, you may use RegistryInstallerListener to add entry to the registry. In RegistrySpec.xml (where you provide target key where to [...]]]></description>
			<content:encoded><![CDATA[<p>This post describes a concept of updating a product only when a Maven version of it was changed.</p>
<p>Assume you have a product A, installable by IzPack and built by Maven. When you install product A, you may use <a href="http://izpack.org/documentation/custom-actions.html#registry-access-installerlistener-and-uninstallerlistener">RegistryInstallerListener</a> to add entry to the registry. In <code>RegistrySpec.xml</code> (where you provide target key where to store information) you use Maven <code>${project.version}</code> property. Therefore, when  the product A will be installed, the Maven version will be stored in the Registry. Next time you install product A you use read that entry from a registry (<a href="http://maksim.sorokin.dk/it/2011/03/30/panel-for-reading-registry-in-izpack-4/">here</a> I describe how to do that in IzPack 4. This is out-of-the-box in IzPack 5) and then compare the Maven versions (you may use <a href="http://maksim.sorokin.dk/it/2011/04/03/comparing-maven-string-versions/">this post information</a> to create a Maven panel) and determine, whereas to install/update a product.</p>
<p>Product A may also be independent installer, launched from another installer. For instance, if product A installer requires administrative rights, and it is included from product B, which doesn' require administrative right, you would like to avoid UAC as much as possible. So from product B you can check version of product A and determine, whereas you need to launch it.</p>
]]></content:encoded>
			<wfw:commentRss>http://maksim.sorokin.dk/it/2011/04/08/izpack-installing-only-when-version-was-changed/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Building IzPack installers on the fly</title>
		<link>http://maksim.sorokin.dk/it/2011/03/31/building-izpack-installers-on-the-fly/</link>
		<comments>http://maksim.sorokin.dk/it/2011/03/31/building-izpack-installers-on-the-fly/#comments</comments>
		<pubDate>Thu, 31 Mar 2011 16:59:24 +0000</pubDate>
		<dc:creator>Maksim Sorokin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[installers]]></category>
		<category><![CDATA[IzPack]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://maksim.sorokin.dk/it/?p=685</guid>
		<description><![CDATA[One can grab ideas on how to build IzPack installers on the fly from izpack-maven-plugin. You will of course need to depend on IzPack standalone compiler. Basically, what do you need to do is to have some directory for staging. This is useful, when you want to run some filtering or putting some additional resources [...]]]></description>
			<content:encoded><![CDATA[<p>One can grab ideas on how to build IzPack installers on the fly from <a href="http://izpack.codehaus.org/izpack-maven-plugin/">izpack-maven-plugin</a>.</p>
<p>You will of course need to depend on IzPack standalone compiler.</p>
<p>Basically, what do you need to do is to have some directory for staging. This is useful, when you want to run some filtering or putting some additional resources from somewhere else to the installer. You can use %TEMP% directory (<code>File.createTempFile(...)</code>) for that. Do not forget to wipe it afterwards!<br />
When you have all your installer resources in some staging directory and you know the direct path to your <code>install.xml</code> you are ready to build a installer:</p>
<pre class="brush: java; title: ;">
CompilerConfig compilerConfig = new CompilerConfig(installXmlPath, stagingDirPath, null, targetFilePath);
compilerConfig.executeCompiler();
</pre>
]]></content:encoded>
			<wfw:commentRss>http://maksim.sorokin.dk/it/2011/03/31/building-izpack-installers-on-the-fly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Panel for Reading Registry in IzPack 4</title>
		<link>http://maksim.sorokin.dk/it/2011/03/30/panel-for-reading-registry-in-izpack-4/</link>
		<comments>http://maksim.sorokin.dk/it/2011/03/30/panel-for-reading-registry-in-izpack-4/#comments</comments>
		<pubDate>Wed, 30 Mar 2011 16:46:00 +0000</pubDate>
		<dc:creator>Maksim Sorokin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[IzPack]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[registry]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://maksim.sorokin.dk/it/?p=689</guid>
		<description><![CDATA[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 [...]]]></description>
			<content:encoded><![CDATA[<p>The panel called <code>RegistryReaderPanel</code>. 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 <a href="http://maven.apache.org/plugins/maven-shade-plugin/">Maven Shade Plugin</a>. 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:</p>
<pre class="brush: xml; title: ;">
&lt;registryReader&gt;
  &lt;registry key=&quot;SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\myApp&quot;
      name=&quot;DisplayVersion&quot; default=&quot;null&quot; variable=&quot;myApp.version&quot; /&gt;
&lt;/registryReader&gt;
</pre>
<p>You may have several <code>registry</code> entries to read multiple keys. <code>name</code> specifies registry key. <code>variable</code> specifies to which variable to store the value. <code>default</code> specifies what should be a default value, when key was not found.</p>
<p>You will also need to provide COI dlls in <code>install.xml</code>:</p>
<pre class="brush: xml; title: ;">
&lt;native type=&quot;3rdparty&quot; name=&quot;COIOSHelper.dll&quot; stage=&quot;both&quot;&gt;
  &lt;os family=&quot;windows&quot; /&gt;
&lt;/native&gt;
&lt;native type=&quot;3rdparty&quot; name=&quot;COIOSHelper_x64.dll&quot; stage=&quot;both&quot;&gt;
  &lt;os family=&quot;windows&quot; /&gt;
&lt;/native&gt;
</pre>
<p>You will need to separate COI package yourself and add it to your Maven repository.</p>
<p>And here is the panel source:<a href="http://maksim.sorokin.dk/it/wp-content/uploads/2011/03/izpackExtensions-registryReader.zip">izpackExtensions-registryReader</a></p>
]]></content:encoded>
			<wfw:commentRss>http://maksim.sorokin.dk/it/2011/03/30/panel-for-reading-registry-in-izpack-4/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>IzPack. Adding 64bit support.</title>
		<link>http://maksim.sorokin.dk/it/2011/03/24/izpack-adding-64bit-support/</link>
		<comments>http://maksim.sorokin.dk/it/2011/03/24/izpack-adding-64bit-support/#comments</comments>
		<pubDate>Thu, 24 Mar 2011 16:17:48 +0000</pubDate>
		<dc:creator>Maksim Sorokin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[64bit]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[IzPack]]></category>
		<category><![CDATA[registry]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://maksim.sorokin.dk/it/?p=676</guid>
		<description><![CDATA[IzPack should work everywhere. However, you have to be aware about several things if you have support for 64bit machines. First, if you are using COI tools from IzPack (for example if you have your own custom panel that works with registry or using CheckedHelloPanel) you also have to deliver 64bit dll: &#60;native type=&#34;3rdparty&#34; name=&#34;COIOSHelper.dll&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>IzPack should work everywhere. However, you have to be aware about several things if you have support for 64bit machines.</p>
<p>First, if you are using COI tools from IzPack (for example if you have your <a href="http://maksim.sorokin.dk/it/2011/03/11/izpack-panels-things-you-have-to-know-when-developing-registry-panels/">own custom panel that works with registry</a> or using <a href="http://izpack.org/documentation/panels.html#checkedhellopanel">CheckedHelloPanel</a>) you also have to deliver 64bit dll:</p>
<pre class="brush: xml; title: ;">
  &lt;native type=&quot;3rdparty&quot; name=&quot;COIOSHelper.dll&quot; stage=&quot;both&quot;&gt;
    &lt;os family=&quot;windows&quot; /&gt;
  &lt;/native&gt;
  &lt;native type=&quot;3rdparty&quot; name=&quot;COIOSHelper_x64.dll&quot; stage=&quot;both&quot;&gt;
    &lt;os family=&quot;windows&quot; /&gt;
  &lt;/native&gt;
</pre>
<p>The second thing, if you are using <a href="http://izpack.org/documentation/panels.html#shortcutpanel">ShortcutPanel</a>, you will also have to deliver 64bit dlls:</p>
<pre class="brush: xml; title: ;">
  &lt;native type=&quot;izpack&quot; name=&quot;ShellLink.dll&quot;&gt;
    &lt;os family=&quot;windows&quot; /&gt;
  &lt;/native&gt;
  &lt;native type=&quot;izpack&quot; name=&quot;ShellLink_x64.dll&quot;&gt;
    &lt;os family=&quot;windows&quot; /&gt;
  &lt;/native&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://maksim.sorokin.dk/it/2011/03/24/izpack-adding-64bit-support/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Custom IzPack Panels. Necessary Changes for Silent Installation.</title>
		<link>http://maksim.sorokin.dk/it/2011/03/17/custom-izpack-panels-necessary-changes-for-silent-installation/</link>
		<comments>http://maksim.sorokin.dk/it/2011/03/17/custom-izpack-panels-necessary-changes-for-silent-installation/#comments</comments>
		<pubDate>Thu, 17 Mar 2011 11:59:11 +0000</pubDate>
		<dc:creator>Maksim Sorokin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[custom panels]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[IzPack]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[silent installation]]></category>

		<guid isPermaLink="false">http://maksim.sorokin.dk/it/?p=672</guid>
		<description><![CDATA[Here I described how to develop and debug your own custom panel. However, in order to have it work with automated installers (aka silent installation) we need to add some changes. You will need to add AutomationHelper class. Here is how you can do it. Assuming you have custom panel with a name MyPanel, create [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://maksim.sorokin.dk/it/2011/02/28/developing-and-debugging-izpack-panels-in-eclipse/">Here</a> I described how to develop and debug your own custom panel. However, in order to have it work with <a href="http://izpack.org/documentation/advanced-features.html#automated-installers">automated installers (aka silent installation)</a> we need to add some changes.</p>
<p>You will need to add <code>AutomationHelper</code> class. Here is how you can do it. Assuming you have custom panel with a name <code>MyPanel</code>, create class <code>MyPanelAutomationHelper</code> in the same package. This class has to extend <code>PanelAutomationHelper</code> and implement <code>PanelAutomation</code>. And then you will have to specify how to run the panel silently.<br />
Basically, you can just repeat all the routine from <code>panelActivate</code> method in <code>MyPanel</code> panel (or if you do not want to repeat yourself, invoke/call <code>MyPanel</code> smartly). But you cannot use UI stuff like <code>emitWarning</code> or <code>emitError</code>. If you need to inform user about something -- write it directly to the output. Silent installer should be silent. </p>
<p>Here is <code>AutomationHelper</code> class for <code>MyPanel</code> panel, which we developed previously:</p>
<pre class="brush: java; title: ;">
package com.izforge.izpack.panels;

import java.util.List;

import com.coi.tools.os.win.MSWinConstants;
import com.izforge.izpack.adaptator.IXMLElement;
import com.izforge.izpack.installer.AutomatedInstallData;
import com.izforge.izpack.installer.InstallerException;
import com.izforge.izpack.installer.PanelAutomation;
import com.izforge.izpack.installer.PanelAutomationHelper;

public class MyPanelAutomationHelper extends PanelAutomationHelper implements PanelAutomation {

  @Override
  public void makeXMLData(AutomatedInstallData installData, IXMLElement panelRoot) {
    //
  }

  @Override
  public void runAutomated(AutomatedInstallData installData, IXMLElement panelRoot) throws InstallerException {
    System.out.println(&quot;Hello, IzPack&quot;);
  }
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://maksim.sorokin.dk/it/2011/03/17/custom-izpack-panels-necessary-changes-for-silent-installation/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>IzPack Panels: Things You Have to Know When Developing Registry Panels</title>
		<link>http://maksim.sorokin.dk/it/2011/03/11/izpack-panels-things-you-have-to-know-when-developing-registry-panels/</link>
		<comments>http://maksim.sorokin.dk/it/2011/03/11/izpack-panels-things-you-have-to-know-when-developing-registry-panels/#comments</comments>
		<pubDate>Fri, 11 Mar 2011 16:35:48 +0000</pubDate>
		<dc:creator>Maksim Sorokin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dll]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[IzPack]]></category>
		<category><![CDATA[registry]]></category>
		<category><![CDATA[Windows registry]]></category>

		<guid isPermaLink="false">http://maksim.sorokin.dk/it/?p=649</guid>
		<description><![CDATA[There are certain things one has to know when developing panels that interact with registry. CheckedHelloPanel is an example of interaction with a registry. If you decide to go that way, you will need to do some additional things too besides writing the code. First of all, you will need to define a COIOSHelper.dll in [...]]]></description>
			<content:encoded><![CDATA[<p>There are certain things one has to know when developing panels that interact with registry. </p>
<p><a href="http://izpack.org/documentation/panels.html#checkedhellopanel">CheckedHelloPanel</a> is an example of interaction with a registry. If you decide to go that way, you will need to do some additional things too besides writing the code. </p>
<p>First of all, you will need to define a <code>COIOSHelper.dll</code> in your <code>install.xml</code>:</p>
<pre class="brush: xml; title: ;">
&lt;native type=&quot;3rdparty&quot; name=&quot;COIOSHelper.dll&quot; stage=&quot;both&quot;&gt;
  &lt;os family=&quot;windows&quot;/&gt;
&lt;/native&gt;
</pre>
<p>The second thing is that if you take a look into <code>CheckedHelloPanel</code> code, you will see, that it also uses some <code>com.coi.tools</code> code. You will need to include that into your panel jar too.<br />
Here is the way how we do it. First, we took this <code>com.coi.tools</code> and put it to our maven repository. For each our custom IzPack panel we have a separate maven module nesting some common parent routine (I have already <a href="http://maksim.sorokin.dk/it/2011/03/02/izpack-adding-custom-panels-without-rebuilding-standalone-compiler/">described it in one of the previous posts</a>. Then during <code>package</code> phase of our custom panel code we use <a href="http://maven.apache.org/plugins/maven-shade-plugin/">Maven Shade Plugin</a> to combine sources of <code>com.coi.tools</code> and our panel code.</p>
<p>The third thing deals with development cycle. If you develop your own custom panel to work with registry using the way <a href="http://maksim.sorokin.dk/it/2011/02/28/developing-and-debugging-izpack-panels-in-eclipse/">, you will need to place dlls inside "izpack" project.<br />
Create <code>src\native</code> folder and copy dlls from <code>bin\native</code> directory in IzPack installation. Then you could use them inside <code>install.xml</code>:</p>
<pre class="brush: xml; title: ;">
&lt;native type=&quot;3rdparty&quot; name=&quot;COIOSHelper.dll&quot; stage=&quot;both&quot;&gt;
  &lt;os family=&quot;windows&quot;/&gt;
&lt;/native&gt;
</pre>
<p>This is because <code>com.izforge.izpack.util.Librarian</code> in IzPack has to know where to find the dlls. Since we import only the sources to Eclipse, dlls are not imported, so we have to do that manualy.</p>
]]></content:encoded>
			<wfw:commentRss>http://maksim.sorokin.dk/it/2011/03/11/izpack-panels-things-you-have-to-know-when-developing-registry-panels/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Silent Panels in IzPack</title>
		<link>http://maksim.sorokin.dk/it/2011/03/09/silent-panels-in-izpack/</link>
		<comments>http://maksim.sorokin.dk/it/2011/03/09/silent-panels-in-izpack/#comments</comments>
		<pubDate>Wed, 09 Mar 2011 16:13:51 +0000</pubDate>
		<dc:creator>Maksim Sorokin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[IzPack]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://maksim.sorokin.dk/it/?p=658</guid>
		<description><![CDATA[In your custom IzPack panel you may want to do some routine silently. In this case you would need just to skip your panel: @Override public void panelActivate() { ... parent.skipPanel(); }]]></description>
			<content:encoded><![CDATA[<p>In your custom IzPack panel you may want to do some routine silently. In this case you would need just to skip your panel:</p>
<pre class="brush: java; title: ;">
  @Override
  public void panelActivate() {
    ...
    parent.skipPanel();
  }
</pre>
]]></content:encoded>
			<wfw:commentRss>http://maksim.sorokin.dk/it/2011/03/09/silent-panels-in-izpack/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IzPack: Adding Custom Panels without Rebuilding Standalone Compiler</title>
		<link>http://maksim.sorokin.dk/it/2011/03/02/izpack-adding-custom-panels-without-rebuilding-standalone-compiler/</link>
		<comments>http://maksim.sorokin.dk/it/2011/03/02/izpack-adding-custom-panels-without-rebuilding-standalone-compiler/#comments</comments>
		<pubDate>Wed, 02 Mar 2011 16:44:14 +0000</pubDate>
		<dc:creator>Maksim Sorokin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[Continuous Integration]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[IzPack]]></category>
		<category><![CDATA[maven]]></category>

		<guid isPermaLink="false">http://maksim.sorokin.dk/it/?p=655</guid>
		<description><![CDATA[On FAQ page of izpack-maven-plugin there is a link on how to include own custom panels without rebuilding standalone compiler. I will describe our own approach. We have a specific Maven project for IzPack extensions. For every custom panel we have a child module. Basically, each child module is just a plain Java project with [...]]]></description>
			<content:encoded><![CDATA[<p>On <a href="http://izpack.codehaus.org/izpack-maven-plugin/faq.html">FAQ page of izpack-maven-plugin</a> there is a link on how to include own custom panels without rebuilding standalone compiler. I will describe our own approach.</p>
<p>We have a specific Maven project for IzPack extensions. For every custom panel we have a child module. Basically, each child module is just a plain Java project with required IzPack structure.</p>
<p>We have a special Maven parent project for all our installers. This parent defines 3 steps to build IzPack installer in <code>pluginManagement</code> section:</p>
<ul>
<li>Copy all dependencies to specific folder defined by child installers. Then we will pick up these dumped files in <code>install.xml</code> file. It is used to dump our own product, third party stuff and our own custom panels, which are referenced from dependency section in <code>pom.xml</code></li>
<li>Filtering step. We run filtering through all IzPack files to automatically replace version, name, path to files (fx dumped in previous step) in <code>install.xml</code> and all other resources. Filtered files are copied to specific staging directory. We use <a href="http://maven.apache.org/plugins/maven-resources-plugin/">Maven resources plugin</a> for that purpose.</li>
<li>The last step defines the routine to build IzPack installation</li>
</ul>
<p>All child projects have to do is to inherit these plugins from parent.</p>
<p>As I said, our custom panels are ordinary Maven projects. In each installer in dependency section in <code>pom.xml</code> we add a reference to custom panel project. As I described above, all jars are dumped in specific folder and we just have to pick them in our <code>install.xml</code>:</p>
<pre class="brush: xml; title: ;">
&lt;panel classname=&quot;MyPanel&quot; jar=&quot;${dependencies.dir}/izpackExtensions-myPanel-${izpackExtensions.version}.jar&quot; /&gt;
</pre>
<p>Where <code>dependencies.dir</code> and <code>izpackExtensions.version</code> are ordinary Maven variables which are substituted during filtering step.</p>
]]></content:encoded>
			<wfw:commentRss>http://maksim.sorokin.dk/it/2011/03/02/izpack-adding-custom-panels-without-rebuilding-standalone-compiler/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Reading XML File in Custom IzPack Panel</title>
		<link>http://maksim.sorokin.dk/it/2011/03/01/reading-xml-file-in-custom-izpack-panel/</link>
		<comments>http://maksim.sorokin.dk/it/2011/03/01/reading-xml-file-in-custom-izpack-panel/#comments</comments>
		<pubDate>Tue, 01 Mar 2011 13:52:20 +0000</pubDate>
		<dc:creator>Maksim Sorokin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[IzPack]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://maksim.sorokin.dk/it/?p=647</guid>
		<description><![CDATA[Sometimes it is needed to have some configuration file in your custom IzPack panels. It is easy to have one! First, you have to reference your configuration file from resources section in install.xml file: &#60;resources&#62; &#60;res id=&#34;mySpec.xml&#34; src=&#34;mySpec.xml&#34; /&#62; &#60;/resources&#62; Then you would need to create such file in your IzPack resources. And then you [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes it is needed to have some configuration file in your custom IzPack panels. It is easy to have one!</p>
<p>First, you have to reference your configuration file from <code>resources</code> section in <code>install.xml</code> file:</p>
<pre class="brush: xml; title: ;">
&lt;resources&gt;
  &lt;res id=&quot;mySpec.xml&quot; src=&quot;mySpec.xml&quot; /&gt;
&lt;/resources&gt;
</pre>
<p>Then you would need to <span id="more-647"></span>create such file in your IzPack resources.</p>
<p>And then you can read your file from your custom panel:</p>
<pre class="brush: java; title: ;">
@Override
public void panelActivate() {
  InputStream is = ResourceManager.getInstance().getInputStream(&quot;mySpec.xml&quot;);
...
</pre>
<p>Moreover, you can read xml using IzPack capabilities. Not that convenient, but anyway:</p>
<pre class="brush: java; title: ;">
    String xml = inputStreamToString(is);    // I omit this peace of code, since it is not relevant. &quot;is&quot; -- is InputStream

    IXMLParser parser = new XMLParser();
    IXMLElement rootEl = parser.parse(xml);

    Vector&lt;IXMLElement&gt; els = rootEl.getChildrenNamed(&quot;myElements&quot;);
    Iterator&lt;IXMLElement&gt; it = els.iterator();
    while (it.hasNext()) {
      IXMLElement el = it.next();

      String myAttribute = el.getAttribute(&quot;myAttribute&quot;);
      ...
</pre>
]]></content:encoded>
			<wfw:commentRss>http://maksim.sorokin.dk/it/2011/03/01/reading-xml-file-in-custom-izpack-panel/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Developing and debugging IzPack panels in Eclipse</title>
		<link>http://maksim.sorokin.dk/it/2011/02/28/developing-and-debugging-izpack-panels-in-eclipse/</link>
		<comments>http://maksim.sorokin.dk/it/2011/02/28/developing-and-debugging-izpack-panels-in-eclipse/#comments</comments>
		<pubDate>Mon, 28 Feb 2011 14:50:19 +0000</pubDate>
		<dc:creator>Maksim Sorokin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[IzPack]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://maksim.sorokin.dk/it/?p=641</guid>
		<description><![CDATA[Here I will describe how one can develop and debug own IzPack panels using Eclipse. First go and download IzPack. We will use 4.3.3 vesion here. After installation you will find source directory src\lib in installation location. Import it into Eclipse. Or create a Java project in Eclipse and copy sources afterwards. Obviously, project has [...]]]></description>
			<content:encoded><![CDATA[<p>Here I will describe how one can develop and debug own IzPack panels using Eclipse.</p>
<p>First go and <a href="http://izpack.org/downloads/">download IzPack</a>. We will use 4.3.3 vesion here.<br />
After installation you will find source directory <code>src\lib</code> in installation location. Import it into Eclipse. Or create a Java project in Eclipse and copy sources afterwards. Obviously, project has some dependencies, so in Java Build Path add all external jars from IzPack installation folder <code>lib</code>. Now you should not have any errors. IzPack code is now browsable.</p>
<p>You can have a<span id="more-641"></span> maven project for your custom IzPack panels. It is straight forward creation of Maven project, so I will omit it here. I will just assume, that you have a Java project for your panel.</p>
<p>Link you Java project to IzPack libraries, which are located in <code>lib</code> folder of IzPack installation. Please note, that you should not link to imported IzPack project in your Eclipse, because we will need it later on for debugging the panel -- in this case you would have cyclic dependency. Do that in project properties Java Build Path. </p>
<p>According to <a href="http://izpack.org/documentation/creating-panels.html">documentation</a>, panels classes have to be created in <code>com.izforge.izpack.panels</code>. In your project create a package with that name. Now in that package create class <code>MyPanel</code>:</p>
<pre class="brush: java; title: ;">
package com.izforge.izpack.panels;

import com.izforge.izpack.installer.InstallData;
import com.izforge.izpack.installer.InstallerFrame;
import com.izforge.izpack.installer.IzPanel;

public class MyPanel extends IzPanel {

  private static final long serialVersionUID = -2686831922771063920L;

  public MyPanel(InstallerFrame parent, InstallData idata) {
    super(parent, idata);
  }

  @Override
  public void panelActivate() {
    System.out.println(&quot;Hello, IzPack&quot;);
  }
}
</pre>
<p>Let's create a test IzPack installation, which would use our new panel. Basically, just create "install.xml" file in any folder. I will do that in <code>c:\projects\test25\src\main\resources</code>. Here are the internals of <code>install.xml</code>:</p>
<pre class="brush: xml; title: ;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;

&lt;installation version=&quot;1.0&quot;&gt;

  &lt;info&gt;
    &lt;appname&gt;Test 25&lt;/appname&gt;
    &lt;appversion&gt;1.0&lt;/appversion&gt;
    &lt;uninstaller write=&quot;no&quot; /&gt;
    &lt;javaversion&gt;1.6&lt;/javaversion&gt;

    &lt;pack200 /&gt;
  &lt;/info&gt;

  &lt;guiprefs resizable=&quot;yes&quot; width=&quot;500&quot; height=&quot;340&quot;&gt;
    &lt;modifier key=&quot;allXGap&quot; value=&quot;5&quot; /&gt;
    &lt;modifier key=&quot;allYGap&quot; value=&quot;5&quot; /&gt;
    &lt;modifier key=&quot;paragraphYGap&quot; value=&quot;15&quot; /&gt;
    &lt;modifier key=&quot;useHeadingPanel&quot; value=&quot;yes&quot; /&gt;
    &lt;modifier key=&quot;headingLineCount&quot; value=&quot;1&quot; /&gt;
    &lt;modifier key=&quot;headingFontSize&quot; value=&quot;2&quot; /&gt;
    &lt;modifier key=&quot;headingBackgroundColor&quot; value=&quot;0x00ffffff&quot; /&gt;
    &lt;modifier key=&quot;headingPanelCounter&quot; value=&quot;text&quot; /&gt;
    &lt;modifier key=&quot;headingPanelCounterPos&quot; value=&quot;inHeading&quot; /&gt;
  &lt;/guiprefs&gt;

  &lt;locale&gt;
    &lt;langpack iso3=&quot;eng&quot; /&gt;
  &lt;/locale&gt;

  &lt;panels&gt;
    &lt;panel classname=&quot;MyPanel&quot; /&gt;
    &lt;panel classname=&quot;SimpleFinishPanel&quot; /&gt;
  &lt;/panels&gt;

  &lt;packs&gt;
    &lt;pack name=&quot;main&quot; required=&quot;yes&quot;&gt;
      &lt;description&gt;Test 25 Installation&lt;/description&gt;
    &lt;/pack&gt;
  &lt;/packs&gt;

&lt;/installation&gt;
</pre>
<p>Now, here is the development flow. You modify the panel code. Then you run IzPack compiler from Eclipse and IzPack installer, also from Eclipse. Just two button clicks!</p>
<p>Here is how you configure it. Navigate to <code>com.izforge.izpack.compiler.Compiler</code> class in imported IzPack project in Eclipse. In menu choose "Run-&gt;Profile Configurations..". In "Java Application" on the left create new application entry. In "Main" tab in "Project" choose "izpack" in Main class choose "com.izforge.izpack.compiler.Compiler". In "Arguments" tab write "<code>c:\projects\test25\src\main\resources\install.xml -b c:\projects\test25\src\main\resources -o c:\projects\test25\target\out -h "c:/Program Files/Izpack-4.3.3"</code>", where you specify path to <code>install.xml</code>, where installer jar will be outputed and home path to IzPack installation.</p>
<p>Now, all we need is to tell IzPack, which installer we want to debug. In "Compiler" run configuration we specified the output of Compiler. Right-click "izpack" project and in Build Path specify that jar (which you specified in <code>-o</code> option).</p>
<p>Now you can simply call main class <code>com.izforge.izpack.installer</code>. GUI installer will be launched and you will be able to see all the output in the console. You can run in Debug mode as well.</p>
<p>So again, first modify the code. Then run <code>Compiler</code> and then run <code>Installer</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://maksim.sorokin.dk/it/2011/02/28/developing-and-debugging-izpack-panels-in-eclipse/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

