namespace Titano.Setup.Cli;
/// Process exit codes of Titano.Setup (stable contract for silent deployments).
internal enum SetupExitCode
{
Success = 0,
/// Installation or removal did not complete; the setup log in %TEMP%\Titano Setup has details.
Failed = 1,
InvalidArguments = 2,
/// The installer carries no payload or the payload is damaged.
PayloadInvalid = 3,
/// All-users operation and the administrator prompt was declined.
ElevationDeclined = 4,
/// An installed program did not close when asked to.
ProgramRunning = 5,
/// /uninstall found no installation.
NotInstalled = 6,
DiskFull = 7,
/// The window was closed before anything changed.
Cancelled = 8,
///
/// Internal: an instance relaunched with administrator rights finished and asks its unelevated parent to start
/// the program, so the program does not run elevated. The parent turns it into .
///
LaunchRequested = 100,
}
/// A setup failure that maps to a specific exit code and message.
internal sealed class SetupException(SetupExitCode code, string message) : Exception(message)
{
public SetupExitCode Code { get; } = code;
}