Hello. I am writing a little program to create an installer of an application I wrote, and I want to create a shortcut in windows to access through the start menu. I know that it has to be possible from java, because programs like izpack create the shorcut i am trying to do.
Could someone, please help me or give me some advice???
If the .jar is executable and has all its classpaths in the manifest file, and the file association with java/javaw is set up in the Windows registry, you can usually execute a .jar file on Windows by double-clicking it.
Hello Campbell Ritchie. Thanks for answering. I had a little mistake writing my question, because what i want is to create the shortcut with the installer and I don't want the user to do the right click steps... just when the installer has finished, the user should be able to access my jar through the start menu.
Thanks again [ July 25, 2008: Message edited by: Jessid Leon Velez Gutierrez ]
A short cut is I believe just another file, so if you knew the format of this file you might be able to create one using Java. Without knowing the format you would probably need to use a Windows API to create it and that would require the use of JNI. If you look at the Izpack website, you will see that all the Windows specific features (creating shortcuts, registry entries, ect) are optional features, which means they most likely supply an exe or dll that they access using JNI.
the user should be able to access my jar through the start menu.
The contents of the Start|Programs menu on Windows XP comes from several folders.
One of them on my system is: C:\Documents and Settings\Owner\Start Menu\Programs\ Other versions have different locations that may be pointed to by an Environment variable.
To allow a user to start your program from the Start|Programs menu, I guess you'd have to add a folder in the above path and create a shortcut in that folder.
Don't have a clue. It would depend on the OS. Windows might have a utility to do it, or perhaps thru a JNI program or as someone suggested, look at an existing shortcut and create one on your own.
Don't have a clue. It would depend on the OS. Windows might have a utility to do it, or perhaps thru a JNI program or as someone suggested, look at an existing shortcut and create one on your own.
I've tried investigating the .lnk format once before but it's quite hard. I have written some JNI code though that can do it, but it's a bit complex. You have to work with C interfaces - and that's not as easy as Java interfaces.
The trick is to use IShellLink and IPersistFile; this link has a small example which I used to get my code running.
Hello Rob. Thanks for answering. You are right when you say that is not easy to write a .Ink file. I also found what each byte means, bun dont know how to create them. I havent seen the link you tolme, but i will let you know when i do it.
Rob, npi with the link you suggested. npi: ni puta idea
After a long time asking in irc channels, i had the good idea to ask in #C channel and they suggested to ask in #winapi channel... do not enter there. Not a pleasant experience...
jejeje
Post by:autobot
Get out of my mind! Look! A tiny ad!
a bit of art, as a gift, that will fit in a stocking