Class Shortcut
- Namespace
- ZeroInstall.DesktopIntegration.Windows
- Assembly
- ZeroInstall.DesktopIntegration.dll
Creates Windows shortcut files (.lnk).
public static class Shortcut
- Inheritance
-
Shortcut
- Inherited Members
Methods
Create(string, string, string?, string?, string?, string?)
Creates a new Windows shortcut.
public static void Create(string path, string targetPath, string? arguments = null, string? iconLocation = null, string? description = null, string? appId = null)
Parameters
pathstringThe location to place the shortcut at.
targetPathstringThe target path the shortcut shall point to.
argumentsstringAdditional arguments to pass to the target; can be
null.iconLocationstringThe path of the icon to use for the shortcut; leave
nullot get the icon fromtargetPath.descriptionstringA short human-readable description; can be
null.appIdstringThe Application User Model ID; used by Windows to associate shortcuts and pinned taskbar entries with running processes.
Create(AutoStart, FeedTarget, IIconStore, bool)
Creates a new Windows shortcut in the "Startup" menu.
public static void Create(AutoStart autoStart, FeedTarget target, IIconStore iconStore, bool machineWide)
Parameters
autoStartAutoStartInformation about the shortcut to be created.
targetFeedTargetThe target the shortcut shall point to.
iconStoreIIconStoreStores icon files downloaded from the web as local files.
machineWideboolCreate the shortcut machine-wide instead of just for the current user.
Create(DesktopIcon, FeedTarget, IIconStore, bool)
Creates a new Windows shortcut on the desktop.
public static void Create(DesktopIcon desktopIcon, FeedTarget target, IIconStore iconStore, bool machineWide)
Parameters
desktopIconDesktopIconInformation about the shortcut to be created.
targetFeedTargetThe target the shortcut shall point to.
iconStoreIIconStoreStores icon files downloaded from the web as local files.
machineWideboolCreate the shortcut machine-wide instead of just for the current user.
Create(MenuEntry, FeedTarget, IIconStore, bool)
Creates a new Windows shortcut in the start menu or on the start page.
public static void Create(MenuEntry menuEntry, FeedTarget target, IIconStore iconStore, bool machineWide)
Parameters
menuEntryMenuEntryInformation about the shortcut to be created.
targetFeedTargetThe target the shortcut shall point to.
iconStoreIIconStoreStores icon files downloaded from the web as local files.
machineWideboolCreate the shortcut machine-wide instead of just for the current user.
Create(QuickLaunch, FeedTarget, IIconStore)
Creates a new Windows shortcut in the quick launch bar.
public static void Create(QuickLaunch quickLaunch, FeedTarget target, IIconStore iconStore)
Parameters
quickLaunchQuickLaunchInformation about the shortcut to be created.
targetFeedTargetThe target the shortcut shall point to.
iconStoreIIconStoreStores icon files downloaded from the web as local files.
Create(SendTo, FeedTarget, IIconStore)
Creates a new Windows shortcut in the "Send to" menu.
public static void Create(SendTo sendTo, FeedTarget target, IIconStore iconStore)
Parameters
sendToSendToInformation about the shortcut to be created.
targetFeedTargetThe target the shortcut shall point to.
iconStoreIIconStoreStores icon files downloaded from the web as local files.
GetStartMenuPath(string?, string?, bool)
Builds a path for a shortcut in the start menu programs folder, optionally appending a category.
public static string GetStartMenuPath(string? category, string? name, bool machineWide)
Parameters
categorystringThe name of the category/directory below the programs folder; can be
null.namestringThe name of the shortcut (without the .lnk ending).
machineWidebooltrueto use the machine-wide start menu;falsefor the per-user variant.
Returns
Exceptions
- IOException
nameorcategorycontains invalid characters.
Remove(AutoStart, bool)
Removes a Windows shortcut from the "Startup" menu.
public static void Remove(AutoStart autoStart, bool machineWide)
Parameters
autoStartAutoStartInformation about the shortcut to be removed.
machineWideboolThe shortcut was created machine-wide instead of just for the current user.
Remove(DesktopIcon, bool)
Removes a Windows shortcut from the desktop.
public static void Remove(DesktopIcon desktopIcon, bool machineWide)
Parameters
desktopIconDesktopIconInformation about the shortcut to be removed.
machineWideboolThe shortcut was created machine-wide instead of just for the current user.
Remove(MenuEntry, bool)
Removes a Windows shortcut from the start menu or on the start page.
public static void Remove(MenuEntry menuEntry, bool machineWide)
Parameters
menuEntryMenuEntryInformation about the shortcut to be removed.
machineWideboolThe shortcut was created machine-wide instead of just for the current user.
Remove(QuickLaunch)
Removes a Windows shortcut from the quick launch bar.
public static void Remove(QuickLaunch quickLaunch)
Parameters
quickLaunchQuickLaunchInformation about the shortcut to be removed.
Remove(SendTo)
Removes a Windows shortcut from the "Send to" menu.
public static void Remove(SendTo sendTo)
Parameters
sendToSendToInformation about the shortcut to be removed.