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
| Method | Summary |
|---|---|
Build | Creates and returns a new Velopack application builder. |
SetArgs | Override the command line arguments used to determine the Velopack hook to run. |
SetAutoApplyOnStartup | Set whether to automatically apply downloaded updates on startup. This is ON by default. |
SetAppUserModelId | Override the Application User Model ID (AUMID) set for this process on Windows. |
SetLocator | Override the default IVelopackLocator used to search for application paths. |
SetLogger | Adds a custom logger to the Velopack application. This will be used for all Velopack diagnostic |
OnFirstRun | This hook is triggered when the application is started for the first time after installation. |
OnRestarted | This hook is triggered when the application is restarted by Velopack after installing updates. |
OnAfterInstallFastCallback | WARNING: FastCallback hooks are run during critical stages of Velopack operations. |
OnAfterUpdateFastCallback | WARNING: FastCallback hooks are run during critical stages of Velopack operations. |
OnBeforeUpdateFastCallback | WARNING: FastCallback hooks are run during critical stages of Velopack operations. |
OnBeforeUninstallFastCallback | WARNING: FastCallback hooks are run during critical stages of Velopack operations. |
Run | Runs 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
| Name | Type | Description |
|---|---|---|
args | string[] |
Returns VelopackApp
SetAutoApplyOnStartup(autoApply)
public VelopackApp SetAutoApplyOnStartup(bool autoApply)
Set whether to automatically apply downloaded updates on startup. This is ON by default.
Parameters
| Name | Type | Description |
|---|---|---|
autoApply | bool |
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
| Name | Type | Description |
|---|---|---|
aumid | string |
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
| Name | Type | Description |
|---|---|---|
locator | IVelopackLocator |
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
| Name | Type | Description |
|---|---|---|
logger | IVelopackLogger |
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
| Name | Type | Description |
|---|---|---|
hook | VelopackHook |
Returns VelopackApp
OnRestarted(hook)
public VelopackApp OnRestarted(VelopackHook hook)
This hook is triggered when the application is restarted by Velopack after installing updates.
Parameters
| Name | Type | Description |
|---|---|---|
hook | VelopackHook |
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
| Name | Type | Description |
|---|---|---|
hook | VelopackHook |
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
| Name | Type | Description |
|---|---|---|
hook | VelopackHook |
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
| Name | Type | Description |
|---|---|---|
hook | VelopackHook |
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
| Name | Type | Description |
|---|---|---|
hook | VelopackHook |
Returns VelopackApp
Run()
public void Run()
Runs the Velopack application startup code and triggers any configured hooks.
Generated from Velopack 1.1.1