Repository navigation
Releases
WinPrep v0.2.0-alpha.2
WinPrep 0.2.0-alpha.2 fixes Audit Mode detection, which did not work on any
real Windows installation. The previous build queried a registry value name
that real Windows never writes and required a setup command line that real
systems never carry, so every machine - including genuine Audit Mode
machines - was rejected as "setup state unknown", blocking both operations.
What was wrong
Two independent defects, either of which alone broke detection:
- The detector read
StateNamefrom
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State. That name
appears in the prose of Microsoft's "Windows Setup States" documentation,
but the page's own examples - and every real installation, deployment
script, and field report - useImageState. NoStateNamevalue has
ever been observed on a real machine, so the read always came back
empty. - The detector required
HKLM\SYSTEM\Setup\CmdLineto equalaudit.exe.
On real systems that value holds whatever the setup engine queued before
logon -oobe\windeploy.exe,SetupComplete.cmd, or nothing - so the
required combination could never occur.
How detection works now
WinPrep reads the setup state from ImageState (with State.ini and the
documented StateName name as fallbacks), the audit boot flag under
HKLM\SYSTEM\Setup\Status (AuditBoot and its Windows 11-observed
AuditBootVolatile sibling), the OOBE indicator, and the session user's
SID. Audit Mode is confirmed only when the signals agree; anything missing
or contradictory stays "uncertain", and uncertain machines get no
state-changing operations. CmdLine is reported as an observation only.
The new winprep signals command prints every raw value the detector read,
where it came from, and how the state was evaluated - the evidence to attach
if a genuine Audit Mode session is ever rejected. See
docs/troubleshooting.md for the full procedure.
Also fixed in this release
- The handover fails closed when the process list cannot be read, and the
full preflight re-runs after confirmation, so a blocker that appears in
the meantime (a new account, a pending restart) stops the handover before
anything is deleted. - The cleanup refuses to traverse an approved directory that became a
symlink or junction after planning, closing a redirection attack window. - A failed cleanup can be retried in the same window; the operation lock is
released unless the reseal was initiated. - The TUI confirmation screen shows the cleanup plan it is asking about,
and several smaller TUI defects (stale notices, cancelled status check,
Ctrl+C falling into the fallback menu) are fixed. - Running WinPrep no longer creates
%ProgramData%\WinPrepon inspection
alone, so dry runs are strictly read-only.
Verification status
- Unit tests (fakes) and cross-platform checks pass on Linux; Windows
integration tests run in CI on a normally deployed Windows runner, which
must be classified as a deployed installation. The integration suite now
asserts thatImageStateis actually read - the regression guard for
defect 1. - A regression test reproducing the real-world Audit Mode machine (the
registry shape observed in field reports:ImageStateset,AuditBoot
set, noStateName, noaudit.execommand line, built-in Administrator
session) fails against the previous implementation and passes now. - What has NOT been verified: a live Windows Audit Mode session. This
release was developed without access to a real Audit Mode machine, so the
signal set is grounded in Microsoft's documentation, production deployment
tooling, and field reports (Windows 7-10 audit machines). In particular
the audit boot flag is not officially documented by Microsoft. A machine
that is genuinely in Audit Mode but lacks the expected signals is
reported as uncertain with its reasons - never guessed - and
winprep signalsproduces exactly the evidence needed to extend the
rules. - The full Windows lifecycle (real handover and verified OOBE boot) remains
unexecuted, which is why this is still a prerelease.
Upgrading
Replace winprep.exe. No configuration, manifest format, or command changes
affect existing usage; winprep signals is new.
WinPrep v0.2.0-alpha.1
WinPrep v0.2.0-alpha.1
This release narrows WinPrep to the two operations the product is actually
about, and gives the handover the demonstration-data cleanup it was missing.
It is a prerelease: automated tests and the Windows CI pipeline pass, but the
full Windows lifecycle - a real Audit Mode handover and a verified
first-time-setup boot on a reference machine - has not yet been executed.
Treat it as release-candidate quality for testing on disposable machines
first.
What changed
Removed: the hardware health checks. winprep check (storage, battery,
problem devices, activation) and winprep status are gone. Hardware
diagnostics never belonged to the preparation workflow; a refurbisher who
needs them should run a dedicated tool. WinPrep is now exactly two
operations: Prepare for Display and Clean & Finish.
Added: a real cleanup before the handover. Clean & Finish now builds an
explicit, typed plan from the demonstration profile - the built-in
Administrator's profile, resolved by SID through the registry - covering the
Downloads contents, the profile's temporary files, the browsing data of
Microsoft Edge and Google Chrome, and WinPrep's own data directory. The plan
is shown before anything is modified; one deliberate confirmation authorizes
the whole sequence; execution revalidates every path, never follows symlinks
or junctions, and verifies its results. Anything the plan could not clean
safely (a running browser, a redirected Downloads folder) is reported and
stops the handover instead of being half-done. An incomplete cleanup never
leads to a reseal.
Fixed: the confirmation now comes first. In 0.1.0 the command-line and
fallback flows removed WinPrep's own artifacts before asking for the final
confirmation, so declining still left the machine modified. One shared
operation controller now sequences the workflow identically for the menu,
the CLI, and the fallback interface: inspect, plan, confirm, clean, verify,
reseal. Cancel at any point before the confirmation and nothing has been
touched.
Changed: the Sysprep window is no longer a hard stop. Audit Mode opens
the System Preparation Tool at every sign-in; 0.1.0 treated any sysprep.exe
process as a reason to block the handover. The inspection now distinguishes
the idle window (reported as an attention item) from an active operation
(detected through freshly written Sysprep logs, which still blocks). WinPrep
never launches Sysprep while another Sysprep process exists, and it still
never closes the window for you.
Changed: extra accounts and profiles block the handover. Accounts and
profiles survive the reseal, so leftover ones would be handed to the buyer.
They now stop the handover with removal instructions instead of a warning
you could click through. WinPrep still never deletes accounts itself.
Internal: no more PowerShell. The account list is read through the SAM
management APIs, leaving Sysprep as the only external program WinPrep ever
launches.
Verification status
Verified by automated tests on Linux and the GitHub Actions Windows runner:
preflight logic, cleanup planning and execution against real filesystems,
scope containment (symlinks and junctions are removed as links, never
followed), cancellation semantics, the shared CLI/TUI workflow, and CLI
smoke tests on a real Windows installation.
Not yet verified: the full lifecycle on a physical machine in Audit Mode -
Prepare for Display across repeated restarts, a real Clean & Finish with
Sysprep, and the next boot presenting OOBE. Do not use this release on a
customer's machine without running that lifecycle test yourself on a
disposable machine first.
If Sysprep fails, the tool points to the logs under
%WINDIR%\System32\Sysprep\Panther; the same paths are listed on every
failure report.
WinPrep v0.1.0-alpha.1
WinPrep v0.1.0-alpha.1
First public build of WinPrep, a portable Windows utility for preparing,
testing, and resealing laptops for resale.
This is an alpha prerelease. The program's own validation has run, but the
full Windows lifecycle (install Windows, enter Audit Mode, run the real
handover, confirm first-time setup on the next boot) has not yet been
executed on a reference machine. Treat the handover operation as unverified
until that testing is done, and always try it on a disposable installation
first.
What is included
- Interactive terminal menu (keyboard navigation, ASCII-safe rendering,
plain fallback menu for restricted consoles) winprep status- read-only summary of the Windows installation and
setup state, with conservative multi-signal Audit Mode detectionwinprep persist- verifies a laptop in Audit Mode is ready for repeated
customer demonstrations (no system changes; Audit Mode persists by design)winprep check- read-only diagnostics: computer details, storage with
health and the Windows disk identified, battery capacity and estimated
health, Device Manager problem devices, activation state; optional report
export and Windows battery reportwinprep clean- the handover: preflight safety inspection with explicit
ready/attention/blocked verdicts, removal of WinPrep's own recorded
artifacts, deliberate confirmation, thenSysprep.exe /oobe /shutdown;
--dry-runperforms the inspection without changing anything
What has been tested
- Cross-platform unit tests over fakes (audit-state rules, preflight
verdicts, diagnostics parsing, manifest handling, CLI flows, TUI
navigation, confirmation gating, fallback menu) - Windows integration tests on a GitHub Actions Windows runner: real
registry reads, token inspection, process listing, end-to-end runs of the
executable, dry-run refusal on a deployed machine, execution from paths
with spaces - Cross-compilation from Linux for Windows/amd64
What has NOT been tested
- The real handover on an Audit Mode installation, and the resulting OOBE
behavior. A successful Sysprep launch is not proof that first-time setup
works; verify on your own machine before selling a laptop prepared with
this version. - Classic Windows Command Prompt, Windows Terminal, and PowerShell hosting
beyond what the CI runner exercises.
Supported platforms
Windows 10 and Windows 11, x64. Windows 10 is past its general support end
date; compatibility does not imply continuing security updates from
Microsoft.
Important limitations
- Resealing with Sysprep is not a factory reset and not a secure erase.
Accounts, files, and traces from preparation and customer testing remain
on the disk. - Audit Mode runs as the built-in Administrator. It is a preparation
environment, not a secure public kiosk. - WinPrep never installs drivers, removes accounts, or disables Windows
security features.
Download
WinPrep-v0.1.0-alpha.1-windows-amd64.zip contains winprep.exe, the
README, and the MIT license. Verify the download against SHA256SUMS.txt.
The archive's build provenance is attested through GitHub artifact
attestations.