JDK-6568950 : installer-desc UNinstaller never called
  • Type: Bug
  • Component: deploy
  • Sub-Component: webstart
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2007-06-12
  • Updated: 2010-04-04
  • Resolved: 2007-06-13
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
Java Web Start 1.6.0_01
Using JRE version 1.6.0_01 Java HotSpot(TM) Client VM
(from JWS console)

ADDITIONAL OS VERSION INFORMATION :
Windows XP Pro

A DESCRIPTION OF THE PROBLEM :
Java web start (JWS) offers the installer-desc
element to identify an installer/uninstaller
for an application.  The intent of the installer
is to do any application set-up/pull-down that
can not be handled by the standard JWS behaviour
of caching the classes/resources at 1st launch,
and clearing them at uninstall.

The 'install' side of the installer-desc element
seems to work as advertised, but as has been noted
in the web start forum a number of times*, the
installer is never called at time of 'uninstall'.

* Though none reported successful resolution of
the problem, it also seems no one took it through
to a bug report.
http://forum.java.sun.com/thread.jspa?forumID=38&threadID=5124101
http://forum.java.sun.com/thread.jspa?forumID=38&threadID=263691
(Note - June 2002)

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1) Click the link to..
http://www.physci.org/jws/application.jnlp

2) At the appearance of the 'End User License Agreement'
JOptionPane, select 'Yes'

3) Exit the 'Installed Application Demo' on appearance
of the JFrame.

4) * Go to the..
Start | Settings | Control Panel | Add or Remove Programs
..dialog.  Fine the '(Trivial) Application' and select 'Remove'

5) At 'Confirm File Deletion' dialog, select 'OK'

* Also fails for removal using..
Start | Settings | Control Panel | Java
General | Temporary Internet Files | View
(right click on Application) Delete (menu item)

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
...
6) A JOptionPane with message..
'Thank you for using (Trivial) Application!'
ACTUAL -
Steps 1 through 5, never 6.

ERROR MESSAGES/STACK TRACES THAT OCCUR :
No error message apparent.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
[Application.java]
package test;

import javax.swing.*;

/** A basic application to support our Installer example.
@author Andrew Thompson
@version 2007/6/12 */
public class Application
  extends JFrame {

  /** Assemble the GUI. */
  Application() {
    super("Installed Application Demo");

    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    JLabel label = new JLabel(
      "<html><body align='center'>That entire EULA, just for this?!<br><br>(Yep.)",
      JLabel.CENTER );
    getContentPane().add( label );

    pack();
    setSize(630,470);
    setLocationRelativeTo(null);
  }

  /** Construct the GUI and display it. */
  public static void main(String[] args) {
    Application app =
      new Application();
    app.setVisible(true);
  }
}
[/Application.java]

[application.jnlp]
<?xml version='1.0' encoding='UTF-8' ?>
<jnlp spec='1.0'
      codebase='http://www.physci.org/jws'
      href='application.jnlp'>
  <information>
    <title>(Trivial) Application</title>
    <vendor>Andrew Thompson</vendor>
    <description kind='one-line'>
      Trivial application to support the demo of the web-start ExtensionInstallerService
    </description>
    <shortcut online='false'>
      <desktop/>
    </shortcut>
  </information>
  <resources>
    <j2se version='1.2+' />
    <extension href="installer.jnlp" />
    <jar href='application.jar' main='true' />
  </resources>
  <application-desc main-class='test.Application' />
</jnlp>
[application.jnlp]

[Installer.java]
package test;

import javax.swing.*;

// classes of the web-start API, used in this example.
import javax.jnlp.ExtensionInstallerService;
import javax.jnlp.ServiceManager;
import javax.jnlp.UnavailableServiceException;

class Installer {

  Installer() {
    try {
      ExtensionInstallerService installerService =
        (ExtensionInstallerService)ServiceManager.
          lookup("javax.jnlp.ExtensionInstallerService");
      /* We do not need the progress bar as progress
      is determined by the user accepting the EULA.
      They can consider it as long as they like. */
      installerService.hideProgressBar();

      int result = JOptionPane.showConfirmDialog(null,
        "Do you agree to the EULA?",
        "End User License Agreement",
        JOptionPane.YES_NO_OPTION,
        JOptionPane.QUESTION_MESSAGE );
      boolean agree = (result==JOptionPane.YES_OPTION);
      if (agree) {
        installerService.installSucceeded(false);
      } else {
        JOptionPane.showMessageDialog(null,
          "Perhaps another time..");
        installerService.installFailed();
      }
    } catch (UnavailableServiceException e) {
      e.printStackTrace();
    }
  }

  public static void main(String[] args) {
    if ( args[0].equals("install") ) {
      Installer installer = new Installer();
    } else {
      // no need to do anything on uninstall,
      // but thank the user for their patronage
      JOptionPane.showMessageDialog(null,
        "Thank you for using (Trivial) Application!");
    }
  }
}
[/Installer.java]

[installer.jnlp]
<?xml version='1.0' encoding='UTF-8' ?>
<jnlp spec='1.0'
      codebase='http://www.physci.org/jws'
      href='installer.jnlp'>
  <information>
    <title>Application Installer</title>
    <vendor>Andrew Thompson</vendor>
    <description kind='one-line'>
      Demo of the web-start ExtensionInstallerService
    </description>
  </information>
  <resources>
    <j2se version='1.2+' />
    <jar href='installer.jar' main='true' />
  </resources>
  <installer-desc main-class='test.Installer' />
</jnlp>
[/installer.jnlp]
---------- END SOURCE ----------