Commit Graph

599 Commits

Author SHA1 Message Date
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 a19828c9d1
[wue] move WUE, Windows To Go and WinPE calls to their own source 2022-07-25 13:18:14 +01:00
Pete Batard c34cbab3b5
[wue] remove non-existent min disk size bypass
* Closes #1990
* Also group all of SB, TPM and min RAM into a single option and update French translation
2022-07-22 13:02:02 +01:00
Pete Batard 9073962faf
[wue] add automatic local account creation and regional settings duplication
* Local account is created with the same name as the current user along with an *empty* password
  (which we force the user to change on next logon). This is done to assuage users who might be
  weary of entering a password in a third party application, and has the benefit of enabling
  autologon when the install is complete.
* Note that the creation of a local account through an answer file prevents Windows 11 22H2
  from bugging users about MSA *even with an active network connection*.
* For convenience reasons, only duplication of the current username is enabled. We *may* add a
  dialog to enter any random username in a future version, but for 3.20, this is all you get.
* Likewise, the locale duplication is only carried out during OOBE and *not* WinPE (which means
  that you still get the initial "Windows setup language and user preferences" prompt). This is
  intentional as otherwise the default screen and "Repair Windows" options are not presented.
* It's not my fault that the Windows password change screen is super ill conceived, whereas it
  doesn't hide the current password field as it should when the current password is blank, and
  one needs to click on a very small arrow to get the changes applied, instead of a PROMINENT
  button that should intuitively have been positioned right next to "Cancel".
* If you want to complain that we should just "present the user with XYZ and be done with it",
  please bear in mind that we can't add new dialogs to Rufus as willy-nilly as you believe we
  can. *ANY* new UI interface requires major planning, which is the reason why, for the time
  being, we are limited to reusing a simple dissociated list of checkboxes for all WUE options.
2022-07-19 19:11:06 +01:00
Pete Batard 5117a3b4a8
[wue] fix MSA bypass not being applied unless SB/TPM or RAM/Disk bypass is also selected
* In a manner that defies logic, Microsoft designed Windows setup to parse Autounattend.xml
  for windowsPE tasks in the PE environment, but only carry out the copying of that file
  to %WINDIR%\Panther for subsequent processing with the other passes *IF* there exist an
  actual windowsPE section.
* In short, when using the Autounattend.xml method, Microsoft have made all passes there
  dependent on the existence of a windowsPE pass, regardless of whether that pass has any
  use or not.
* Working around this would be fine and all (just add an empty windowsPE pass so that the
  later passes get executed) if the absence of a windowsPE pass didn't also determine
  whether the user will be presented with the default Windows setup screens that include
  the "Repair your computer" option or a completely different set of screens (c.f. #1971).
* This means that, to keep users happy, we need to add yet another method to carry out
  tasks that should have remained the realm of boot.wim's Autounattend.xml, and instead
  create a \sources\$OEM$\$$\Panther\unattend.xml when there are no windowsPE tasks (on
  account that setup copies anything found under \sources\$OEM$\$$\ to %WINDIR%\).
  Only through this can we have the specialize and oobeSystem tasks actually carried out
  (for bypassing MSA requirements of skipping the data collection screens) while keeping
  the original Windows Setup look and feel.
* Closes #1981
2022-07-13 18:31:11 +01:00
Pete Batard 14f19e5275
[wue] revert to inserting the bypass registry keys directly where possible
* The use of an unattend.xml to create the TPM/Secure Boot/Disk/RAM bypass keys was
  prompted by Microsoft restricting the ability of Windows Store app from manipulating
  offline registry hives.
* However, the use of a windowsPE phase in unattend.xml to insert the keys results in
  a windows command prompt briefly appearing when setup launches, as well as slightly
  different Windows setup screens from the default.
* So we are now reverting to trying to edit the boot.wim registry hive offline (which
  should work for the non Store version of Rufus) while falling back to using a PE
  unattend section if that doesn't work.
* Closes #1971
2022-07-08 18:48:02 +01:00
Pete Batard f17e287e39
[wue] make WUE choices persist between sessions 2022-07-07 11:22:39 +01:00
Pete Batard 110f4025b7
[wue] fix Windows User Experience dialog appearing twice with Windows To Go
* Issue was introduced with the fix for #1956
* Closes #1968
* Also set rufus-next to 3.20
2022-07-05 14:09:41 +01:00
Pete Batard d457a0bafe
[ui] fix Windows 11 customization options not appearing with MBR
* Fixes #1956
2022-06-25 15:39:05 +01:00
Pete Batard e043a49fa7
[ui] add option to set internal drives offline for Windows 11 To Go
* This is enabled by default for Windows 11 images and is done to prevent the
  annoying behaviour of Windows 11 *automatically* upgrading all ReFS drives
  it sees to latest version, thereby instantly preventing you from accessing
  these drives ever again with Windows 10.
* See: https://gist.github.com/0xbadfca11/da0598e47dd643d933dc#Mountability.
2022-06-24 17:47:08 +01:00
Pete Batard a25af06b3c
[ui] drop the option to remove the "unsupported hardware" watermark
* I've never seen that watermark in the first place, therefore can't test if the option is
  working, and, as opposed to the other options, users can deal with it post install anyway.
* Also ensure that we prompt for customization when selecting an install.wim.
2022-06-24 14:27:02 +01:00
Pete Batard d0844bfc70
[misc] minor update to pollock
* Also reinstate CodeQL since github/codeql-action#850 is supposed to be fixed.
* Also fix a false Coverity warning.
2022-06-23 14:05:52 +01:00
Pete Batard a0d669232c
[ui] add a new selection dialog for Windows 11 setup customization
* This moves the extended Windows 11 options (bypass TPM & Secure Boot) away from
  "Image options" into a new explicit dialog, along with supplementary customization
  such as enabling offline account (for Windows 11 22H2) and skipping all data
  collection questions.
* This customization is now enacted through an unattend.xml file rather than offline
  registry manipulation, so that this *should* also work with the Windows Store version.
* Also update arch detection and rework/reorganize upcoming translation changes.
* Note: The 'Remove "unsupported hardware" desktop watermark' option is *UNTESTED*.
2022-06-23 13:34:24 +01:00
Pete Batard 9690742d91
[ui] extend SelectionDialog() to support checkbox selection 2022-06-20 13:47:43 +01:00
Pete Batard cd9d3737b1
[core] add the ability to ignore USBs through VID:PID
* This enables the provision of Registry/Settings key IgnoreUsb01 to IgnoreUsb08 where
  one can specify a USB device to ignore by providing its VID:PID as a 32-bit hex value.
* Closes #1879.
* Also update rufus.ini sample for current Rufus version.
* Also fix status display for Alt-Q.
2022-06-14 23:29:33 +01:00
Pete Batard d8af83dd14
[core] use Linux Data GUID for ext GPT partitions
* Also add an IS_EXT() macro
2022-06-08 19:37:24 +01:00
Marcos Mello 591bec3cbe
[iso] add versions 9.x for Red Hat derivative exceptions
* Closes #1943
2022-06-07 16:19:47 +01:00
Pete Batard c76327f96e
[ui] list drives by increasing order of size
* Also silence MSVC and MinGW obnoxious warnings about bidirectional Unicode characters.
2022-05-25 13:22:47 +01:00
Pete Batard f5abae6442
[core] fix Boot selection dropdown not being reset on unsupported images
* Closes #1903
2022-04-15 11:43:22 +01:00
Pete Batard d029551929
[core] drop direct hooking into dwmapi DLL and use delay-loading instead
* Now that we can delay-load DLLs for both MinGW and MSVC, we can also remove
  the direct DLL hook that was added into dwmapi.dll due to side loading and
  revert to using a direct API call instead.
* This reverts part of e1d864f755.
* Also attempt to silence that damn Coverity warning.
2022-04-12 13:55:33 +01:00
Pete Batard 0de209ee53
v3.18 (Build 1877)
* Formally disable Windows 11 bypass for Windows 7 and AppStore version since it can't be applied.
2022-03-11 16:51:59 +00:00
Matthias Kruk 23e79ad907
[iso] add Miracle Linux 8 to the list of Red Hat exceptions
* MIRACLE LINUX is a Red Hat derivative, so it needs the same special
  treatment as Red Hat, CentOS, etc to work around issues in anaconda.
* This commit adds MIRACLE LINUX to the list of Red Hat derivatives.
* Closes #1866
2022-02-11 18:47:41 +00:00
Pete Batard ebaa7d561a
[core] add file System detection from superblock
* Also prevent GitHub Actions from failing on VirusTotal upload
2022-02-04 17:41:44 +00:00
Pete Batard a47072c3c6
[ui] produce a more explicit error message when an image can't be opened/read
* Closes #1843
* Also publish Coverity artifacts since upload to Coverity seems to be broken atm.
2022-01-07 13:27:15 +00:00
Austin Wise ef2ff7179d
[msvc] add provision to prevent DLL search order hijacking through delay loading
* Hypothetically if the user's current directory contains a malicious DLL that DLL
  could be loaded instead of the one in System32.
* Whereas the previous patch should have taken care of the one DLL referenced by
  Rufus that may be vulnerable to this attack (version.dll), we nonetheless add
  delay loading for all the libraries we reference as a precautionary measure.
* One can confirm that this works by using dumpbin.exe /IMPORTS to make sure
  a specific DLL is delay loaded. Then putting a breakpoint in the delay load
  hook should also confirm that the hook is used.
* Closes #1838
2022-01-05 18:33:59 +00:00
Pete Batard c28f9bc491
[misc] fix PVS-Studio warnings 2022-01-05 12:57:26 +01:00
Pete Batard eeca1f279c
[iso] add 'inst.repo' Red-Hat workaround for CentOS Stream
* Since CentOS Stream does not use the 'CentOS-8.*' labelling scheme.
* This is a follow up to #1777.
* Also fix Windows Kit location for signing scripts.
2021-11-22 20:11:47 +00:00
Dimitri Papadopoulos d840083a32
[misc] fix typos found by codespell
* 3rd party software was left out.
* Most changes are in code comments, but one user-visible string has also been fixed.
* Closes #1817
2021-11-16 18:53:52 +00:00
Pete Batard a519e3b03b
[misc] fix console hogger not being deleted on exit
* Also update hash DB and readme for latest Grub4DOS
2021-10-23 15:14:46 +01:00
Pete Batard b30e3b387a
[efi] update UEFI:NTFS to latest
* Also remove Secure Boot notice since (outside of 32-bit ARM and exFAT)
  our bootloaders and NTFS drivers are now Secure Boot signed.
2021-10-23 02:49:15 +01:00
Pete Batard 05382d8c7d
[core] ReFS improvements
* Allow 4K/64K cluster size selection
* Only enable ReFS on relevant platforms
* Also recognize a few more Windows editions
2021-10-21 02:02:17 +01:00
Pete Batard 32b083e535
[misc] improve path display for Sylinux/GRUB resources 2021-10-21 01:59:03 +01:00
Pete Batard 1c2884ceba
[misc] fallback to using LoadLibrary() when LoadLibraryEx() fails or doesn't apply
* Per 2a3e82fa96, it looks like some Windows 7 system have trouble with
  LoadLibraryEx() if they don't have KB2533623 installed (which fixes a MAJOR Windows
  vulnerability. Some people sure want to leave their system open to hackers...).
* Work around this by adding a fallback to LoadLibrary() in GetLibraryHandle()
* Also switch to using GetLibraryHandle() in dos.c and using LoadLibrary() in sections
  where we have the full path (since these calls are not vulnerable).
2021-10-18 13:15:41 +01:00
Pete Batard 56a99e6394
[misc] use application dir for storage in portable mode
* Also improve path reporting in the log.
* Also fix MinGW warnings
2021-10-11 20:11:06 +01:00
Pete Batard 9cd7adaaaa
[iso] finalize workaround for Red Hat 8 derivatives
* See #1777
2021-10-11 17:55:46 +01:00
Pete Batard 957ec183c9
[ui] improve progress report when disabling Windows 11 installation restrictions
* Also fix Image Options content being lost when switching language.
2021-10-09 16:18:45 +01:00
Pete Batard b043db33e6
[core] add option to bypass TPM 2.0/Secure Boot/RAM requirements for Windows 11 ISOs
* If 'Extended Windows 11 Installation' mode is selected, the system registry hive of
  'sources\boot.wim' is patched to add the Setup\LabConfig registry keys that bypass
  the TPM 2.0/Secure Boot/8GB+ RAM Windows 11 system requirements.
2021-10-08 19:24:10 +01:00
Pete Batard a10b8e8c54
[iso] add Windows ISO version report
* Use sources/compatresources.dll, when available, to try to detect the Windows ISO version and build.
* Also report what facility we use for formatting.
2021-10-08 19:24:07 +01:00
Pete Batard ce8aaa99f7
[core] add VDS detection and print a notice if VDS is unavailable 2021-10-04 14:29:09 +02:00
Pete Batard c09ede16b3
[iso] add kernel options update for Red Hat derivatives
* Since version 8.2, and rhinstaller/anaconda@a766101954,
  Red Hat derivatives have changed their CD-ROM detection policy which leads to
  the installation source not being found when writing the media in ISO mode.
* Replace 'inst.stage2' by 'inst.repo' in the kernel options.
* Closes #1777 (See also rhinstaller/anaconda#rhinstaller/anaconda#3529).
* Note that this reverts part of 9c8fa40995.
2021-10-03 16:04:34 +02:00
Pete Batard deee38d4e5
[misc] fix log potentially not being saved on exit
* Also ensures that if the user deleted the directory we don't recreate it for the log.
* Also fix typos and Coverity warnings.
2021-09-19 21:01:45 +01:00
Pete Batard 8538ce0590
[misc] fix some Coverity warnings 2021-08-02 13:22:49 +01:00
Pete Batard 436584fcc0
[appstore] revert AppStore version detection to rufus.app presence check
* This basically reverts the changes from 9dfa31db03.
2021-08-01 21:50:11 +01:00
Pete Batard 41a9436649
[core] automatically save log to %LocalAppData%\Rufus\rufus.log on exit 2021-07-28 16:37:45 +01:00
Pete Batard 8ceb0045fa
[grub] update embedded GRUB to 2.06
* Also enable NTFS and ext# as GRUB2 compatible file systems.
2021-07-27 18:10:29 +01:00
longpanda 49eefa2e03
[cmp] add support for Ventoy Sparse Image (.vtsi) 2021-06-22 19:08:33 +01:00
Pete Batard 4f97cdfdc3
[ui] increase projected size to prevent persistence overflow
* If users set the persistent size to max, we may run into a situation
  where projected size (which is always a rough estimation) is too low.
* When persistence is in use, we increase the projected size by 10%, to
  ensure that the above scenario cannot happen.
* Also work around potential issues with Windows APIs when the application
  is launched from the root of a drive.
2021-06-10 17:18:40 +01:00
Pete Batard 9d7e96e293
[core] move downloads from <app_location>\rufus_files\ to %LOCALAPPDATA%\Rufus\
* While this is intended to solve the issue of saving GRUB/Syslinux files for the
  App Store version, we apply this change globally, as it allows the user to move
  the Rufus executable around while preserving access to existing downloads.
* Closes #1744
2021-05-31 16:54:11 +01:00
Pete Batard f26fd2fbe3
[fido] add additional Authenticode validation before running the script
* This basically means that the script is validate *TWICE*, using two
  completely independent signatures, before it is allowed to run, which
  should add another mitigation layer against TOCTOU (which we already
  friggin' mitigated against anyway) and other potential vectors of
  attack.
* Also remove -DisableFirstRunCustomize option and the associated cookie
  prompt monitoring, which the latest version of Fido no longer requires.
* Also update WDK version for signtool and flesh out PKI error messages.
2021-05-27 00:19:25 +01:00