This discussion is archived
0 Replies Latest reply: Jun 12, 2012 1:59 AM by 943076 RSS

JNLP installer - cached vs. non-cached resources

943076 Newbie
Currently Being Moderated
Hello,

I am currently trying to provide an installation procedure for some application. The application is in java and made of multiple jars and plugins. One constrain is that the application can launch java commands on the plugins (requiring access to jar files). Hence, I prepared an installer/updater to work with jnlp so as to install the application on the user computer. Each time the application is launched, we need to check for plugin updates and download the updates to the adequate directory before actually launching the application (via a ProcessBuilder), meaning the installer needs to be called each time the app is launched.

I went as far as I could but get stuck on some (possibly core) concepts: I have 2 jnlp files, one being the installer, referencing the base jar resources and a jnlp plugin resource being a component.

Through jnlp api, the installer is able to get cached resources and copy them to a given directory for the app to be launched. The main issue concerns the resources to be upgraded. Whenever new resources are present, the app do not get to see them as jnlp download them an put them in the cached resources before my installer can be launched. I thought I could use a DownloadServiceListener to get a hold on new resources, adding it as a progress-class parameter, but the service is apparently never called.

If the resources are set to lazy, they never get to be available in either cached or available resources for upgrade...


Here are reduced versions of the resources :


installer :

<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="6.0+" codebase="%CODEBASE%/apps/" href="">
     <information>
          ...
          <offline-allowed />

          <shortcut online="true">
               <desktop />
               <menu submenu="Company">
                    <menu submenu="App" />
               </menu>
          </shortcut>
     </information>
     <security>
          <all-permissions />
     </security>
     <update check="always" policy="always" />

     <resources>
          <j2se version="1.6+" java-vm-args="" href="http://java.sun.com/products/autodl/j2se" />
          <jar href="jnlp-installer.jar" main="true" />
          <extension name="applicationResources" href="%CODEBASE%/JNLP?jnlp=resources" download="eager"/>
     </resources>
     <application-desc main-class="com.company.JnlpInstaller" name="App name" >
     </application-desc >
</jnlp>


plugins :

<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="6.0+" codebase="%CODEBASE%" href="">
     <information>
          ...
          <offline-allowed />
     </information>
     <security>
          <all-permissions />
     </security>
     <update check="always" policy="always" />

     <resources>
          <j2se version="1.6+" java-vm-args="-d32" href="http://java.sun.com/products/autodl/j2se" />
          <jar href="../jnlp-installer.jar" />
          %RESOURCES%
     </resources>
     <component-desc progress-class="com.company.CustomDownloadServiceListener"/>
</jnlp>

Thanks in advance for your returns

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points