[izpack-users] Automated installation with custom panels

Bartz, Klaus Klaus.Bartz at coi.de
Fri Jul 7 09:53:49 CEST 2006


Hi Chris,
you use a wrong signature:
there is no call of 
LicenseCheckPanel.makeInstallData(AutomatedInstallData,xmlElement),
therefore no debug output, no "licenseKey".

You use a wrong signature of the method.
In the derived class of IzPanel the signature should be:

public void makeXMLData(XMLElement panelRoot);

You use the signature from the interface PanelAutomation

public void makeXMLData(AutomatedInstallData installData, XMLElement panelRoot);

Little bit confusing, I know...

I do not konw whether there are more problems or not. One point can be that
that the naming convention for AutomationHelper are strong (seems you use 
the right name). Additional the AutomationHelper class has to be in the
jar file of the panel (see e.g. TargetPanel.jar).

At problems you can (in opposite to other java based installer :-))
debug. In the docu there is a discription how to debug the different
states of an installation in eclipse (packaging, installation and
uninstallation). There are some little pitfalls like the position of 
included install.jar...
If needed, I have also a description how to debug
native code (but only in german and only for MS visual studio 6.0 on
Windows). 

If automated install not work, initialize a debug session with the
flags for automated install, set a breakpoint in 
AutomatedInstaller.doInstall()
and look what happens...
If data will be not created, the right place for a breakpoint is
InstallerFrame.writeXMLTree (called at end of install if FinishPanel
is used, not with SimpleFinishPanel).

happy installing

Klaus




>-----Original Message-----
>From: izpack-users-admin at berlios.de
>[mailto:izpack-users-admin at berlios.de]On Behalf Of cmcclain
>Sent: Thursday, July 06, 2006 10:48 PM
>To: izpack-users at lists.berlios.de
>Subject: [izpack-users] Automated installation with custom panels
>
>
>
>Greetings,
>
>  As a brief introduction, I am a software engineer with 
>Enterasys Networks
>working on migrating our application's existing installation 
>process from
>InstallAnywhere to IZPack.  As part of that process, I have implemented
>several custom panels to handle such things as a checkbox panel to
>selectively enable services and a license check panel that 
>validates whether
>a user is authorized to install our application.  For the most 
>part, adding
>these custom panels has been fairly easy and has functioned as 
>expected.
>
>  Now, however, I am attempting to use the Automated Installation
>functionality and am unable to get my custom panels to export the
>appropriate data to the XML file.  Using my LicenseCheckPanel 
>and IZPack's
>TargetPanel source code as an example, I added a public void 
>makeXMLData
>method to my LicenseCheckPanel that forwards the 
>AutomatedInstallData and
>XMLElement objects to a helper class called
>LicenseCheckPanelAutomationHelper.  This class implements the
>PanelAutomation interface and its makeXMLData method contains 
>code which is
>supposed to add a sub-element to the LicenseCheckPanel's node 
>in the XML
>file.
>
>  Unfortunately it doesn't seem like the makeXMLData method in my
>LicenseCheckPanel is ever called.  The exported XML file 
>contains an element
>for the panel, but the sub-element called "licenseKey" is not 
>present nor do
>I see any of my debug output from my makeXMLData method in the 
>install log. 
>So, my question is largely what steps do I need to follow to 
>make sure my
>data gets exported to the XML file?  I have noticed that some 
>of the IZPack
>classes differ in their implementations for makeXMLData, so perhaps the
>method I have chosen is not correct.  In any event, the relevant code
>segments follow and any help is greatly appreciated.
>
>Thank you,
>
>- Chris
>
>From LicenseCheckPanel.java
>
>    public void makeXMLData(AutomatedInstallData idata, XMLElement
>panelRoot)
>    {
>         System.out.println("makeXMLData stdout called");
>         System.err.println("makeXMLData stderr called");
>         new LicenseCheckPanelAutomationHelper().makeXMLData(idata,
>panelRoot);
>    }
>
>From LicenseCheckPanelAutomationHelper.java
>    public void makeXMLData(AutomatedInstallData idata, XMLElement
>panelRoot)
>    {
>        String     licKey  = 
>idata.getVariable("MACROVISION_LICENSE_KEY");
>        String     licType = idata.getVariable("LICENSE_TYPE");
>        XMLElement element = new XMLElement("licenseKey");
>        XMLElement old     = 
>panelRoot.getFirstChildNamed("licenseKey");
>
>        if (old != null)
>            panelRoot.removeChild(old);
> 
>        element.setAttribute("key", licKey);
>        element.setAttribute("type", licType);
>        panelRoot.addChild(element);
>    }
>
>From auto-install.xml: Note that there is a LicenseCheckPanel 
>element, but
>no "licenseKey" child element
><AutomatedInstallation langpack="eng">
>    <com.izforge.izpack.panels.ConsoleHelloPanel/>
>    <com.izforge.izpack.panels.LicencePanel/>
>    <com.izforge.izpack.panels.LicenseCheckPanel/>
>    <com.izforge.izpack.panels.TargetPanel>
>        <installpath>/export/local/NetSight</installpath>
>    </com.izforge.izpack.panels.TargetPanel>
>    <com.izforge.izpack.panels.PacksPanel>
>        <selected>
>            <pack index="0"/>
>            <pack index="1"/>
>        </selected>
>    </com.izforge.izpack.panels.PacksPanel>
>    <com.izforge.izpack.panels.ServicesPanel/>
>    <com.izforge.izpack.panels.InstallPanel/>
>    <com.izforge.izpack.panels.ConsoleProcessPanel/>
>    <com.izforge.izpack.panels.ShortcutPanel>
>        <programGroup name="New Enterasys Networks\NetSight Console"/>
>        <shortcut name="Console Client" initialState="1" commandLine=""
>workingDirectory="/export/local/NetSight/clients/Console/"
>target="/export/local/NetSight/clients/Console/console.exe" type="1"
>icon="/export/local/NetSight/clients/Console/console.ico" group="true"
>description="Launcher for Console client" iconIndex="0"/>
>        <shortcut name="another Documentation" initialState="1"
>commandLine="" workingDirectory=""
>target="/export/local/NetSight/clients/Console/license.pdf" type="1"
>icon="%SystemRoot%/system32/SHELL32.dll" group="true" description="This
>opens Adobe (Acrobat) Reader (if available) to look into or print the
>NanoXML (PDF) developer documentation" iconIndex="23"/>
>        <shortcut name="License test" initialState="1" commandLine=""
>workingDirectory=""
>target="/export/local/NetSight/clients/Console/license.pdf" type="1"
>icon="%SystemRoot%/system32/SHELL32.dll" group="true" description="This
>opens Adobe (Acrobat) Reader (if available) to look into or 
>print the IzPack
>@build.number@ (PDF) user documentation" iconIndex="23"/>
>    </com.izforge.izpack.panels.ShortcutPanel>
>    <com.izforge.izpack.panels.FinishPanel/>
></AutomatedInstallation>
>
>-- 
>View this message in context: 
http://www.nabble.com/Automated-installation-with-custom-panels-tf1902934.html#a5207281
Sent from the izpack users forum at Nabble.com.

_______________________________________________
izpack-users mailing list
izpack-users at lists.berlios.de
http://lists.berlios.de/mailman/listinfo/izpack-users



More information about the izpack-users mailing list