Make WebStart Java desktop application to start on system startup on Windows and Mac

Posted by parxier on Stack Overflow See other posts from Stack Overflow or by parxier
Published on 2010-05-04T02:42:35Z Indexed on 2010/05/04 2:48 UTC
Read the original article Hit count: 380

Filed under:
|
|
|
|

I developed small cross-platform (Windows and Mac) SWT desktop application. It is distributed with WebStart. So far so good, everything works.

I've got a new requirement to make my app start on system startup (with no user interaction). What is the best way to accomplish that?

In JNLP file I've got this:

<shortcut online="false">
    <desktop/>
    <menu submenu="CompanyName"/>
</shortcut>

On Windows WebStart creates a desktop link [app_name].lnk and it points to javaws.exe and then some Java cache file as a parameter with funny name like ..\Sun\Java\Deployment\cache\6.0\4\2c0a6a781-213476. I can possibly programmatically find that link on user's machine by name... erm... and then copy it into user's Startup folder. I can see a problem here though as user can disable WebStart desktop shortcut creation option all together.

On Mac WebStart pops up a dialog to prompt user for the location where to create an [app_name].app (user is allowed to change link name there!) file that launches an application. On Mac I don't event know where the Startup folder is located (and it seems to be much more complex there).

Is there Java library out there that abstracts start app on system startup concept on different platforms as SWT does for GUI abstraction?

© Stack Overflow or respective owner

Related posts about java

Related posts about webstart