[izpack-changes] [Bug #5954] TargetPanel.dir is never used

noreply at berlios.de noreply at berlios.de
Tue Jan 3 03:24:10 CET 2006


Bug #5954, was updated on 2005-Dec-22 03:23
Here is a current snapshot of the bug.

Project: IzPack
Category: IzPack3
Status: Open
Resolution: None
Bug Group: None
Priority: 5
Submitted by: rastaman06
Assigned to : none
Summary: TargetPanel.dir is never used

Details: Hi all,

I began to create installers for all the projects in which i'm involved and test them on Win2K, Debian Sarge, Mac OS X Tiger. So for some of these installers i want to have only one target dir, which is os-independant. For doing this i have declared the "TargetPanel.dir" ressource, which map to a file. My problem is that the TargetPanel.dir ressource is never read because PathInputPanel.loadDefaultInstallDir quit after having not found a ressource for a specific OS [see 1 below].
My current workaround is to declare a resssource for each OS, but i was wondering if we cannot catch the exception in loadDefaultInstallDir, so the algorithm can continue until it try to find the default ressource (TargetPanel.dir).

So this code at the beginning of the method loadDefaultInstallDir (l. 302) :
...
            if (OsVersion.IS_WINDOWS)
                in = parentFrame.getResource("TargetPanel.dir.windows");

            else if (OsVersion.IS_OSX)
                in = parentFrame.getResource("TargetPanel.dir.macosx");
            else
...
could become :
...
            if (OsVersion.IS_WINDOWS)
                try {
                in = parentFrame.getResource("TargetPanel.dir.windows");
                } catch (Exception ignored) {//ILB};
            else if (OsVersion.IS_OSX)
                try {
                in = parentFrame.getResource("TargetPanel.dir.macosx");
                } catch (Exception ignored) {//ILB};
            else
...
And so allow to go to the end of the method, where is fetch the default target dir. 

[1]     [java] com.izforge.izpack.installer.ResourceNotFoundException: Warning: Resource not found: TargetPanel.dir.macosx
     [java] at com.izforge.izpack.installer.InstallerFrame.getResource(InstallerFrame.java:668)
     [java] at com.izforge.izpack.panels.PathInputPanel.loadDefaultInstallDir(PathInputPanel.java:306)
     [java] at com.izforge.izpack.panels.TargetPanel.<init>(TargetPanel.java:53)

Follow-Ups:

Date: 2006-Jan-02 21:24
By: halvaughan

Comment:
I have not looked at the code, but in 3.8.0, this is working fine under Linux and Windows for me (and I'm specifying them by the OS family, as required).

I created the file:

$BASE/Resource/TargetPanel.dir.unix

And, in install.xml, in the Resources section, I added the line:

<res id="TargetPanel.dir.unix" src="Resource/TargetPanel.dir.unix"/>

And I did the same for Windows and it worked fine for both of them.  I think the key is to specify the id for the resource, and not just the file.
-------------------------------------------------------

Date: 2005-Dec-22 03:23
By: rastaman06

Comment:
I suppose that TargetPanel.dir is never used under OS X and Win32 only.
-------------------------------------------------------

For detailed info, follow this link:
http://developer.berlios.de/bugs/?func=detailbug&bug_id=5954&group_id=1408



More information about the izpack-changes mailing list