views:

35

answers:

3

We're deploying a Web Start app that I and the other developers know how to install the shortcuts for (Control Panel -> Java on Windows, /Applications/Utilities/Java Preferences on OS X), but we have no reason to believe that end users know how to do this (or even know that it can be done).

Is there a way to either install the shortcuts automatically on first run, or (much preferably) ask the user if they'd like to install the shortcuts? I've been looking all over but the Sun/Oracle docs all say to go through the Java cache viewer, which I find completely ridiculous to ask of end users.

A: 

The javaws command states:

Usage: javaws [control-options]

control-options include:    
  ....
  -import [import-options] <jnlp-file>  import the application to the cache 


import-options include:                     
  ....
  -shortcut         install shortcuts as if user allowed prompt 

so you could probably do it through an invocation of javaws.

aioobe
+2  A: 

The JNLP specification allows for specifying that short cuts are to be created when the JNLP file is run.

Check the <jnlp><information><shortcut> tag.

Thorbjørn Ravn Andersen
Thanks, this got me on the right path
sbook
A: 

As of 1.6.0_18+, JWS offers the IntegrationService.

The IS can not only install/uninstall desktop shortcuts and menu items, but will report the success or failure of attempts to create/remove them.

Some minor points on standard use of shortcuts (through the JNLP file) using Windows and Linux. JWS will prompt the user only if the app. is sand-boxed. If the app. is trusted, it will go ahead and attempt to create the shortcut.

On Ubuntu Linux the menu items will fail silently, but the desk-top shortcut works. I have been meaning to investigate whether Ubuntu menu items will work better using the IS, by targeting the sub-menu to one of the standard sub-menus offered. If that is the case, menu items might be installed by the application targeting different menu structures on different OS'.

Andrew Thompson