From 6f764ab637b0b4beeaf2e6a0d8905aaff0491c1d Mon Sep 17 00:00:00 2001 From: Mark Peek Date: Wed, 12 Jun 2024 09:49:44 -0700 Subject: [PATCH 1/5] [dev] allow the use of FreeBSD bhyve virtual disks * Closes #2504. --- src/dev.c | 1 + src/rufus.rc | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/dev.c b/src/dev.c index fa405c42..8e367636 100644 --- a/src/dev.c +++ b/src/dev.c @@ -287,6 +287,7 @@ static __inline BOOL IsVHD(const char* buffer) "Arsenal_________Virtual_", "KernSafeVirtual_________", "Msft____Virtual_Disk____", + "BHYVE__________SATA_DISK", "VMware__VMware_Virtual_S" // Enabled through a cheat mode, as this lists primary disks on VMWare instances }; diff --git a/src/rufus.rc b/src/rufus.rc index 3d7d9a91..7c0de96e 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 4.6.2182" +CAPTION "Rufus 4.6.2183" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -397,8 +397,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,6,2182,0 - PRODUCTVERSION 4,6,2182,0 + FILEVERSION 4,6,2183,0 + PRODUCTVERSION 4,6,2183,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -416,13 +416,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.6.2182" + VALUE "FileVersion", "4.6.2183" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "� 2011-2024 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.6.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.6.2182" + VALUE "ProductVersion", "4.6.2183" END END BLOCK "VarFileInfo" From 7c6dbdc1cef5a300cb798c1007b6f06545f3118f Mon Sep 17 00:00:00 2001 From: wallrik Date: Thu, 27 Jun 2024 21:40:39 +0200 Subject: [PATCH 2/5] [msic] update Windows To Go docs link * Old link is still fine, but we might as well point to the Windows 10 version. * Closes #2511. --- src/rufus.rc | 10 +++++----- src/wue.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/rufus.rc b/src/rufus.rc index 7c0de96e..3b9f9cfb 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 4.6.2183" +CAPTION "Rufus 4.6.2184" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -397,8 +397,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,6,2183,0 - PRODUCTVERSION 4,6,2183,0 + FILEVERSION 4,6,2184,0 + PRODUCTVERSION 4,6,2184,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -416,13 +416,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.6.2183" + VALUE "FileVersion", "4.6.2184" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "� 2011-2024 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.6.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.6.2183" + VALUE "ProductVersion", "4.6.2184" END END BLOCK "VarFileInfo" diff --git a/src/wue.c b/src/wue.c index 150b2ba8..78bca00b 100644 --- a/src/wue.c +++ b/src/wue.c @@ -631,7 +631,7 @@ out: /// /// Setup a Windows To Go drive according to the official Microsoft instructions detailed at: -/// https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-8.1-and-8/jj721578(v=ws.11). +/// https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/deployment/windows-to-go/deploy-windows-to-go /// Note that as opposed to the technet guide above we use bcdedit rather than 'unattend.xml' /// to disable the recovery environment. /// From 6d29120b38c68b76abb6ed8d8a6ad8e0af21b6af Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Mon, 8 Jul 2024 13:13:21 +0100 Subject: [PATCH 3/5] [wue] add 'Local' to the list of disallowed local account names * Closes #2493. * Also add 'KRBTGT' as it is mentioned at https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/manage/understand-default-user-accounts#default-local-accounts-in-active-directory along with 'Administrator' and 'Guest' and is probably disallowed too. --- src/rufus.rc | 10 +++++----- src/wue.c | 9 +++++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/rufus.rc b/src/rufus.rc index 3b9f9cfb..4b5cd975 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 4.6.2184" +CAPTION "Rufus 4.6.2185" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -397,8 +397,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,6,2184,0 - PRODUCTVERSION 4,6,2184,0 + FILEVERSION 4,6,2185,0 + PRODUCTVERSION 4,6,2185,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -416,13 +416,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.6.2184" + VALUE "FileVersion", "4.6.2185" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "� 2011-2024 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.6.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.6.2184" + VALUE "ProductVersion", "4.6.2185" END END BLOCK "VarFileInfo" diff --git a/src/wue.c b/src/wue.c index 78bca00b..b81fd61b 100644 --- a/src/wue.c +++ b/src/wue.c @@ -60,10 +60,11 @@ extern StrArray modified_files; /// The path of a newly created answer file on success or NULL on error. char* CreateUnattendXml(int arch, int flags) { + const static char* xml_arch_names[5] = { "x86", "amd64", "arm", "arm64" }; + const static char* unallowed_account_names[] = { "Administrator", "Guest", "KRBTGT", "Local" }; static char path[MAX_PATH]; FILE* fd; int i, order; - const char* xml_arch_names[5] = { "x86", "amd64", "arm", "arm64" }; unattend_xml_flags = flags; if (arch < ARCH_X86_32 || arch > ARCH_ARM_64 || flags == 0) { uprintf("Note: No Windows User Experience options selected"); @@ -150,10 +151,10 @@ char* CreateUnattendXml(int arch, int flags) fprintf(fd, " \n"); } if (flags & UNATTEND_SET_USER) { - if ((unattend_username[0] == 0) || (stricmp(unattend_username, "Administrator") == 0) || - (stricmp(unattend_username, "Guest") == 0)) { + for (i = 0; (i < ARRAYSIZE(unallowed_account_names)) && (stricmp(unattend_username, unallowed_account_names[i]) != 0); i++); + if (i < ARRAYSIZE(unallowed_account_names)) { uprintf("WARNING: '%s' is not allowed as local account name - Option ignored", unattend_username); - } else { + } else if (unattend_username[0] != 0) { uprintf("• Use '%s' for local account name", unattend_username); // If we create a local account in unattend.xml, then we can get Windows 11 // 22H2 to skip MSA even if the network is connected during installation. From 83b1e7306242884416beac23e0d977725897e217 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Mon, 8 Jul 2024 13:22:37 +0100 Subject: [PATCH 4/5] [dev] add exception for Samsung uSD Card devices * Closes #2506. --- src/dev.c | 6 +++--- src/hdd_vs_ufd.h | 1 + src/rufus.rc | 10 +++++----- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/dev.c b/src/dev.c index 8e367636..b223b4bb 100644 --- a/src/dev.c +++ b/src/dev.c @@ -416,9 +416,9 @@ BOOL GetOpticalMedia(IMG_SAVE* img_save) /* For debugging user reports of HDDs vs UFDs */ //#define FORCED_DEVICE #ifdef FORCED_DEVICE -#define FORCED_VID 0x23A9 -#define FORCED_PID 0xEF18 -#define FORCED_NAME "SCSI DISK USB Device" +#define FORCED_VID 0x04E8 +#define FORCED_PID 0x61ED +#define FORCED_NAME "Samsung uSD Card Reader USB Device" #endif void ClearDrives(void) diff --git a/src/hdd_vs_ufd.h b/src/hdd_vs_ufd.h index 484e8dbf..e239cb9d 100644 --- a/src/hdd_vs_ufd.h +++ b/src/hdd_vs_ufd.h @@ -91,6 +91,7 @@ static str_score_t str_adjust[] = { { "Gadget", -10 }, { "Flash", -10 }, { "SD-CARD", -10 }, + { "uSD Card", -10 }, { "HDD", +20 }, { "SATA", +20 }, { "SCSI", +20 }, diff --git a/src/rufus.rc b/src/rufus.rc index 4b5cd975..186c7a76 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 4.6.2185" +CAPTION "Rufus 4.6.2186" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -397,8 +397,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,6,2185,0 - PRODUCTVERSION 4,6,2185,0 + FILEVERSION 4,6,2186,0 + PRODUCTVERSION 4,6,2186,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -416,13 +416,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.6.2185" + VALUE "FileVersion", "4.6.2186" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "� 2011-2024 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.6.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.6.2185" + VALUE "ProductVersion", "4.6.2186" END END BLOCK "VarFileInfo" From 10d33c66588bd31070ddc3b45deb1cd83c0aeae0 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Mon, 8 Jul 2024 13:56:15 +0100 Subject: [PATCH 5/5] [wue] add TimeZone to regional options replication * Closes #2499. --- src/rufus.rc | 10 +++++----- src/wue.c | 6 ++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/rufus.rc b/src/rufus.rc index 186c7a76..007cbedb 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 4.6.2186" +CAPTION "Rufus 4.6.2187" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -397,8 +397,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,6,2186,0 - PRODUCTVERSION 4,6,2186,0 + FILEVERSION 4,6,2187,0 + PRODUCTVERSION 4,6,2187,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -416,13 +416,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.6.2186" + VALUE "FileVersion", "4.6.2187" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "� 2011-2024 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.6.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.6.2186" + VALUE "ProductVersion", "4.6.2187" END END BLOCK "VarFileInfo" diff --git a/src/wue.c b/src/wue.c index b81fd61b..2cb78396 100644 --- a/src/wue.c +++ b/src/wue.c @@ -31,6 +31,7 @@ #include "resource.h" #include "registry.h" #include "msapi_utf8.h" +#include "timezoneapi.h" #include "localization.h" /* Memory leaks detection - define _CRTDBG_MAP_ALLOC as preprocessor macro */ @@ -64,6 +65,7 @@ char* CreateUnattendXml(int arch, int flags) const static char* unallowed_account_names[] = { "Administrator", "Guest", "KRBTGT", "Local" }; static char path[MAX_PATH]; FILE* fd; + TIME_ZONE_INFORMATION tz_info; int i, order; unattend_xml_flags = flags; if (arch < ARCH_X86_32 || arch > ARCH_ARM_64 || flags == 0) { @@ -199,6 +201,10 @@ char* CreateUnattendXml(int arch, int flags) ReadRegistryKeyStr(REGKEY_HKCU, "Keyboard Layout\\Preload\\1")); fprintf(fd, " %s\n", ToLocaleName(GetSystemDefaultLCID())); fprintf(fd, " %s\n", ToLocaleName(GetUserDefaultLCID())); + if (GetTimeZoneInformation(&tz_info) == TIME_ZONE_ID_INVALID) + uprintf("WARNING: Could not retrieve current timezone: %s", WindowsErrorString()); + else + fprintf(fd, " %S\n", tz_info.StandardName); fprintf(fd, " %s\n", ToLocaleName(GetUserDefaultUILanguage())); fprintf(fd, " %s\n", // NB: Officially, this is a REG_MULTI_SZ string