Table of Contents

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 string

The location to place the shortcut at.

targetPath string

The target path the shortcut shall point to.

arguments string

Additional arguments to pass to the target; can be null.

iconLocation string

The path of the icon to use for the shortcut; leave null ot get the icon from targetPath.

description string

A short human-readable description; can be null.

appId string

The 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 AutoStart

Information about the shortcut to be created.

target FeedTarget

The target the shortcut shall point to.

iconStore IIconStore

Stores icon files downloaded from the web as local files.

machineWide bool

Create 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 DesktopIcon

Information about the shortcut to be created.

target FeedTarget

The target the shortcut shall point to.

iconStore IIconStore

Stores icon files downloaded from the web as local files.

machineWide bool

Create 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 MenuEntry

Information about the shortcut to be created.

target FeedTarget

The target the shortcut shall point to.

iconStore IIconStore

Stores icon files downloaded from the web as local files.

machineWide bool

Create 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 QuickLaunch

Information about the shortcut to be created.

target FeedTarget

The target the shortcut shall point to.

iconStore IIconStore

Stores 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 SendTo

Information about the shortcut to be created.

target FeedTarget

The target the shortcut shall point to.

iconStore IIconStore

Stores 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 string

The name of the category/directory below the programs folder; can be null.

name string

The name of the shortcut (without the .lnk ending).

machineWide bool

true to use the machine-wide start menu; false for the per-user variant.

Returns

string

Exceptions

IOException

name or category contains invalid characters.

Remove(AutoStart, bool)

Removes a Windows shortcut from the "Startup" menu.

public static void Remove(AutoStart autoStart, bool machineWide)

Parameters

autoStart AutoStart

Information about the shortcut to be removed.

machineWide bool

The 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 DesktopIcon

Information about the shortcut to be removed.

machineWide bool

The 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 MenuEntry

Information about the shortcut to be removed.

machineWide bool

The 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 QuickLaunch

Information 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 SendTo

Information about the shortcut to be removed.