VelopackLocator class
Namespace: Velopack.Locators
A base class describing where Velopack can find key folders and files.
public abstract class VelopackLocator : IVelopackLocator
Implements: IVelopackLocator
Constructors
| Constructor | Summary |
|---|---|
VelopackLocator |
VelopackLocator()
protected VelopackLocator()
Properties
| Property | Summary |
|---|---|
IsCurrentSet | Check if a VelopackLocator has been set for the current process. |
Current | Get the current locator in use, this process-wide locator can be set/overridden during VelopackApp.Build(). |
AppId | The unique application Id. This is used in various app paths. |
RootAppDir | The root directory of the application. On Windows, this folder contains all |
PackagesDir | The directory in which nupkg files are stored for this application. |
AppTempDir | The temporary directory for this application. |
UpdateExePath | The path to the current Update.exe or similar on other operating systems. |
AppContentDir | The directory in which versioned application files are stored. |
Channel | The release channel this package was built for. |
AppUserModelId | The Application User Model ID for this app, used for taskbar grouping and toast notifications on Windows. |
Log | The logging interface to use for Velopack diagnostic messages. |
IsPortable | A flag indicating if this is a portable build, and that the settings should be self-contained in the package. |
Process | Provides an abstraction for dealing with the dotnet Process API. This is used to start processes and |
ThisExeRelativePath | The path from AppContentDir to this executable. |
CurrentlyInstalledVersion | The currently installed version of the application, or null if the app is not installed. |
IsCurrentSet
public static bool IsCurrentSet { get; }
Check if a VelopackLocator has been set for the current process.
Current
public static IVelopackLocator Current { get; }
Get the current locator in use, this process-wide locator can be set/overridden during VelopackApp.Build(). Alternatively, most methods which use locators also accept an IVelopackLocator as a parameter.
AppId
public abstract string? AppId { get; }
The unique application Id. This is used in various app paths.
RootAppDir
public abstract string? RootAppDir { get; }
The root directory of the application. On Windows, this folder contains all the application files, but that may not be the case on other operating systems.
PackagesDir
public abstract string? PackagesDir { get; }
The directory in which nupkg files are stored for this application.
AppTempDir
public virtual string? AppTempDir { get; }
The temporary directory for this application.
UpdateExePath
public abstract string? UpdateExePath { get; }
The path to the current Update.exe or similar on other operating systems.
AppContentDir
public abstract string? AppContentDir { get; }
The directory in which versioned application files are stored.
Channel
public abstract string? Channel { get; }
The release channel this package was built for.
AppUserModelId
public virtual string? AppUserModelId { get; }
The Application User Model ID for this app, used for taskbar grouping and toast notifications on Windows.
Log
public virtual IVelopackLogger Log { get; }
The logging interface to use for Velopack diagnostic messages.
IsPortable
public virtual bool IsPortable { get; }
A flag indicating if this is a portable build, and that the settings should be self-contained in the package. On Windows, this is true for portable builds, and false for non-portable builds which were installed by Setup.exe On OSX and Linux, this is always false, because settings and application files should be stored in the user's home directory.
Process
public abstract IProcessImpl Process { get; }
Provides an abstraction for dealing with the dotnet Process API. This is used to start processes and get information about the current process.
ThisExeRelativePath
public virtual string? ThisExeRelativePath { get; }
The path from AppContentDir to this executable.
CurrentlyInstalledVersion
public abstract SemanticVersion? CurrentlyInstalledVersion { get; }
The currently installed version of the application, or null if the app is not installed.
Methods
| Method | Summary |
|---|---|
CreateDefaultForPlatform | Create a new default locator based on the current operating system. |
AddLogger | Add a logger to the list of loggers. This will be used to log messages from Velopack. |
GetLocalPackages | Finds .nupkg files in the PackagesDir and returns a list of ReleaseEntryName objects. |
GetLatestLocalFullPackage | Finds latest .nupkg file in the PackagesDir or null if not found. |
CreateSubDirIfDoesNotExist | Given a base dir and a directory name, will create a new sub directory of that name. |
GetOrCreateStagedUserId | Unique identifier for this user which is used to calculate whether this user is eligible for |
CreateDefaultForPlatform(processImpl, logger)
public static IVelopackLocator CreateDefaultForPlatform(IProcessImpl? processImpl = null, IVelopackLogger? logger = null)
Create a new default locator based on the current operating system.
Parameters
| Name | Type | Description |
|---|---|---|
processImpl | IProcessImpl | |
logger | IVelopackLogger |
Returns IVelopackLocator
AddLogger(logger)
public void AddLogger(IVelopackLogger logger)
Add a logger to the list of loggers. This will be used to log messages from Velopack.
Parameters
| Name | Type | Description |
|---|---|---|
logger | IVelopackLogger |
GetLocalPackages()
public virtual List<VelopackAsset> GetLocalPackages()
Finds .nupkg files in the PackagesDir and returns a list of ReleaseEntryName objects.
Returns List<VelopackAsset>
GetLatestLocalFullPackage()
public virtual VelopackAsset? GetLatestLocalFullPackage()
Finds latest .nupkg file in the PackagesDir or null if not found.
Returns VelopackAsset
CreateSubDirIfDoesNotExist(baseDir, newDir)
protected static string? CreateSubDirIfDoesNotExist(string? baseDir, string? newDir)
Given a base dir and a directory name, will create a new sub directory of that name. Will return null if baseDir is null, or if baseDir does not exist.
Parameters
| Name | Type | Description |
|---|---|---|
baseDir | string | |
newDir | string |
Returns string
GetOrCreateStagedUserId()
public Guid? GetOrCreateStagedUserId()
Unique identifier for this user which is used to calculate whether this user is eligible for staged roll outs.
Returns Guid?
Fields
| Field | Summary |
|---|---|
DefaultLoggingFileName | The default log file name for Velopack. |
DefaultLoggingFileName
protected const string DefaultLoggingFileName = "velopack.log"
The default log file name for Velopack.
Generated from Velopack 1.1.1