Saltar al contenido principal

VelopackApp class

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() or wherever your entry point is)

class VelopackApp

Constructors

ConstructorSummary
constructor

constructor()

constructor()

Methods

MethodSummary
onAfterInstallFastCallbackWARNING: FastCallback hooks are run during critical stages of Velopack operations.
onAfterUpdateFastCallbackWARNING: FastCallback hooks are run during critical stages of Velopack operations.
onBeforeUninstallFastCallbackWARNING: FastCallback hooks are run during critical stages of Velopack operations.
onBeforeUpdateFastCallbackWARNING: FastCallback hooks are run during critical stages of Velopack operations.
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.
runRuns the Velopack startup logic. This should be the first thing to run in your app.
setArgsOverride the command line arguments used by VelopackApp. (by default this is env::args().skip(1))
setAutoApplyOnStartupSet whether to automatically apply downloaded updates on startup. This is ON by default.
setLocatorVelopackLocator provides some utility functions for locating the current app important paths (eg. path to packages, update binary, and so forth).
setLoggerSet a callback to receive log messages from VelopackApp.
buildBuild a new VelopackApp instance.

onAfterInstallFastCallback(callback)

onAfterInstallFastCallback(callback: VelopackHook): VelopackApp

WARNING: FastCallback hooks are run during critical stages of Velopack operations. Your code will be run and then the process will exit. 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
callbackVelopackHook

Returns VelopackApp

onAfterUpdateFastCallback(callback)

onAfterUpdateFastCallback(callback: VelopackHook): VelopackApp

WARNING: FastCallback hooks are run during critical stages of Velopack operations. Your code will be run and then the process will exit. 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
callbackVelopackHook

Returns VelopackApp

onBeforeUninstallFastCallback(callback)

onBeforeUninstallFastCallback(callback: VelopackHook): VelopackApp

WARNING: FastCallback hooks are run during critical stages of Velopack operations. Your code will be run and then the process will exit. 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
callbackVelopackHook

Returns VelopackApp

onBeforeUpdateFastCallback(callback)

onBeforeUpdateFastCallback(callback: VelopackHook): VelopackApp

WARNING: FastCallback hooks are run during critical stages of Velopack operations. Your code will be run and then the process will exit. 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
callbackVelopackHook

Returns VelopackApp

onFirstRun(callback)

onFirstRun(callback: VelopackHook): VelopackApp

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

Parameters

NameTypeDescription
callbackVelopackHook

Returns VelopackApp

onRestarted(callback)

onRestarted(callback: VelopackHook): VelopackApp

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

Parameters

NameTypeDescription
callbackVelopackHook

Returns VelopackApp

run()

run(): void

Runs the Velopack startup logic. This should be the first thing to run in your app. In some circumstances it may terminate/restart the process to perform tasks.

Returns void

setArgs(args)

setArgs(args: string[]): VelopackApp

Override the command line arguments used by VelopackApp. (by default this is env::args().skip(1))

Parameters

NameTypeDescription
argsstring[]

Returns VelopackApp

setAutoApplyOnStartup(autoApply)

setAutoApplyOnStartup(autoApply: boolean): VelopackApp

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

Parameters

NameTypeDescription
autoApplyboolean

Returns VelopackApp

setLocator(locator)

setLocator(locator: VelopackLocatorConfig): VelopackApp

VelopackLocator provides some utility functions for locating the current app important paths (eg. path to packages, update binary, and so forth).

Parameters

NameTypeDescription
locatorVelopackLocatorConfig

Returns VelopackApp

setLogger(callback)

setLogger(callback: object): VelopackApp

Set a callback to receive log messages from VelopackApp.

Parameters

NameTypeDescription
callbackobject

Returns VelopackApp

build()

build(): VelopackApp

static

Build a new VelopackApp instance.

Returns VelopackApp


Generated from velopack 1.1.1