String iconFileLocation = jarFilePath + "\\resources\\peptide-shaker.ico";
String jarFileLocation = jarFilePath + "\\PeptideShaker-" + PeptideShaker.getVersion() + ".jar";
try {
JShellLink link = new JShellLink();
link.setFolder(JShellLink.getDirectory("desktop"));
link.setName("Peptide Shaker " + PeptideShaker.getVersion());
link.setIconLocation(iconFileLocation);
link.setPath(jarFileLocation);
link.save();
} catch (Exception e) {
System.out.println("An error occurred when trying to create a desktop shortcut...");
e.printStackTrace();
}
}