Commit Graph

23 Commits

Author SHA1 Message Date
Pete Batard dd8314b2f0
[ui] add runtime UEFI media validation as a selectable advanced option
* Also add Ctrl-A as a new cheat-mode to toggle the use of Rufus MBR (which is enabled by default)
  which replaces the previous UI checkbox. The Disk ID field is now completely removed as we now
  use the default values for XP and non XP installs, and will expect people with multiple disks to
  disconnect all except the one where they plan to install Windows.
2024-04-02 17:18:06 +01:00
Pete Batard 8a5a5a318a
[misc] improve readability of error code handling
* Also don't pass a read size value in WriteFileWithRetry() if we don't use it.
2024-04-01 02:16:41 +01:00
Pete Batard 52ca79816f
[md5sum] Add md5sum.txt creation and runtime UEFI validation
* This allows *runtime* validation of UEFI bootable media, such as Windows
  or Linux installers, which, considering the unreliability of USB flash
  drives, we assert is a a much better proposal than write-time validation
  that utilities like balenaEcther (and to a lesser extent MCT) provide.
* Based on uefi-md5sum (https://github.com/pbatard/uefi-md5sum).
* Unconditionally activated on ISO extraction for GPT targets for now.
  This will be changed to a user selectable option later.
2024-03-29 00:48:05 +00:00
Pete Batard 0f23c47184
[misc] refactor partition creation 2024-02-08 14:17:03 +00:00
Pete Batard c5ad16fdeb
[wue] add an expert feature to restrict a Windows installation to S Mode
* This is placed behind an expert wall (Ctrl-Alt-E) on account that:
  - If you happen to boot a Windows To Go drive in S Mode on a computer, it may set any
    existing Windows installation there to S Mode as well, *even if their disk is offline!*
  - It can be *exceedingly* tricky to get out of S Mode, as the SkuPolicyRequired registry
    trick alone may not be enough (i.e. You can have very much a Windows install in S Mode
    *without* SkuPolicyRequired being set anywhere).
* Also set version to rufus-next and fix a ChangeLog typo.
2023-08-15 11:15:16 +01:00
Pete Batard 64e85ed09a
[uefi] don't revoke Windows 11 or post Windows 10 20H1 boot media yet
* As opposed to what we originally asserted, Microsoft did enact a blanket revocation
  in SkuSiPolicy.p7b for all post 1703 up to 2305 Windows UEFI bootloaders.
* As a result, unconditionally copying SkuSiPolicy.p7b will result in media as recent
  as Windows 11 22H2 (v1) being flagged as revoked, which we don't want to enforce as
  long as Microsoft themselves haven't entered the enforcing phase of their Black
  Lotus mitigation (currently planned for early 2024).
* Because of this, while we add some revocation detection for post 1703 bootloaders,
  we set it to only go as far as 20H1 for now, which means that all post 20H1 Windows
  10 media and all Windows 11 media will not yet be flagged by Rufus as revoked and
  will still boot in a Secure Boot environment due to lack of an SkuSiPolicy.p7b.
* Ultimately, per #2244 we may look for a BOOTMGRSECURITYVERSIONNUMBER resource to
  blanket revoke all post 1703 - pre 2305 Windows UEFI bootloaders.
* Also remove the now unused comdlg32 library from the linker.
2023-07-15 23:20:59 +02:00
Pete Batard 5bbcba8534
[vhd] add write support for .vhdx and .ffu images
* Also move VHD mounting function calls from iso.c to vhd.c and remove unused VHD footer elements.
2023-07-06 19:47:26 +01:00
Pete Batard 52a5551749
[uefi] improve revoked UEFI bootloader reporting
* Remove duplicates from Microsoft's SKUSiPolicy.p7b
* Also display the number of revoked from embedded
* Also use Microsoft's official capitalization for SKUSiPolicy.p7b's target path
2023-06-22 11:18:49 +01:00
Pete Batard c59e9209eb
[uefi] factorize SkuSiPolicy.p7b copying code and apply it for Windows To Go
* Also don't forget to credit the original authors of the PowerShell gist we derived our code from!
2023-06-19 00:04:08 +02:00
Pete Batard 30ccf24ca4
[wue] add TCGSecurityActivationDisabled when BitLocker is disabled
* Closes #2253
2023-05-30 14:42:07 +01:00
Pete Batard fffd4d1160
[misc] harden usage of uprintf()
* Passing a non-formatting buffer as first parameter of uprintf() can lead
  to an exception if this buffer happens to contain a '%' character, so
  usage of uprintf() with string buffers that may contain '%' should be
  sanitized.
* Also drop the _uprintf/_uprintfs aliases as they are no longer required.
2023-04-20 17:43:24 +01:00
Pete Batard e5f90282ed
[misc] improve Windows version detection
* Also use actual Windows major.minor when checking for updates
2023-04-17 13:33:05 +01:00
Pete Batard 21ac145a4b
[vhd] add force unmount of stale .wim images
* Required because some users appear to force kill Rufus while we're doing WUE patching of boot.wim,
  and Windows prevents a .wim with the same path and index from being mounted twice, even if the
  original .wim has become stale or deleted. Oh, and of course the WIM APIs don't have a force-mount
  flag that would take care of this whole situation.
* Basically, this forces us to parse HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WIMMount\Mounted Images
  and check each instance for a .wim/index match, so that we can access to the existing mount path
  so that we can actually unmout the image (because, in typical Microsoft fashion, WIMUnmountImage
  requires both the mount path and the source image to be provided).
* Closes #2199.
* Also improve the existing VHD code to use a struct where possible.
2023-03-08 20:00:37 +00:00
Pete Batard 12bab09a9f
[wue] display user-selected WUE options in the log
* Also fix a Coverity warning
2023-02-17 22:42:45 +00:00
Pete Batard 1ce1f47a8b
[wue] add option to Disable BitLocker automatic device encryption
* See https://learn.microsoft.com/en-us/windows-hardware/design/device-experiences/oem-bitlocker#disable-bitlocker-automatic-device-encryption
* Closes #2121
2023-01-10 20:43:07 +00:00
Pete Batard c19ef1125d
[wue] allow the provision of an arbitrary local account username
* This is required because, even though it's easy to change a local account name
  post install, doing so does not change the directory name in C:\Users\
2022-10-18 13:58:38 +01:00
Pete Batard cee21b1981
[wue] prevent 'Administrator' and 'Guest' from being set as username
* These are reserved usernames that are created by default, so we should not use them.
* Also fix missing format specifier in ApplyWindowsCustomization() and make sure we
  print wim_index for both mount and unmount.
* Closes #2067 (with thanks to marcosfrm)
2022-10-15 12:24:43 +01:00
Pete Batard 76ff620714
[ui] fix tab order not working on WUE dialog
* Also add minor improvements and update Bled to latest
2022-10-07 17:43:46 +01:00
Pete Batard 8814944c35
[wue] improve Windows version reporting from ISO/.wim
* Pick the version and build number directly from the install[.wim|.esd] XML index.
  This forces us to mount the ISO during scan, but it's the only way to get an accurate Build number...
* Also drop linking to version.dll (along with the whole version.dll delay-loading shenanigans).
2022-10-04 11:58:30 +01:00
Pete Batard fbad63666e
[wue] add fallback to index 1 if boot.wim index 2 is not available
* Some "unofficial" Windows ISOs use a custom boot.wim that only includes the Setup
  image at index 1, rather than at index 2, after the PE image, for official ISOs.
* Also refactor to add a long needed vhd.h header.
* Also fix a MinGW warning.
2022-08-02 20:14:29 +01:00
Pete Batard 2c26f838f4
[wue] enable applicable WUE options for Windows 10
* Also ensure that we print a message on the status bar while applying options.
2022-07-27 11:49:26 +01:00
Pete Batard 01dbb3d957
[wue] fix WUE options not being applied for ARM64 images
* Closes #1996
* Also set Coverity GitHub Actions workflow to use windows-latest
2022-07-25 16:48:57 +01:00
Pete Batard a19828c9d1
[wue] move WUE, Windows To Go and WinPE calls to their own source 2022-07-25 13:18:14 +01:00