SetupCommand

Wraps Windows Setup (setup.exe) with fluent builder and validation. Runs setup.exe directly via CliWrap to avoid cmd.exe path quoting issues with spaces.

[Obsolete("Use DismCommand for image deployment instead. Setup.exe /noreboot /unattend fails on Windows 11 25H2.")]
public class SetupCommand : CliWrapCommandBase<CommandResult>

1. Attributes

1.1. ObsoleteAttribute

public sealed class ObsoleteAttribute : Attribute

2. Methods

2.1. CreateCommandsResult(BufferedCommandResult)

protected override CommandResult CreateCommandsResult(BufferedCommandResult cliResult)
Table 1. Parameters
Name Type Description

cliResult

BufferedCommandResult

Returns: CommandResult

2.2. LogAllSetupErrors(ILogger)

Searches ALL drives and known paths for any setup/panther log files and dumps them.

public static void LogAllSetupErrors(ILogger logger)
Table 2. Parameters
Name Type Description

logger

ILogger

2.3. LogSetupErrors(ILogger)

Logs setup error details from well-known log file locations.

public static void LogSetupErrors(ILogger logger)
Table 3. Parameters
Name Type Description

logger

ILogger

2.4. ValidateOrThrow(string, string, ILogger)

Validates preconditions before running setup.exe.

public static void ValidateOrThrow(string setupExePath, string unattendPath, ILogger logger)
Table 4. Parameters
Name Type Description

setupExePath

string

unattendPath

string

logger

ILogger

2.5. WaitForSetupToFinish(ILogger)

Waits for Windows Setup processes (setup.exe, SetupPrep.exe, SetupHost.exe) to finish. Windows 11 25H2 spawns SetupPrep.exe from setup.exe — the parent may exit while the child continues.

public static void WaitForSetupToFinish(ILogger logger)
Table 5. Parameters
Name Type Description

logger

ILogger