Zero Install .NET API 2.20.0
ZeroInstall.DesktopIntegration.Windows.Shortcut Class Reference

Creates Windows shortcut files (.lnk). More...

Classes

interface  IPropertyStore
 
interface  IShellLink
 
struct  PropertyKey
 
class  ShellLink
 

Static Public Member Functions

static void Create (AutoStart autoStart, FeedTarget target, IIconStore iconStore, bool machineWide)
 Creates a new Windows shortcut in the "Startup" menu. More...
 
static void Remove (AutoStart autoStart, bool machineWide)
 Removes a Windows shortcut from the "Startup" menu. More...
 
static void Create (string path, string targetPath, string? arguments=null, string? iconLocation=null, string? description=null, string? appId=null)
 Creates a new Windows shortcut. More...
 
static void Create (DesktopIcon desktopIcon, FeedTarget target, IIconStore iconStore, bool machineWide)
 Creates a new Windows shortcut on the desktop. More...
 
static void Remove (DesktopIcon desktopIcon, bool machineWide)
 Removes a Windows shortcut from the desktop. More...
 
static string GetDesktopPath (string? name, bool machineWide)
 Builds a path for a shortcut on the desktop. More...
 
static void Create (MenuEntry menuEntry, FeedTarget target, IIconStore iconStore, bool machineWide)
 Creates a new Windows shortcut in the start menu or on the start page. More...
 
static void Remove (MenuEntry menuEntry, bool machineWide)
 Removes a Windows shortcut from the start menu or on the start page. More...
 
static string GetStartMenuPath (string? category, string? name, bool machineWide)
 Builds a path for a shortcut in the start menu programs folder, optionally appending a category. More...
 
static void Create (QuickLaunch quickLaunch, FeedTarget target, IIconStore iconStore)
 Creates a new Windows shortcut in the quick launch bar. More...
 
static void Remove (QuickLaunch quickLaunch)
 Removes a Windows shortcut from the quick launch bar. More...
 
static void Create (SendTo sendTo, FeedTarget target, IIconStore iconStore)
 Creates a new Windows shortcut in the "Send to" menu. More...
 
static void Remove (SendTo sendTo)
 Removes a Windows shortcut from the "Send to" menu. More...
 

Detailed Description

Creates Windows shortcut files (.lnk).

Member Function Documentation

◆ Create() [1/6]

static void ZeroInstall.DesktopIntegration.Windows.Shortcut.Create ( AutoStart  autoStart,
FeedTarget  target,
IIconStore  iconStore,
bool  machineWide 
)
inlinestatic

Creates a new Windows shortcut in the "Startup" menu.

Parameters
autoStartInformation about the shortcut to be created.
targetThe target the shortcut shall point to.
iconStoreStores icon files downloaded from the web as local files.
machineWideCreate the shortcut machine-wide instead of just for the current user.

◆ Create() [2/6]

static void ZeroInstall.DesktopIntegration.Windows.Shortcut.Create ( DesktopIcon  desktopIcon,
FeedTarget  target,
IIconStore  iconStore,
bool  machineWide 
)
inlinestatic

Creates a new Windows shortcut on the desktop.

Parameters
desktopIconInformation about the shortcut to be created.
targetThe target the shortcut shall point to.
iconStoreStores icon files downloaded from the web as local files.
machineWideCreate the shortcut machine-wide instead of just for the current user.

◆ Create() [3/6]

static void ZeroInstall.DesktopIntegration.Windows.Shortcut.Create ( MenuEntry  menuEntry,
FeedTarget  target,
IIconStore  iconStore,
bool  machineWide 
)
inlinestatic

Creates a new Windows shortcut in the start menu or on the start page.

Parameters
menuEntryInformation about the shortcut to be created.
targetThe target the shortcut shall point to.
iconStoreStores icon files downloaded from the web as local files.
machineWideCreate the shortcut machine-wide instead of just for the current user.

◆ Create() [4/6]

static void ZeroInstall.DesktopIntegration.Windows.Shortcut.Create ( QuickLaunch  quickLaunch,
FeedTarget  target,
IIconStore  iconStore 
)
inlinestatic

Creates a new Windows shortcut in the quick launch bar.

Parameters
quickLaunchInformation about the shortcut to be created.
targetThe target the shortcut shall point to.
iconStoreStores icon files downloaded from the web as local files.

◆ Create() [5/6]

static void ZeroInstall.DesktopIntegration.Windows.Shortcut.Create ( SendTo  sendTo,
FeedTarget  target,
IIconStore  iconStore 
)
inlinestatic

Creates a new Windows shortcut in the "Send to" menu.

Parameters
sendToInformation about the shortcut to be created.
targetThe target the shortcut shall point to.
iconStoreStores icon files downloaded from the web as local files.

◆ Create() [6/6]

static void ZeroInstall.DesktopIntegration.Windows.Shortcut.Create ( string  path,
string  targetPath,
string?  arguments = null,
string?  iconLocation = null,
string?  description = null,
string?  appId = null 
)
inlinestatic

Creates a new Windows shortcut.

Parameters
pathThe location to place the shortcut at.
targetPathThe target path the shortcut shall point to.
argumentsAdditional arguments to pass to the target; can be null.
iconLocationThe path of the icon to use for the shortcut; leave null ot get the icon from targetPath .
descriptionA short human-readable description; can be null.
appIdThe Application User Model ID; used by Windows to associate shortcuts and pinned taskbar entries with running processes.

◆ GetDesktopPath()

static string ZeroInstall.DesktopIntegration.Windows.Shortcut.GetDesktopPath ( string?  name,
bool  machineWide 
)
static

Builds a path for a shortcut on the desktop.

Parameters
nameThe name of the shortcut (without the .lnk ending).
machineWidetrue to use the machine-wide desktop; false for the per-user variant.
Exceptions
IOExceptionname contains invalid characters.

◆ GetStartMenuPath()

static string ZeroInstall.DesktopIntegration.Windows.Shortcut.GetStartMenuPath ( string?  category,
string?  name,
bool  machineWide 
)
static

Builds a path for a shortcut in the start menu programs folder, optionally appending a category.

Parameters
categoryThe name of the category/directory below the programs folder; can be null.
nameThe name of the shortcut (without the .lnk ending).
machineWidetrue to use the machine-wide start menu; false for the per-user variant.
Exceptions
IOExceptionname or category contains invalid characters.

◆ Remove() [1/5]

static void ZeroInstall.DesktopIntegration.Windows.Shortcut.Remove ( AutoStart  autoStart,
bool  machineWide 
)
inlinestatic

Removes a Windows shortcut from the "Startup" menu.

Parameters
autoStartInformation about the shortcut to be removed.
machineWideThe shortcut was created machine-wide instead of just for the current user.

◆ Remove() [2/5]

static void ZeroInstall.DesktopIntegration.Windows.Shortcut.Remove ( DesktopIcon  desktopIcon,
bool  machineWide 
)
inlinestatic

Removes a Windows shortcut from the desktop.

Parameters
desktopIconInformation about the shortcut to be removed.
machineWideThe shortcut was created machine-wide instead of just for the current user.

◆ Remove() [3/5]

static void ZeroInstall.DesktopIntegration.Windows.Shortcut.Remove ( MenuEntry  menuEntry,
bool  machineWide 
)
inlinestatic

Removes a Windows shortcut from the start menu or on the start page.

Parameters
menuEntryInformation about the shortcut to be removed.
machineWideThe shortcut was created machine-wide instead of just for the current user.

◆ Remove() [4/5]

static void ZeroInstall.DesktopIntegration.Windows.Shortcut.Remove ( QuickLaunch  quickLaunch)
inlinestatic

Removes a Windows shortcut from the quick launch bar.

Parameters
quickLaunchInformation about the shortcut to be removed.

◆ Remove() [5/5]

static void ZeroInstall.DesktopIntegration.Windows.Shortcut.Remove ( SendTo  sendTo)
inlinestatic

Removes a Windows shortcut from the "Send to" menu.

Parameters
sendToInformation about the shortcut to be removed.

The documentation for this class was generated from the following files: