IzPack

GUIInstaller constructor should display a message box when an exception occurs

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 4.2.1
  • Fix Version/s: 4.3.0
  • Component/s: Installer
  • Labels:
    None
  • Environment:
    Graphical UI
  • Number of attachments :
    2

Description

When an exception occurs within the GUIInstaller constructor, e.g. NoClassDefFoundError, the error is displayed at the console but no message box occurs. When the installer is started by e.g. double-clicking at the JAR file in Windows, no error message can be seen and it seems like nothing happens.

I suggest to move the current GUIInstaller constructor code into an init() subroutine and change the constructor to something like that:

public GUIInstaller() throws Throwable {
try { init(); } // call original constructor code
catch (Throwable e) { // catch Throwables so that e.g. NoClassDefFoundError is included
try { // try to display a message box JOptionPane.showMessageDialog (null, "Error: "+e.toString(), "Error", JOptionPane.ERROR_MESSAGE); }
catch (Exception e2) {} // ignore possible exception from showMessageDialog
throw e; }} // re-throw the original exception

  1. IZPACK-318-Destroyer.patch
    23/Mar/09 1:42 PM
    1.0 kB
    Christian d'Heureuse
  2. IZPACK-318-GuiInstaller.patch
    23/Mar/09 1:42 PM
    1 kB
    Christian d'Heureuse

Activity

Hide
Christian d'Heureuse added a comment -

A similar problem also exists in the uninstaller.

When a NoClassDefFoundError occurs in Destroyer.getListenerLists(), no error message is displayed at the GUI.

Destroyer.run() should not only catch "Exception"s, but also "Throwable"s or at least "Error"s.

Show
Christian d'Heureuse added a comment - A similar problem also exists in the uninstaller. When a NoClassDefFoundError occurs in Destroyer.getListenerLists(), no error message is displayed at the GUI. Destroyer.run() should not only catch "Exception"s, but also "Throwable"s or at least "Error"s.
Hide
Julien Ponge added a comment -

Ok Christian.

Can you please submit a patch for the issue?

Thanks

Show
Julien Ponge added a comment - Ok Christian. Can you please submit a patch for the issue? Thanks
Hide
Christian d'Heureuse added a comment -

Added patches for GuiInstaller.java and Destroyer.java.

(I additionally cleaned out some unnecessary code in Destroyer.java)

Show
Christian d'Heureuse added a comment - Added patches for GuiInstaller.java and Destroyer.java. (I additionally cleaned out some unnecessary code in Destroyer.java)
Hide
Julien Ponge added a comment -

Great!

Thanks a lot.

Show
Julien Ponge added a comment - Great! Thanks a lot.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: