I'm creating an installer and I can't find a good location on how to create an desktop shortcut. Any ideas or suggestions are appreciated.
Thanks,
Josh
This is a discussion on Desktop Shortcut within the C# Programming forums, part of the General Programming Boards category; I'm creating an installer and I can't find a good location on how to create an desktop shortcut. Any ideas ...
I'm creating an installer and I can't find a good location on how to create an desktop shortcut. Any ideas or suggestions are appreciated.
Thanks,
Josh
Figured it out. By using the WIndows scripting object host as a reference and putting "using IWshRuntimeLibrary;", this function creates the desktop shortcut.
Code:private void appShortcutToDesktop() { string shortcutFullName = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) + "\\Name.lnk"; WshShell shell = new WshShellClass(); IWshShortcut link = (IWshShortcut)shell.CreateShortcut(shortcutFullName); link.TargetPath = "C:\\FOLDER\\EXECUTEME.exe"; link.Description = "DESC OF WHOAH"; link.Save(); }