Skip to content

Add Windows support, 1.2.0 - #24

Merged
NitroDiesel merged 3 commits into
mainfrom
windows-support
Nov 11, 2026
Merged

NitroDiesel merged 3 commits into
mainfrom
windows-support

Conversation

@NitroDiesel

Copy link
Copy Markdown
Owner

Rufust only ran on Linux: discovery read sysfs, writes went through udisks2 or a polkit helper, and the build failed on Windows. This adds a native Windows 10/11 (x64) build next to Linux, leaving the Linux code paths unchanged.

How

  • Shared: the Slint UI, planner, helper protocol, image analysis, Windows-media layout, answer files, and boot records.
  • Discovery (rufust-platform/src/windows.rs): disk interfaces queried with zero-access storage IOCTLs, so no elevation is needed. The disk holding Windows, the system partition, page files, and spanned volumes are marked as blocking risks, and virtual disks are never listed.
  • Privilege: the window never runs as administrator. Each operation runs in an elevated copy of rufust.exe --elevated-worker <pipe>, started through UAC. It serves one request over two single-instance, local-only named pipes, and the window accepts the pipe client only if it is that process. Cancel is a line on the control pipe.
  • Engine (rufust-helper/src/windows/):
    • revalidates the target, then locks and dismounts its volumes for the whole write;
    • partitions with IOCTL_DISK_CREATE_DISK / SET_DRIVE_LAYOUT_EX;
    • formats with Windows' FormatEx, plus a built-in large-FAT32 formatter ported from upstream's FormatLargeFAT32;
    • decodes gzip/bzip2/xz/lzma/zstd/zip in process with Rust decoders;
    • attaches VHD/VHDX read-only through virtdisk.dll;
    • builds Windows installer media with UEFI:NTFS and the BIOS boot records;
    • verifies every write.
  • Desktop: the Windows file dialog, theme from the app-mode setting, %APPDATA% settings, regional options read from Windows, and an embedded Rufus icon with an asInvoker manifest.
  • Linux: Linux-only code is gated with cfg and otherwise unchanged. Progress reporting and Windows-media planning shared by both engines moved to engine.rs.
  • Not on Windows: ext2/3/4 and ReFS creation.

Verification

  • cargo test --workspace and cargo clippy --workspace --all-targets -- -D warnings pass on Windows; clippy also passes with --target x86_64-unknown-linux-gnu.
  • scripts/windows/vhd-tests.ps1 (elevated) passes on throwaway VHDX disks. It refuses any disk that is not file-backed virtual storage. It covers:
    • NTFS/FAT32/exFAT/UDF on MBR and GPT;
    • large FAT32 on a sparse 40 GiB disk;
    • raw, gzip, and VHDX writes with read-back;
    • Windows installer media for MBR BIOS+UEFI with UEFI:NTFS, GPT UEFI, and FAT32;
    • the window's pipe launcher through a format and a cancellation.
  • Discovery and the VHD capacity preview pass under a non-administrator token.
  • The release build renders the workbench in its fixed 560×720 window, with the dark theme taken from the system.
  • New CI job Windows runs all of the above on windows-2022. The release workflow adds rufust-<version>-windows-x86_64.zip to SHA256SUMS.

Not yet done: a smoke test on physical USB media, boot tests of Windows-built media, and Authenticode signing. No version bump or release is included.

🤖 Generated with Claude Code

NitroDiesel and others added 3 commits November 11, 2026 11:03
Rufust now runs natively on Windows 10 and 11 (x64) alongside Linux. The
interface, planner, helper protocol, image analysis, Windows-media layout,
answer files, and boot records are shared; device discovery, privilege, and
the disk engine have Windows implementations.

- Discovery enumerates disk interfaces with zero-access storage IOCTLs and
  protects the disk holding Windows, the system partition, page files, and
  spanned volumes; virtual disks are never listed. Hot-plug polls disks and
  volumes.
- The window never runs as administrator. Each operation runs in an
  elevated copy of rufust.exe, approved through UAC, that serves one request
  over two private named pipes and is accepted only by its process ID.
  Cancellation is a line on the control pipe.
- The engine revalidates the target, locks and dismounts its volumes,
  partitions with the disk IOCTLs, formats with Windows' FormatEx and a
  built-in large-FAT32 formatter (after upstream's FormatLargeFAT32), decodes
  gzip/bzip2/xz/lzma/zstd/zip in process, attaches VHD/VHDX read-only, builds
  Windows installer media with UEFI:NTFS and BIOS boot records, and verifies.
- Desktop integration: the common Open dialog, the app-mode theme,
  %APPDATA% settings, regional options from Windows, and an embedded Rufus
  icon with an asInvoker manifest.
- Linux code is gated, not changed; shared progress code moved to engine.rs.

An elevated script tests the engine end to end on throwaway VHDX disks, and
CI and the release workflow gain Windows jobs producing a portable zip. The
README, project context, capability matrix, safety, architecture, building,
and a new Windows document describe the port.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The release workflow now compiles packaging/windows/rufust.iss with Inno
Setup into rufust-<version>-windows-x86_64-setup.exe next to the portable
zip. Setup installs per machine into Program Files with a Start menu entry
and uninstaller, launches the app as the original user (never elevated),
and is verified in CI by a silent install and uninstall.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1.2.0 is the first release with Windows 10 and 11 support: an installer
and a portable zip next to the Linux packages and AppImage. Bump the
workspace, app, and package versions, add the Debian, RPM, and AppStream
changelog entries, and update the release notes and project context.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@NitroDiesel NitroDiesel changed the title Add Windows support Add Windows support, 1.2.0 Nov 11, 2026
@NitroDiesel
NitroDiesel merged commit 2200419 into main Nov 11, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant