// remove old shortcut if it exists
tryDeleteFile(shortcutAbsPath);
val bw = new BufferedWriter(new FileWriter(shortcutAbsPath, false));
bw.write("[Desktop Entry]");
bw.newLine();
// icon type to use depends on whether the shortcut link is a file or folder
if (linkedResourceFile.isFile())
{
bw.write("Icon=file");