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
path
stringThe location to place the shortcut at.
targetPath
stringThe target path the shortcut shall point to.
arguments
stringAdditional arguments to pass to the target; can be
null
.iconLocation
stringThe path of the icon to use for the shortcut; leave
null
ot get the icon fromtargetPath
.description
stringA short human-readable description; can be
null
.appId
stringThe 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
autoStart
AutoStartInformation about the shortcut to be created.
target
FeedTargetThe target the shortcut shall point to.
iconStore
IIconStoreStores icon files downloaded from the web as local files.
machineWide
boolCreate 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
desktopIcon
DesktopIconInformation about the shortcut to be created.
target
FeedTargetThe target the shortcut shall point to.
iconStore
IIconStoreStores icon files downloaded from the web as local files.
machineWide
boolCreate 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
menuEntry
MenuEntryInformation about the shortcut to be created.
target
FeedTargetThe target the shortcut shall point to.
iconStore
IIconStoreStores icon files downloaded from the web as local files.
machineWide
boolCreate 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
quickLaunch
QuickLaunchInformation about the shortcut to be created.
target
FeedTargetThe target the shortcut shall point to.
iconStore
IIconStoreStores 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
sendTo
SendToInformation about the shortcut to be created.
target
FeedTargetThe target the shortcut shall point to.
iconStore
IIconStoreStores 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
category
stringThe name of the category/directory below the programs folder; can be
null
.name
stringThe name of the shortcut (without the .lnk ending).
machineWide
booltrue
to use the machine-wide start menu;false
for the per-user variant.
Returns
Exceptions
- IOException
name
orcategory
contains invalid characters.
Remove(AutoStart, bool)
Removes a Windows shortcut from the "Startup" menu.
public static void Remove(AutoStart autoStart, bool machineWide)
Parameters
autoStart
AutoStartInformation about the shortcut to be removed.
machineWide
boolThe 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
desktopIcon
DesktopIconInformation about the shortcut to be removed.
machineWide
boolThe 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
menuEntry
MenuEntryInformation about the shortcut to be removed.
machineWide
boolThe 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
quickLaunch
QuickLaunchInformation about the shortcut to be removed.
Remove(SendTo)
Removes a Windows shortcut from the "Send to" menu.
public static void Remove(SendTo sendTo)
Parameters
sendTo
SendToInformation about the shortcut to be removed.