Search code examples
javawindows-xpshortcutjnlpjava-web-start

Java Web Start - Multiple shortcuts


I'm having a problem with creating shortcuts at versions of WindowsXP that aren't in English.

I want to add a shortcut to the 'Startup' menu, that way, the application will run every time the user log on.

So i did:

<shortcut online="true">
    <desktop/>
    <menu submenu="Startup"/>
</shortcut>

But, at WindowsXP in Portuguese, for example, the correct submenu need to be 'Inicializar' instead of 'Startup'.

So, considering that application's users may have English or Portuguese versions of Windows, I need something like that:

<shortcut online="true">
    <desktop/>
    <menu submenu="Startup"/>
</shortcut>
<shortcut online="true">
        <desktop/>
        <menu submenu="Inicializar"/>
</shortcut>

But that doesn't work.

Can anyone help?

Thanks.


Solution

  • The JNLP format supports partitioning downloads by locales in the resources elements, but not the shortcuts element (from memory - use JaNeLA to check for sure).

    Instead, you will probably need to look to the IntegrationService introduced in 6.0.18. Particularly the requestShortcut(desktop,menu,submenu)1 method. The method returns a boolean to indicate success/failure.

    1. The string for submenu might be inferred from:
      • user.language
      • Locale.getDefault()
      • The simple solutions - ask the user:
        1. Editable combo-box of known variants in an option pane.
        2. A file chooser, pointing to somewhere near where the start menu should be.