I use the shortcut tag in my appliation's jnlp descriptor to create a desktop link and a menu entry for my application.
If these shortcuts get deleted on the client - how can they be reinstalled automatically without user action? Is there a configuration option for the jnlp file?
(btw I'm using java6)
Here is a skeleton of an automatic way (you need javaws.jar
in your classpath for this to work):
IntegrationService is = null;
try
{
is = (IntegrationService) ServiceManager.lookup("javax.jnlp.IntegrationService");
}
catch (UnavailableServiceException use)
{
// integration service unavailable
}
if (!is.hasDesktopShortcut())
{
if (!is.requestShortcut(true, true, "Companyapp"))
{
// failed to install shortcuts
}
}
else
{
// shortcuts already exist
}
Please refere this link - http://mindprod.com/jgloss/javawebstart.html
SUMMARY:If you want JWS to recreate menu and/or desktop shortcuts, delete both the menu item and the desktop icon, then run javaws -viewer on the command line then click the button to create the shortcuts. If either one exists, javaws.exe won’t create the other. It also might not create them where you were expecting, so look around.
The docs for Java6 on javaws show that you can either use the executable to launch an app or to perform maintenance operations they call control options.
Two of those options are:
javaws -uninstall <jnlp>
javaws -import [import-options] <jnlp>
one of the things you can do is
javaws -import -silent -shortcut <jnlp>
So if you can run a script that first uninstalls your particular jnlp app and then silently re-imports it and its shortcuts then that would solve your problem. I don't think Java will automatically do this for you.
Note that the documentation says that it has to be a silent installation for the shortcut option to work. Also, I haven't double checked that this actually works myself.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With