[izpack-devel] Bug in InstallerFrame.java, v3.9.0

François Guillet francois.guillet at wanadoo.fr
Mon Nov 6 07:30:28 CET 2006

Hi all,

I was asked by Julien to report this bug to the izpack-devel mailing
While making an installer for both Windows and Linux using IzPack, I had
to resort to OS Specific panels. But having a windows only panel when
installing under Linux raised an exception (and vice versa). The point
is that OS dependant panels are incorrectly ignored in
InstallerFrame.loadPanels(). The error is pretty easy to reproduce so I
won't reprint the full error exception trace. I badly need those OS
dependant panels (that's one of the major points of a cross-platform
installer), so I made a quick fix in the source code. Here is the
modified source code for InstallerFrame.loadPanels(). It's a
straightforward quick hack which may be a bit crude, but it allows me to
finish the installer for the Art of Illusion project

The full InstallerFrame.java code is attached.


    private void loadPanels() throws Exception
        // Initialisation
        java.util.List panelsOrder = installdata.panelsOrder;
        int i;
        int size = panelsOrder.size();
        String className;
        Class objectClass;
        Constructor constructor;
        Object object;
        IzPanel panel;
        Class[] paramsClasses = new Class[2];
        paramsClasses[0] =
        paramsClasses[1] =
        Object[] params = { this, installdata};

        // We load each of them
        int curVisPanelNumber = 0;
        int lastVis = 0;
        int count = 0;
        for (i = 0; i < size; i++)
            // We add the panel
            Panel p = (Panel) panelsOrder.get(i);
            if (!OsConstraint.oneMatchesCurrentSystem(p.osConstraints))
            className = p.className;
            String praefix = "com.izforge.izpack.panels.";
            if (className.indexOf('.') > -1)
            // Full qualified class name
                praefix = "";
            objectClass = Class.forName(praefix + className);
            constructor =
            object = constructor.newInstance(params);
            panel = (IzPanel) object;
            if (panel.isHidden())
                visiblePanelMapping.add(i, new Integer(-1));
                visiblePanelMapping.add(count, new
                lastVis = count;
            // We add the XML data panel root
            XMLElement panelRoot = new XMLElement(className);
        visiblePanelMapping.add(count,new Integer(lastVis));
-------------- next part --------------
A non-text attachment was scrubbed...
Name: InstallerFrame.java
Type: text/x-csrc
Size: 53833 bytes
Desc: not available
Url : https://lists.berlios.de/pipermail/izpack-devel/attachments/20061106/68782fdb/attachment.bin 

More information about the izpack-devel mailing list