From 1ce1f47a8bba6e4d2a39d4a6fb49817fa869d855 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Tue, 10 Jan 2023 20:43:07 +0000 Subject: [PATCH] [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 --- src/rufus.c | 2 ++ src/rufus.h | 7 ++++--- src/rufus.rc | 10 +++++----- src/wue.c | 9 ++++++++- 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/rufus.c b/src/rufus.c index 0b9f9f52..997f34ac 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -1595,6 +1595,8 @@ static DWORD WINAPI BootCheckThread(LPVOID param) MAP_BIT(UNATTEND_DUPLICATE_LOCALE); StrArrayAdd(&options, lmprintf(MSG_331), TRUE); MAP_BIT(UNATTEND_NO_DATA_COLLECTION); + StrArrayAdd(&options, lmprintf(MSG_335), TRUE); + MAP_BIT(UNATTEND_DISABLE_BITLOCKER); i = CustomSelectionDialog(BS_AUTOCHECKBOX, lmprintf(MSG_327), lmprintf(MSG_328), options.String, options.Index, remap8(unattend_xml_mask, map, FALSE), username_index); StrArrayDestroy(&options); diff --git a/src/rufus.h b/src/rufus.h index 581308f3..90d2de74 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -1,6 +1,6 @@ /* * Rufus: The Reliable USB Formatting Utility - * Copyright © 2011-2022 Pete Batard + * Copyright © 2011-2023 Pete Batard * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -507,14 +507,15 @@ enum ArchType { #define UNATTEND_OFFLINE_INTERNAL_DRIVES 0x00010 #define UNATTEND_DUPLICATE_LOCALE 0x00020 #define UNATTEND_SET_USER 0x00040 -#define UNATTEND_DEFAULT_MASK 0x0007F +#define UNATTEND_DISABLE_BITLOCKER 0x00080 +#define UNATTEND_DEFAULT_MASK 0x000FF #define UNATTEND_WINDOWS_TO_GO 0x10000 // Special flag for Windows To Go #define UNATTEND_WINPE_SETUP_MASK (UNATTEND_SECUREBOOT_TPM_MINRAM) #define UNATTEND_SPECIALIZE_DEPLOYMENT_MASK (UNATTEND_NO_ONLINE_ACCOUNT) #define UNATTEND_OOBE_SHELL_SETUP_MASK (UNATTEND_NO_DATA_COLLECTION | UNATTEND_SET_USER) #define UNATTEND_OOBE_INTERNATIONAL_MASK (UNATTEND_DUPLICATE_LOCALE) -#define UNATTEND_OOBE_MASK (UNATTEND_OOBE_SHELL_SETUP_MASK | UNATTEND_OOBE_INTERNATIONAL_MASK) +#define UNATTEND_OOBE_MASK (UNATTEND_OOBE_SHELL_SETUP_MASK | UNATTEND_OOBE_INTERNATIONAL_MASK | UNATTEND_DISABLE_BITLOCKER) #define UNATTEND_OFFLINE_SERVICING_MASK (UNATTEND_OFFLINE_INTERNAL_DRIVES) #define UNATTEND_DEFAULT_SELECTION_MASK (UNATTEND_SECUREBOOT_TPM_MINRAM | UNATTEND_NO_ONLINE_ACCOUNT | UNATTEND_OFFLINE_INTERNAL_DRIVES) diff --git a/src/rufus.rc b/src/rufus.rc index 6dd915de..e3493a82 100644 --- a/src/rufus.rc +++ b/src/rufus.rc @@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL IDD_DIALOG DIALOGEX 12, 12, 232, 326 STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_ACCEPTFILES -CAPTION "Rufus 3.22.1955" +CAPTION "Rufus 3.22.1956" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -396,8 +396,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,22,1955,0 - PRODUCTVERSION 3,22,1955,0 + FILEVERSION 3,22,1956,0 + PRODUCTVERSION 3,22,1956,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -415,13 +415,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "3.22.1955" + VALUE "FileVersion", "3.22.1956" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "© 2011-2023 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-3.22.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "3.22.1955" + VALUE "ProductVersion", "3.22.1956" END END BLOCK "VarFileInfo" diff --git a/src/wue.c b/src/wue.c index 1800c2b2..ef28c836 100644 --- a/src/wue.c +++ b/src/wue.c @@ -1,7 +1,7 @@ /* * Rufus: The Reliable USB Formatting Utility * Windows User Experience - * Copyright © 2022 Pete Batard + * Copyright © 2022-2023 Pete Batard * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -192,6 +192,13 @@ char* CreateUnattendXml(int arch, int flags) ReadRegistryKeyStr(REGKEY_HKLM, "SYSTEM\\CurrentControlSet\\Control\\Nls\\Language\\InstallLanguageFallback")); fprintf(fd, " \n"); } + if (flags & UNATTEND_DISABLE_BITLOCKER) { + fprintf(fd, " \n", xml_arch_names[arch]); + fprintf(fd, " true\n"); + fprintf(fd, " \n"); + } fprintf(fd, " \n"); }