Saltar al contenido principal

VelopackApp class

Namespace: Velopack

VelopackApp helps you to handle app activation events correctly. This should be used as early as possible in your application startup code. (eg. the beginning of Main() in Program.cs)

public sealed class VelopackApp

Methods

MethodSummary
BuildCreates and returns a new Velopack application builder.
SetArgsOverride the command line arguments used to determine the Velopack hook to run.
SetAutoApplyOnStartupSet whether to automatically apply downloaded updates on startup. This is ON by default.
SetAppUserModelIdOverride the Application User Model ID (AUMID) set for this process on Windows.
SetLocatorOverride the default IVelopackLocator used to search for application paths.
SetLoggerAdds a custom logger to the Velopack application. This will be used for all Velopack diagnostic
OnFirstRunThis hook is triggered when the application is started for the first time after installation.
OnRestartedThis hook is triggered when the application is restarted by Velopack after installing updates.
OnAfterInstallFastCallbackWARNING: FastCallback hooks are run during critical stages of Velopack operations.
OnAfterUpdateFastCallbackWARNING: FastCallback hooks are run during critical stages of Velopack operations.
OnBeforeUpdateFastCallbackWARNING: FastCallback hooks are run during critical stages of Velopack operations.
OnBeforeUninstallFastCallbackWARNING: FastCallback hooks are run during critical stages of Velopack operations.
RunRuns the Velopack application startup code and triggers any configured hooks.

Build()

public static VelopackApp Build()

Creates and returns a new Velopack application builder.

Returns VelopackApp

SetArgs(args)

public VelopackApp SetArgs(string[] args)

Override the command line arguments used to determine the Velopack hook to run. If this is not set, the command line arguments passed to the application will be used.

Parameters

NameTypeDescription
argsstring[]

Returns VelopackApp

SetAutoApplyOnStartup(autoApply)

public VelopackApp SetAutoApplyOnStartup(bool autoApply)

Set whether to automatically apply downloaded updates on startup. This is ON by default.

Parameters

NameTypeDescription
autoApplybool

Returns VelopackApp

SetAppUserModelId(aumid)

public VelopackApp SetAppUserModelId(string aumid)

Override the Application User Model ID (AUMID) set for this process on Windows. By default, the AUMID is read from the package manifest (shortcutAumid), falling back to "velopack.{AppId}".

Parameters

NameTypeDescription
aumidstring

Returns VelopackApp

SetLocator(locator)

public VelopackApp SetLocator(IVelopackLocator locator)

Override the default IVelopackLocator used to search for application paths. This will be cached and potentially re-used throughout the lifetime of the application.

Parameters

NameTypeDescription
locatorIVelopackLocator

Returns VelopackApp

SetLogger(logger)

public VelopackApp SetLogger(IVelopackLogger logger)

Adds a custom logger to the Velopack application. This will be used for all Velopack diagnostic messages in addition to the default log file location. This will be cached and re-used throughout the lifetime of the application. If you have also provided a custom locator, this logger will be ignored.

Parameters

NameTypeDescription
loggerIVelopackLogger

Returns VelopackApp

OnFirstRun(hook)

public VelopackApp OnFirstRun(VelopackHook hook)

This hook is triggered when the application is started for the first time after installation.

Parameters

NameTypeDescription
hookVelopackHook

Returns VelopackApp

OnRestarted(hook)

public VelopackApp OnRestarted(VelopackHook hook)

This hook is triggered when the application is restarted by Velopack after installing updates.

Parameters

NameTypeDescription
hookVelopackHook

Returns VelopackApp

OnAfterInstallFastCallback(hook)

public VelopackApp OnAfterInstallFastCallback(VelopackHook hook)

WARNING: FastCallback hooks are run during critical stages of Velopack operations. Your code will be run and then Exit(int) will be called. If your code has not completed within 30 seconds, it will be terminated. Only supported on windows; On other operating systems, this will never be called.

Parameters

NameTypeDescription
hookVelopackHook

Returns VelopackApp

OnAfterUpdateFastCallback(hook)

public VelopackApp OnAfterUpdateFastCallback(VelopackHook hook)

WARNING: FastCallback hooks are run during critical stages of Velopack operations. Your code will be run and then Exit(int) will be called. If your code has not completed within 15 seconds, it will be terminated. Only supported on windows; On other operating systems, this will never be called.

Parameters

NameTypeDescription
hookVelopackHook

Returns VelopackApp

OnBeforeUpdateFastCallback(hook)

public VelopackApp OnBeforeUpdateFastCallback(VelopackHook hook)

WARNING: FastCallback hooks are run during critical stages of Velopack operations. Your code will be run and then Exit(int) will be called. If your code has not completed within 15 seconds, it will be terminated. Only supported on windows; On other operating systems, this will never be called.

Parameters

NameTypeDescription
hookVelopackHook

Returns VelopackApp

OnBeforeUninstallFastCallback(hook)

public VelopackApp OnBeforeUninstallFastCallback(VelopackHook hook)

WARNING: FastCallback hooks are run during critical stages of Velopack operations. Your code will be run and then Exit(int) will be called. If your code has not completed within 30 seconds, it will be terminated. Only supported on windows; On other operating systems, this will never be called.

Parameters

NameTypeDescription
hookVelopackHook

Returns VelopackApp

Run()

public void Run()

Runs the Velopack application startup code and triggers any configured hooks.


Generated from Velopack 1.1.1