Context
Provides context information available during the workflow execution, such as built-in variables and built-in functions.
Built-in Variables
Built-in variables available in step fields. Note that when used in non-conditional fields, you need to use the template syntax, see Built-in Variables for details.
The "Permission Level" field indicates the permission level required for the corresponding path of this built-in variable when accessed.
ExitCode
WARNING
By default, the workflow will be executed in strict mode, so you need to explicitly declare to turn off strict mode in package.toml
before you can use this built-in variable normally.
Using this variable does not conform to best practices, please try to minimize its use.
The exit code of the previous step, type is integer. If the step is executed normally, its value is 0, otherwise it is not 0.
- Permission Level:
Normal
- Example Value:
0
- Example:
# Use in conditional fields
if = 'ExitCode==0'
PackageVersion
The current package version number
- Permission Level:
Normal
- Example Value:
1.0.0.0
- Example:
# Use in conditional fields
if = 'PackageVersion=="1.0.0.0"'
DefaultLocation
The default installation location of the current package
- Permission Level:
Normal
- Example Value:
C:/Users/UserName/ept/Microsoft/VSCode
- Example:
# Use in non-conditional fields
to = "${DefaultLocation}/config"
# Use in conditional fields
if = 'DefaultLocation=="C:/Users/UserName/ept/Microsoft/VSCode"'
SystemDrive
System drive letter
- Permission Level:
Sensitive
- Example Value:
C:
- Example:
# Use in non-conditional fields
to = "${SystemDrive}/Windows/system32"
# Use in conditional fields
if = 'SystemDrive=="C:"'
Home
User's home directory
- Permission Level:
Important
- Example Value:
C:/Users/UserName
- Example:
# Use in non-conditional fields
to = "${Home}/Document"
# Use in conditional fields
if = 'Home=="C:/Users/UserName"'
AppData
Application data directory
WARNING
Note: This variable and the %appdata%
variable within the Windows system represent different directory locations, and it will not automatically append Roaming
at the end.
- Permission level:
Sensitive
- Example value:
C:/Users/UserName/AppData
- Example:
# Use in non-conditional fields
to = "${AppData}/Roaming/Microsoft/Windows/Start Menu"
# Use in conditional fields
if = 'AppData=="C:/Users/UserName/AppData"'
ProgramFiles_X64
ProgramFiles directory
- Permission level:
Sensitive
- Example value:
C:/Program Files
- Example:
# Use in non-conditional fields
to = "${ProgramFiles_X64}/Microsoft/Windows"
# Use in conditional fields
if = 'ProgramFiles_X64=="C:/Program Files"'
ProgramFiles_X86
ProgramFiles (x86) directory
- Permission level:
Sensitive
- Example value:
C:/Program Files (x86)
- Example:
# Use in non-conditional fields
to = "${ProgramFiles_X86}/Microsoft"
# Use in conditional fields
if = 'ProgramFiles_X86=="C:/Program Files (x86)"'
Desktop
Current user's desktop directory
- Permission level:
Important
- Example value:
C:/Users/UserName/Desktop
- Example:
# Use in non-conditional fields
to = "${Desktop}"
# Use in conditional fields
if = 'Desktop=="C:/Users/UserName/Desktop"'
PublicDesktop
Public desktop directory
- Permission level:
Important
- Example value:
C:/Users/Public/Desktop
- Example:
# Use in non-conditional fields
to = "${PublicDesktop}"
# Use in conditional fields
if = 'PublicDesktop=="C:/Users/Public/Desktop"'
Arch
Runtime system architecture, possible values: X64
X86
ARM64
- Permission level:
Normal
- Example value:
X64
- Example:
# Use in conditional fields
if = 'Arch=="X64"'
Built-in Functions
Built-in variables available for conditional statements in steps. The built-in variables provided in the current version are simple functions that take String
as input and output Bool
.
Exist
Checks if a file or directory pointed to by a certain path exists.
- Input validation: Requires a valid path
- Example:
if = 'Exist("${SystemDrive}/Windows")'
- Permissions:
- Type:
fs_read
- Level: Determined by the input path
IsAlive
Checks if a certain process is running.
- Input validation: Must end with
.exe
- Example:
if = 'IsAlive("code.exe")'
- Permissions:
IsDirectory
Checks if a certain path points to a directory.
- Input validation: Requires a valid path
- Example:
if = 'IsDirectory("${SystemDrive}/Windows")'
- Permissions:
- Type:
fs_read
- Level: Determined by the input path
IsInstalled
Checks if a certain package has been installed by ept.
- Input validation: Must match the pattern 'SCOPE/NAME'
- Example:
if = 'IsInstalled("Microsoft/VSCode")'
- Permissions: