0
votes

I have a Java Webstart application, that is launched via network. Therefore the hostname of the server and of the JNLP file changes with the IP of the server.
The webstart creates a shortcut on the desktop.

The thing is, that the shortcut is recreated with every launch and thereby its position on the desktop (at least under windows - tested on XP and Windows 7) changes everytime.
This happens until the shortcut is renamed. Afterwards it behaves, like it should and isn't recreated anymore.

Does Anybody know, why this happens and how to avoid it (automatically - meaning not manually renaming the shortcut).

Here is an example for a JNLP file:

<jnlp spec="1.0+" codebase="http://localhost:8080/myapp/" href="http://localhost:8080/myapp/MyApp.jnlp">
  <information>
    <title>MyApp</title>
    <vendor>MeAndI</vendor>
    <homepage href="http://www.MyApp.com"/>
    <description>The client for MyApp </description>
    <description kind="tooltip">The client for MyApp </description>
    <icon href="http://localhost:8080/myapp/icon.png" kind="default"/>
    <icon href="http://localhost:8080/myapp/icon.ico" kind="shortcut"/>
    <shortcut online="true" install="false">
      <desktop/>
      <menu submenu="MyApp"/>
    </shortcut>
  </information>
  <security>
    <all-permissions/>
  </security>
  <update check="timeout" policy="always"/>
  <resources>
    <java initial-heap-size="268435456" max-heap-size="536870912" version="1.5+"/>
    <jar href="http://localhost:8080/myapp/MyAppClient.jar" download="eager" main="false"/>
    <!-- some more jar referemces ... -->
  </resources>
  <application-desc main-class="com.meandi.myapp.core.gui.LoginScreen"/>
</jnlp>

Thank you in advance.

Regards, Schorsch.

1

1 Answers

0
votes

It's an old question, but I hope this is useful to somebody.

The reasons why the icon is always recreated and moving on desktop are:

  1. There is no version attribute defined in the jnlp element. Since update policy is set to "always", WebStart will always reinstall your application, and so the icon is recreated.
  2. Windows has a rule to where it adds new desktop icons. It depends on if you set Windows to sort desktop icons, but most people will do it manually - in which case new icons go to the first available space from top left to bottom right, vertical before horizontal.