Windows Shortcuts
By default, during installation Velopack will create a shortcut on the Desktop and in the StartMenuRoot. It will automatically delete any shortcuts it finds when uninstalling the application.
The name of the shortcuts will be determined by the --packTitle
vpk argument. For example, if you pass --packTitle "My Fancy App"
, then the shortcuts created will be created as "My Fancy App.lnk"
.
You can specify where you'd like shortcuts to be created by using the --shortcuts {locations}
command line argument. The following locations are supported:
Desktop
StartMenuRoot
StartMenu
(this is a subfolder in the StartMenuRoot, must also specify--packAuthors
)Startup
None
(to disable shortcut creation)
If you wanted to install into start menu and desktop, the argument you'd need is --shortcuts Desktop,StartMenuRoot
.
Legacy Shortcuts
If you need to create shortcuts in any extra locations, the Velopack.Windows.Shortcuts
and Velopack.Windows.ShellLink
classes are provided.
These classes are provided for legacy reasons, and in general the stability of such functions is not guarenteed.
For example, if you wished to create a shortcut during the install of your app, you might do the following:
using Velopack;
using Velopack.Windows;
VelopackApp.Build()
.WithAfterInstallFastCallback((v) => new Shortcuts().CreateShortcutForThisExe(ShortcutLocation.Desktop))
.Run()