TotemArts / Launcher

[WIP] Launcher for Renegade-X (Not Electron)
GNU General Public License v3.0
25 stars 9 forks source link

Create a installer for the Launcher #69

Open SonnyX opened 3 years ago

SonnyX commented 3 years ago
            IShellLink link = (IShellLink)new ShellLink();

            // setup shortcut information
            link.SetDescription("My Description");
            link.SetPath(@"c:\MyPath\MyProgram.exe");

            // save it
            IPersistFile file = (IPersistFile)link;
            string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
            file.Save(Path.Combine(desktopPath, "MyLink.lnk"), false);

https://docs.microsoft.com/en-us/windows/win32/shell/links#creating-a-shortcut-and-a-folder-shortcut-to-a-file