Battlelogium.Installer.InstallerCommon.CreateDesktopShortcut C# (CSharp) Method

CreateDesktopShortcut() public static method

public static CreateDesktopShortcut ( string shortcutName, string description, string exePath ) : void
shortcutName string
description string
exePath string
return void
        public static void CreateDesktopShortcut(string shortcutName, string description, string exePath)
        {
            WshShell shell = new WshShell();
            object shDesktop = (object)"Desktop";
            string shortcutPath = (string)shell.SpecialFolders.Item(ref shDesktop);
            CreateShortcut(shortcutName, description, exePath, shortcutPath);
        }

Usage Example

Example #1
0
 public void CreateDesktopShortcuts()
 {
     if (bf3Shortcut_input.IsChecked == true)
     {
         InstallerCommon.CreateDesktopShortcut("Battlelogium - Battlefield 3.lnk", "Play Battlefield 3", Path.Combine(this.installPath, "Battlelogium.UI.BF3.exe"));
     }
     if (bf4Shortcut_input.IsChecked == true)
     {
         InstallerCommon.CreateDesktopShortcut("Battlelogium - Battlefield 4.lnk", "Play Battlefield 4", Path.Combine(this.installPath, "Battlelogium.UI.BF4.exe"));
     }
     if (bfhShortcut_input.IsChecked == true)
     {
         InstallerCommon.CreateDesktopShortcut("Battlelogium - Battlefield Hardline.lnk", "Play Battlefield Hardline", Path.Combine(this.installPath, "Battlelogium.UI.BFH.exe"));
     }
     if (mohwShortcut_input.IsChecked == true)
     {
         InstallerCommon.CreateDesktopShortcut("Battlelogium - Medal of Honor Warfighter.lnk", "Medal of Honor Warfighter", Path.Combine(this.installPath, "Battlelogium.UI.MOHW.exe"));
     }
 }