I am making an installer in java swing it almost completed only one thing is left to do
that is to create desktop shortcut of our software.I do not want to copy software on desktop but I want to create instance of that software like other MS software. How it can be done
please help me.
I am already copied my software in c:/Program files by using copy directory and I want to create shortcut on desktop .
I am making an installer in java swing it almost completed only one thing
Share
A Windows shortcut is just a
.LNKfile in the desktop directory. You need to find out the .lnk structure and then you can build such a file from (pure) Java.Alternative: Use JNI to call the appropriate Windows API.
EDIT: If you want to be lazy, you can create one “template”
.lnkfile by hand and store it as a resource in your program’s Jar; then, for a differentabc.exeprogram name, just copy that file to the desktop directory with the desired link file name, and change the name of the executable inside the file. Hopefully the.exefile name will be at a fixed offset, and hopefully you can control the length of that name to be constant. Then it should be easy.