1
1
Fork 0
mirror of https://github.com/pbatard/rufus.git synced 2024-08-14 23:57:05 +00:00

Compare commits

..

No commits in common. "a25af06b3c7b3fcd0b1570555938ef94cf2dea3c" and "43761aba43ec2b0279e47184bbbec67c87ba5711" have entirely different histories.

12 changed files with 73 additions and 90 deletions

View file

@ -52,7 +52,7 @@ jobs:
cov-build.exe --dir cov-int msbuild ${{ env.SOLUTION_FILE_PATH }} /m /p:Configuration=${{ env.BUILD_CONFIGURATION }},Platform=${{ env.TARGET_PLATFORM }}
- name: Publish Coverity artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v2
with:
name: cov-int
path: cov-int/

View file

@ -9,7 +9,7 @@ jobs:
lock:
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v3
- uses: dessant/lock-threads@v2
with:
github-token: ${{ github.token }}
issue-lock-inactive-days: '90'

View file

@ -88,7 +88,7 @@ jobs:
- name: Upload artifacts
if: ${{ matrix.env == 'i686' && github.event_name == 'push' }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v2
with:
name: MinGW
path: ./*.exe

View file

@ -77,7 +77,7 @@ jobs:
curl --request POST --url https://www.virustotal.com/api/v3/monitor/items --header 'x-apikey: ${{ secrets.VIRUSTOTAL_API_KEY }}' --form path='/rufus_${{ matrix.TARGET_PLATFORM }}.exe' --form file=@./rufus_${{ matrix.TARGET_PLATFORM }}.exe
- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v2
if: ${{ github.event_name == 'push' }}
with:
name: VS2022

View file

@ -13,7 +13,8 @@ o v3.20 (2022.??.??)
- *NEW* MSG_328 "Remove requirement for Secure Boot and TPM 2.0"
- *NEW* MSG_329 "Remove requirement for 4GB+ RAM and 64GB+ disk"
- *NEW* MSG_330 "Remove requirement for an online Microsoft account"
- *NEW* MSG_331 "Disable data collection (Skip privacy questions)"
- *NEW* MSG_331 "Remove \"unsupported hardware\" desktop watermark"
- *NEW* MSG_332 "Disable data collection (Skip privacy questions)"
o v3.14 (2021.03.31)
- *UPDATED* MSG_068 "Error while partitioning drive." -> "Could not partition drive."

View file

@ -588,7 +588,8 @@ t MSG_327 "Customize Windows installation?"
t MSG_328 "Remove requirement for Secure Boot and TPM 2.0"
t MSG_329 "Remove requirement for 4GB+ RAM and 64GB+ disk"
t MSG_330 "Remove requirement for an online Microsoft account"
t MSG_331 "Disable data collection (Skip privacy questions)"
t MSG_331 "Remove \"unsupported hardware\" desktop watermark"
t MSG_332 "Disable data collection (Skip privacy questions)"
#########################################################################
l "ar-SA" "Arabic (العربية)" 0x0401, 0x0801, 0x0c01, 0x1001, 0x1401, 0x1801, 0x1c01, 0x2001, 0x2401, 0x2801, 0x2c01, 0x3001, 0x3401, 0x3801, 0x3c01, 0x4001

View file

@ -807,10 +807,8 @@ BOOL GetDevices(DWORD devnum)
continue;
if ((props.vid == 0x0781) && (props.pid == 0x75a0))
continue;
if ((props.vid == 0x10d6) && (props.pid == 0x1101))
continue;
}
// Also ignore USB devices that have been specifically flagged by the user
// Also ignore USB devices that have been specifically flaggged by the user
for (s = 0; s < ARRAYSIZE(ignore_vid_pid); s++) {
if ((props.vid == (ignore_vid_pid[s] >> 16)) && (props.pid == (ignore_vid_pid[s] & 0xffff))) {
uprintf("Ignoring '%s' (%s), per user settings", buffer, str);

View file

@ -1250,11 +1250,11 @@ out:
// Returns -2 on user cancel, -1 on other error, >=0 on success.
int SetWinToGoIndex(void)
{
char *mounted_iso, *val, mounted_image_path[128];
char *mounted_iso, *build, mounted_image_path[128];
char xml_file[MAX_PATH] = "";
char *install_names[MAX_WININST];
StrArray version_name, version_index;
int i;
int i, build_nr = 0;
BOOL bNonStandard = FALSE;
// Sanity checks
@ -1334,34 +1334,21 @@ int SetWinToGoIndex(void)
else
wintogo_index = atoi(version_index.String[i - 1]);
if (i > 0) {
// Get the version data from the XML index
val = get_token_data_file_indexed("MAJOR", xml_file, i);
img_report.win_version.major = (uint16_t)safe_atoi(val);
free(val);
val = get_token_data_file_indexed("MINOR", xml_file, i);
img_report.win_version.minor = (uint16_t)safe_atoi(val);
free(val);
val = get_token_data_file_indexed("BUILD", xml_file, i);
img_report.win_version.build = (uint16_t)safe_atoi(val);
free(val);
val = get_token_data_file_indexed("SPBUILD", xml_file, i);
img_report.win_version.revision = (uint16_t)safe_atoi(val);
free(val);
if ((img_report.win_version.major == 10) && (img_report.win_version.build > 20000))
img_report.win_version.major = 11;
// If we couldn't obtain the major and build, we have a problem
if (img_report.win_version.major == 0 || img_report.win_version.build == 0)
uprintf("Warning: Could not obtain version information from XML index (Nonstandard Windows image?)");
// Get the build version
build = get_token_data_file_indexed("BUILD", xml_file, i);
if (build != NULL)
build_nr = atoi(build);
free(build);
uprintf("Will use '%s' (Build: %d, Index %s) for Windows To Go",
version_name.String[i - 1], img_report.win_version.build, version_index.String[i - 1]);
version_name.String[i - 1], build_nr, version_index.String[i - 1]);
// Need Windows 10 Creator Update or later for boot on REMOVABLE to work
if ((img_report.win_version.build < 15000) && (SelectedDrive.MediaType != FixedMedia)) {
if ((build_nr < 15000) && (SelectedDrive.MediaType != FixedMedia)) {
if (MessageBoxExU(hMainDialog, lmprintf(MSG_098), lmprintf(MSG_190),
MB_YESNO | MB_ICONWARNING | MB_IS_RTL, selected_langid) != IDYES)
wintogo_index = -2;
}
// Display a notice about WppRecorder.sys for 1809 ISOs
if (img_report.win_version.build == 17763) {
if (build_nr == 17763) {
notification_info more_info;
more_info.id = MORE_INFO_URL;
more_info.url = WPPRECORDER_MORE_INFO_URL;

View file

@ -115,22 +115,6 @@ static __inline int _log2(register int val)
return ret;
}
// Remap bits from a byte according to an 8x8 bit matrix
static __inline uint8_t remap8(uint8_t src, uint8_t* map, const BOOL reverse)
{
uint8_t i, m = 1, r = 0;
for (i = 0, m = 1; i < 8; i++, m <<= 1) {
if (reverse) {
if (src & map[i])
r |= m;
} else {
if (src & m)
r |= map[i];
}
}
return r;
}
/* Why oh why does Microsoft have to make everybody suffer with their braindead use of Unicode? */
#define _RT_ICON MAKEINTRESOURCEA(3)
#define _RT_DIALOG MAKEINTRESOURCEA(5)

View file

@ -63,11 +63,12 @@ enum bootcheck_return {
#define UNATTEND_SECUREBOOT_TPM_MASK 0x01
#define UNATTEND_MINRAM_MINDISK_MASK 0x02
#define UNATTEND_NO_ONLINE_ACCOUNT_MASK 0x04
#define UNATTEND_NO_DATA_COLLECTION_MASK 0x08
#define UNATTEND_REMOVE_WATERMARK_MASK 0x08
#define UNATTEND_NO_DATA_COLLECTION_MASK 0x10
#define UNATTEND_WINPE_SETUP_MASK (UNATTEND_SECUREBOOT_TPM_MASK | UNATTEND_MINRAM_MINDISK_MASK)
#define UNATTEND_SPECIALIZE_DEPLOYMENT_MASK (UNATTEND_NO_ONLINE_ACCOUNT_MASK)
#define UNATTEND_OOBE_SHELL_SETUP (UNATTEND_NO_DATA_COLLECTION_MASK)
#define UNATTEND_SPECIALIZE_DEPLOYMENT_MASK (UNATTEND_NO_ONLINE_ACCOUNT_MASK | UNATTEND_REMOVE_WATERMARK_MASK)
#define UNATTEND_OOBE_SHELL_SETUP (UNATTEND_REMOVE_WATERMARK_MASK | UNATTEND_NO_DATA_COLLECTION_MASK)
static const char* cmdline_hogger = "rufus.com";
static const char* ep_reg = "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer";
@ -88,7 +89,8 @@ static BOOL allowed_filesystem[FS_MAX] = { 0 };
static int64_t last_iso_blocking_status;
static int selected_pt = -1, selected_fs = FS_UNKNOWN, preselected_fs = FS_UNKNOWN;
static int image_index = 0, select_index = 0;
static int unattend_xml_mask = (UNATTEND_SECUREBOOT_TPM_MASK | UNATTEND_NO_ONLINE_ACCOUNT_MASK);
static int unattend_xml_mask = (UNATTEND_SECUREBOOT_TPM_MASK | UNATTEND_NO_ONLINE_ACCOUNT_MASK |
UNATTEND_REMOVE_WATERMARK_MASK);
static RECT relaunch_rc = { -65536, -65536, 0, 0};
static UINT uMBRChecked = BST_UNCHECKED;
static HANDLE format_thread = NULL;
@ -1264,6 +1266,7 @@ static char* CreateUnattendXml(int arch, int mask)
static char path[MAX_PATH];
FILE* fd;
int i, order;
// I don't believe there's a version of Windows 11 for ARM32 but whatever...
const char* xml_arch_names[5] = { "x86", "amd64", "arm", "arm64" };
const char* bypass_name[4] = { "BypassTPMCheck", "BypassSecureBootCheck", "BypassRAMCheck", "BypassStorageCheck" };
if (arch < ARCH_X86_32 || arch >= ARCH_ARM_64 || mask == 0)
@ -1308,6 +1311,7 @@ static char* CreateUnattendXml(int arch, int mask)
fprintf(fd, " </settings>\n");
}
// This part and some of OOBE was picked from https://github.com/AveYo/MediaCreationTool.bat/blob/main/bypass11/AutoUnattend.xml
if (mask & UNATTEND_SPECIALIZE_DEPLOYMENT_MASK) {
order = 1;
fprintf(fd, " <settings pass=\"specialize\">\n");
@ -1315,13 +1319,22 @@ static char* CreateUnattendXml(int arch, int mask)
"xmlns:wcm=\"http://schemas.microsoft.com/WMIConfig/2002/State\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
"publicKeyToken=\"31bf3856ad364e35\" versionScope=\"nonSxS\">\n", xml_arch_names[arch]);
fprintf(fd, " <RunSynchronous>\n");
// This part was picked from https://github.com/AveYo/MediaCreationTool.bat/blob/main/bypass11/AutoUnattend.xml
if (mask & UNATTEND_NO_ONLINE_ACCOUNT_MASK) {
fprintf(fd, " <RunSynchronousCommand wcm:action=\"add\">\n");
fprintf(fd, " <Order>%d</Order>\n", order++);
fprintf(fd, " <Path>reg add HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\OOBE /v BypassNRO /t REG_DWORD /d 1 /f</Path>\n");
fprintf(fd, " </RunSynchronousCommand>\n");
}
if (mask & UNATTEND_SPECIALIZE_DEPLOYMENT_MASK) {
fprintf(fd, " <RunSynchronousCommand wcm:action=\"add\">\n");
fprintf(fd, " <Order>%d</Order>\n", order++);
fprintf(fd, " <Path>reg add HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\WindowsUpdate /v TargetReleaseVersion /t REG_DWORD /d 1 /f</Path>\n");
fprintf(fd, " </RunSynchronousCommand>\n");
fprintf(fd, " <RunSynchronousCommand wcm:action=\"add\">\n");
fprintf(fd, " <Order>%d</Order>\n", order++);
fprintf(fd, " <Path>reg add HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\WindowsUpdate /v TargetReleaseVersionInfo /t REG_SZ /d 25H1 /f</Path>\n");
fprintf(fd, " </RunSynchronousCommand>\n");
}
fprintf(fd, " </RunSynchronous>\n");
fprintf(fd, " </component>\n");
fprintf(fd, " </settings>\n");
@ -1333,6 +1346,18 @@ static char* CreateUnattendXml(int arch, int mask)
fprintf(fd, " <component name=\"Microsoft-Windows-Shell-Setup\" processorArchitecture=\"%s\" language=\"neutral\" "
"xmlns:wcm=\"http://schemas.microsoft.com/WMIConfig/2002/State\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
"publicKeyToken=\"31bf3856ad364e35\" versionScope=\"nonSxS\">\n", xml_arch_names[arch]);
if (mask & UNATTEND_REMOVE_WATERMARK_MASK) {
fprintf(fd, " <FirstLogonCommands>\n");
fprintf(fd, " <SynchronousCommand wcm:action=\"add\">\n");
fprintf(fd, " <Order>%d</Order>\n", order++);
fprintf(fd, " <CommandLine>reg add \"HKCU\\Control Panel\\UnsupportedHardwareNotificationCache\" /v SV1 /t REG_DWORD /d 0 /f</CommandLine>\n");
fprintf(fd, " </SynchronousCommand>\n");
fprintf(fd, " <SynchronousCommand wcm:action=\"add\">\n");
fprintf(fd, " <Order>%d</Order>\n", order++);
fprintf(fd, " <CommandLine>reg add \"HKCU\\Control Panel\\UnsupportedHardwareNotificationCache\" /v SV2 /t REG_DWORD /d 0 /f</CommandLine>\n");
fprintf(fd, " </SynchronousCommand>\n");
fprintf(fd, " </FirstLogonCommands>\n");
}
// https://docs.microsoft.com/en-us/windows-hardware/customize/desktop/unattend/microsoft-windows-shell-setup-oobe-protectyourpc
// It is really super insidous of Microsoft to call this option "ProtectYourPC", when it's really only about
// data collection. But of course, if it was called "AllowDataCollection", everyone would turn it off...
@ -1500,8 +1525,6 @@ out:
ExitThread(0);
}
#define MAP_BIT(bit) do { map[_log2(bit)] = b; b <<= 1; } while(0)
// Likewise, boot check will block message processing => use a thread
static DWORD WINAPI BootCheckThread(LPVOID param)
{
@ -1598,29 +1621,20 @@ static DWORD WINAPI BootCheckThread(LPVOID param)
default:
break;
}
if ((nWindowsVersion >= WINDOWS_8) && IS_WINDOWS_11(img_report)) {
if ((nWindowsVersion >= WINDOWS_8) && IS_WINDOWS_11(img_report) && (img_report.win_version.build >= 22500)) {
StrArray options;
int arch = _log2(img_report.has_efi >> 1);
uint8_t map[8] = { 0 }, b = 1;
StrArrayCreate(&options, 2);
if (img_report.win_version.build >= 22500) {
StrArrayAdd(&options, lmprintf(MSG_330), TRUE);
MAP_BIT(UNATTEND_NO_ONLINE_ACCOUNT_MASK);
}
StrArrayCreate(&options, 4);
StrArrayAdd(&options, lmprintf(MSG_330), TRUE);
StrArrayAdd(&options, lmprintf(MSG_331), TRUE);
MAP_BIT(UNATTEND_NO_DATA_COLLECTION_MASK);
i = SelectionDialog(BS_AUTOCHECKBOX, lmprintf(MSG_326), lmprintf(MSG_327),
options.String, options.Index, remap8(unattend_xml_mask, map, FALSE));
StrArrayAdd(&options, lmprintf(MSG_332), TRUE);
i = SelectionDialog(BS_AUTOCHECKBOX, lmprintf(MSG_326), lmprintf(MSG_327), options.String, options.Index, unattend_xml_mask >> 2);
StrArrayDestroy(&options);
if (i < 0)
goto out;
// Remap i to the correct bit positions before calling CreateUnattendXml()
i = remap8(i, map, TRUE);
i <<= 2;
unattend_xml_path = CreateUnattendXml(arch, i);
// Keep the bits we didn't process
unattend_xml_mask &= ~(remap8(0xff, map, TRUE));
// And add back the bits we did process
unattend_xml_mask |= i;
unattend_xml_mask = (unattend_xml_mask & 0x03) | (i & (~0x03));
}
} else if (target_type == TT_UEFI) {
if (!IS_EFI_BOOTABLE(img_report)) {
@ -1637,29 +1651,24 @@ static DWORD WINAPI BootCheckThread(LPVOID param)
if ((nWindowsVersion >= WINDOWS_8) && IS_WINDOWS_11(img_report)) {
StrArray options;
int arch = _log2(img_report.has_efi >> 1);
uint8_t map[8] = { 0 }, b = 1;
StrArrayCreate(&options, 4);
StrArrayCreate(&options, 5);
StrArrayAdd(&options, lmprintf(MSG_328), TRUE);
MAP_BIT(UNATTEND_SECUREBOOT_TPM_MASK);
StrArrayAdd(&options, lmprintf(MSG_329), TRUE);
MAP_BIT(UNATTEND_MINRAM_MINDISK_MASK);
if (img_report.win_version.build >= 22500) {
StrArrayAdd(&options, lmprintf(MSG_330), TRUE);
MAP_BIT(UNATTEND_NO_ONLINE_ACCOUNT_MASK);
StrArrayAdd(&options, lmprintf(MSG_331), TRUE);
}
StrArrayAdd(&options, lmprintf(MSG_331), TRUE);
MAP_BIT(UNATTEND_NO_DATA_COLLECTION_MASK);
i = SelectionDialog(BS_AUTOCHECKBOX, lmprintf(MSG_326), lmprintf(MSG_327),
options.String, options.Index, remap8(unattend_xml_mask, map, FALSE));
StrArrayAdd(&options, lmprintf(MSG_332), TRUE);
i = SelectionDialog(BS_AUTOCHECKBOX, lmprintf(MSG_326), lmprintf(MSG_327), options.String, options.Index, unattend_xml_mask);
StrArrayDestroy(&options);
if (i < 0)
goto out;
i = remap8(i, map, TRUE);
unattend_xml_path = CreateUnattendXml(arch, i);
// Remember the user preferences for the current session.
// TODO: Do we want to save the current mask as a permanent setting?
unattend_xml_mask &= ~(remap8(0xff, map, TRUE));
unattend_xml_mask |= i;
unattend_xml_mask = (unattend_xml_mask & (~0x3)) | (i & 0x03);
if (img_report.win_version.build >= 22500)
unattend_xml_mask = (unattend_xml_mask & 0x03) | (i & (~0x3));
}
} else if ( ((fs_type == FS_NTFS) && !HAS_WINDOWS(img_report) && !HAS_GRUB(img_report) &&
(!HAS_SYSLINUX(img_report) || (SL_MAJOR(img_report.sl_version) <= 5)))

View file

@ -85,7 +85,11 @@
#define STATUS_MSG_TIMEOUT 3500 // How long should cheat mode messages appear for on the status bar
#define WRITE_RETRIES 4
#define WRITE_TIMEOUT 5000 // How long we should wait between write retries (in ms)
#if defined(_DEBUG)
#define SEARCH_PROCESS_TIMEOUT 60000
#else
#define SEARCH_PROCESS_TIMEOUT 10000 // How long we should search for conflicting processes before giving up (in ms)
#endif
#define NET_SESSION_TIMEOUT 3500 // How long we should wait to connect, send or receive internet data
#define MARQUEE_TIMER_REFRESH 10 // Time between progress bar marquee refreshes, in ms
#define FS_DEFAULT FS_FAT32
@ -157,7 +161,6 @@
#define safe_release_dc(hDlg, hDC) do {if ((hDC != INVALID_HANDLE_VALUE) && (hDC != NULL)) {ReleaseDC(hDlg, hDC); hDC = NULL;}} while(0)
#define safe_sprintf(dst, count, ...) do {_snprintf(dst, count, __VA_ARGS__); (dst)[(count)-1] = 0; } while(0)
#define static_sprintf(dst, ...) safe_sprintf(dst, sizeof(dst), __VA_ARGS__)
#define safe_atoi(str) ((((char*)(str))==NULL)?0:atoi(str))
#define safe_strlen(str) ((((char*)(str))==NULL)?0:strlen(str))
#define safe_strdup _strdup
#define to_windows_path(str) do { size_t __i; for (__i = 0; __i < safe_strlen(str); __i++) if (str[__i] == '/') str[__i] = '\\'; } while(0)

View file

@ -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.19.1904"
CAPTION "Rufus 3.19.1901"
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
BEGIN
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
@ -159,7 +159,7 @@ BEGIN
DEFPUSHBUTTON "OK",IDOK,196,53,50,12
PUSHBUTTON "Cancel",IDCANCEL,254,53,50,12
CONTROL "Choice 1",IDC_SELECTION_CHOICE1,"Button",BS_AUTORADIOBUTTON | WS_GROUP,35,18,269,10,WS_EX_TRANSPARENT
CONTROL "Choice 2",IDC_SELECTION_CHOICE2,"Button",BS_AUTORADIOBUTTON | NOT WS_VISIBLE,35,31,269,10,WS_EX_TRANSPARENT
CONTROL "Choice 2",IDC_SELECTION_CHOICE2,"Button",BS_AUTORADIOBUTTON,35,31,269,10,WS_EX_TRANSPARENT
CONTROL "Choice 3",IDC_SELECTION_CHOICE3,"Button",BS_AUTORADIOBUTTON | NOT WS_VISIBLE,35,44,269,10,WS_EX_TRANSPARENT
CONTROL "Choice 4",IDC_SELECTION_CHOICE4,"Button",BS_AUTORADIOBUTTON | NOT WS_VISIBLE,35,57,269,10,WS_EX_TRANSPARENT
CONTROL "Choice 5",IDC_SELECTION_CHOICE5,"Button",BS_AUTORADIOBUTTON | NOT WS_VISIBLE,35,70,269,10,WS_EX_TRANSPARENT
@ -395,8 +395,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,19,1904,0
PRODUCTVERSION 3,19,1904,0
FILEVERSION 3,19,1901,0
PRODUCTVERSION 3,19,1901,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -414,13 +414,13 @@ BEGIN
VALUE "Comments", "https://rufus.ie"
VALUE "CompanyName", "Akeo Consulting"
VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "3.19.1904"
VALUE "FileVersion", "3.19.1901"
VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2022 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html"
VALUE "OriginalFilename", "rufus-3.19.exe"
VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "3.19.1904"
VALUE "ProductVersion", "3.19.1901"
END
END
BLOCK "VarFileInfo"