Java WebStart JNLP: Run Different Code in First Run
We are using WebStart JNLP file to create a shortcut on our users` desktop.
The problem is that we would like the code in our jar file to be launched only when the user press the desktop shortcut. However, Ja开发者_JS百科va WebStart executes the jar also on the first launch (when we set the desktop icon).
Is there any way we can set the icon without running the jar, but to launch the jar when the user press the desktop icon?
why not have two different webstart apps; one for installing; one for running?
use some logic on your webserver to decide which to run?
In your code first thing check [user.home]/.apphome/.installed
(or any other location, it is your choice) file exists. If it does run your app normally. If it doesn't create that file and quit.
Depending on the platform you run it on you can also write into Windows registry, but I'd rather not.
What is your strategy if user doesn't allow shortcut creation via Java config?
精彩评论