• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Using IntegrationService to interrogate the desktop shortcut

 
Greenhorn
Posts: 3
IntelliJ IDE Hibernate Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good Morning,

I have my web start app working fine and now need to go a bit beyond the basics\conventional.

Basically I would like to programmatically - in my web start app - retrieve the location of the client cached jnlp file* as stored in the auto created desktop shortcut target (on windows at least); usually as something like:

C:\Windows\SysWOW64\javaws.exe -localfile "C:\Users\matb\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\1\60d71e41-5efb04d0"

It would appear the IntegrationService is almost what I need with its methods to determine if the jnlp app has desktop or menu shortcuts. However the IntegrationService has very limited exposed functionality.

Does anyone know the best way to do this? The information must be available somewhere as JWS created the shortcut. A quick look through the source code indicates I may have to make use of the com.sun.deploy.cache package myself - but I am hoping there is another easier, cleaner more obvious way.

Cheers

Mat

*The reason I want the shortcut target is that armed with this information it is possible to programatically schedule my web start app to ..start automatically via the Windows task scheduler (via at or schtasks command). I can schedule the web start app manually at the moment in this way, but ideally would like the web start app to schedule itself.
 
Mathew Broughton
Greenhorn
Posts: 3
IntelliJ IDE Hibernate Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Fear not I have answered it myself. If you get hold of the JnlpClassLoader and from that retrieve the com.sun.javaws.jnlLaunchDesc object, i.e:

LaunchDesc launchDesc = jnlpClassLoader.getLaunchDesc();

Then the LaunchDesc object holds the location of the cached jnlp file (well indirectly, I copied the following helper method from com.sun.javaws.LocalInstallHandler to get the jnlp location).


Why there isn't more functionality available on the IntegrationService itself I don't know.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic