Interface IEnvironmentBuilder
- Namespace
- ZeroInstall.Services.Executors
- Assembly
- ZeroInstall.Services.dll
Fluent-style builder for a process execution environment.
public interface IEnvironmentBuilder
Methods
AddArguments(params string[])
Appends user specified arguments to the command-line.
IEnvironmentBuilder AddArguments(params string[] arguments)
Parameters
argumentsstring[]
Returns
- IEnvironmentBuilder
The execution environment. Reference to self for fluent API use.
AddWrapper(string?)
Instead of executing the selected program directly, pass it as an argument to this program. Useful for debuggers. May contain command-line arguments. Whitespaces must be escaped!
IEnvironmentBuilder AddWrapper(string? wrapper)
Parameters
wrapperstring
Returns
- IEnvironmentBuilder
The execution environment. Reference to self for fluent API use.
Exec()
Replaces the current process with the program. Does not return on success.
[DoesNotReturn]
void Exec()
Remarks
Only supported on Unix and only without a wrapper.
Exceptions
- ImplementationNotFoundException
One of the Implementations is not cached yet.
- ExecutorException
The IExecutor was unable to process the Selections.
- IOException
The exec call failed (e.g. the executable was not found).
- UnauthorizedAccessException
Write access to a file is not permitted.
SetEnvironmentVariable(string, string)
Sets an environment variable in the execution environment.
IEnvironmentBuilder SetEnvironmentVariable(string name, string value)
Parameters
namestringThe name of the environment variable.
valuestringThe value to set the environment variable to.
Returns
- IEnvironmentBuilder
The execution environment. Reference to self for fluent API use.
Start()
Starts the program.
Process? Start()
Returns
Exceptions
- ImplementationNotFoundException
One of the Implementations is not cached yet.
- ExecutorException
The IExecutor was unable to process the Selections or the main executable could not be launched.
- FileNotFoundException
Failed to find the main executable.
- IOException
Failed to start the program.
- UnauthorizedAccessException
Write access to a file is not permitted.
ToStartInfo()
Builds a ProcessStartInfo for starting the program.
ProcessStartInfo ToStartInfo()
Returns
- ProcessStartInfo
The ProcessStartInfo that can be used to start the new Process.
Exceptions
- ImplementationNotFoundException
One of the Implementations is not cached yet.
- ExecutorException
The IExecutor was unable to process the Selections.
- IOException
A problem occurred while writing a file.
- UnauthorizedAccessException
Write access to a file is not permitted.