diff --git a/.github/ISSUE_TEMPLATE/issue_template.yml b/.github/ISSUE_TEMPLATE/issue_template.yml index 3d635eee..48c12ae0 100644 --- a/.github/ISSUE_TEMPLATE/issue_template.yml +++ b/.github/ISSUE_TEMPLATE/issue_template.yml @@ -21,7 +21,7 @@ body: attributes: label: Ventoy Version description: What version of ventoy are you running? - placeholder: 1.0.54 + placeholder: 1.0.55 validations: required: true - type: dropdown diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_windows.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_windows.c index e4c9aa6a..b2e986bc 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_windows.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_windows.c @@ -1049,6 +1049,7 @@ int ventoy_fill_windows_rtdata(void *buf, char *isopath) { char *pos = NULL; char *script = NULL; + const char *env = NULL; ventoy_windows_data *data = (ventoy_windows_data *)buf; grub_memset(data, 0, sizeof(ventoy_windows_data)); @@ -1087,7 +1088,13 @@ int ventoy_fill_windows_rtdata(void *buf, char *isopath) { debug("injection archive not configed %s\n", pos); } - + + env = grub_env_get("VTOY_WIN11_BYPASS_CHECK"); + if (env && env[0] == '1' && env[1] == 0) + { + data->windows11_bypass_check = 1; + } + return 0; } diff --git a/GRUB2/MOD_SRC/grub-2.04/include/grub/ventoy.h b/GRUB2/MOD_SRC/grub-2.04/include/grub/ventoy.h index 11384b25..ee76b5bd 100644 --- a/GRUB2/MOD_SRC/grub-2.04/include/grub/ventoy.h +++ b/GRUB2/MOD_SRC/grub-2.04/include/grub/ventoy.h @@ -135,7 +135,8 @@ typedef struct ventoy_windows_data { char auto_install_script[384]; char injection_archive[384]; - grub_uint8_t reserved[256]; + grub_uint8_t windows11_bypass_check; + grub_uint8_t reserved[255]; }ventoy_windows_data; diff --git a/INSTALL/Ventoy2Disk.exe b/INSTALL/Ventoy2Disk.exe index 90b024fa..6a705132 100644 Binary files a/INSTALL/Ventoy2Disk.exe and b/INSTALL/Ventoy2Disk.exe differ diff --git a/INSTALL/grub/grub.cfg b/INSTALL/grub/grub.cfg index 5c6797a9..95db8044 100644 --- a/INSTALL/grub/grub.cfg +++ b/INSTALL/grub/grub.cfg @@ -1967,7 +1967,7 @@ function img_unsupport_menuentry { ############################################################# ############################################################# -set VENTOY_VERSION="1.0.54" +set VENTOY_VERSION="1.0.55" #ACPI not compatible with Window7/8, so disable by default set VTOY_PARAM_NO_ACPI=1 diff --git a/INSTALL/ventoy/vtoyjump32.exe b/INSTALL/ventoy/vtoyjump32.exe index db8d0f28..471bbeee 100644 Binary files a/INSTALL/ventoy/vtoyjump32.exe and b/INSTALL/ventoy/vtoyjump32.exe differ diff --git a/INSTALL/ventoy/vtoyjump64.exe b/INSTALL/ventoy/vtoyjump64.exe index 9e52ce4c..6d49fa96 100644 Binary files a/INSTALL/ventoy/vtoyjump64.exe and b/INSTALL/ventoy/vtoyjump64.exe differ diff --git a/README.md b/README.md index 7994a426..fcdea684 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ You can copy many image files at a time and ventoy will give you a boot menu to x86 Legacy BIOS, IA32 UEFI, x86_64 UEFI, ARM64 UEFI and MIPS64EL UEFI are supported in the same way.
Both MBR and GPT partition style are supported in the same way.
Most type of OS supported(Windows/WinPE/Linux/Unix/ChromeOS/Vmware/Xen...)
- 740+ ISO files are tested (List). 90%+ distros in distrowatch.com supported (Details).
+ 750+ ISO files are tested (List). 90%+ distros in distrowatch.com supported (Details).

Official Website: https://www.ventoy.net @@ -52,7 +52,7 @@ VMware ESXi, Citrix XenServer, Xen XCP-ng * FAT32/exFAT/NTFS/UDF/XFS/Ext2(3)(4) supported for main partition * ISO files larger than 4GB supported * Native boot menu style for Legacy & UEFI -* Most type of OS supported, 740+ iso files tested +* Most type of OS supported, 750+ iso files tested * Linux vDisk boot supported * Not only boot but also complete installation process * Menu dynamically switchable between List/TreeView mode diff --git a/vtoyjump/vtoyjump/vtoyjump.c b/vtoyjump/vtoyjump/vtoyjump.c index aea27118..8421403d 100644 --- a/vtoyjump/vtoyjump/vtoyjump.c +++ b/vtoyjump/vtoyjump/vtoyjump.c @@ -1248,6 +1248,117 @@ static int ProcessUnattendedInstallation(const char *script) return 0; } +static int Windows11BypassCheck(const char *isofile, const char MntLetter) +{ + int Ret = 1; + DWORD dwHandle; + DWORD dwSize; + DWORD dwValue = 1; + UINT VerLen = 0; + CHAR *Buffer = NULL; + VS_FIXEDFILEINFO* VerInfo = NULL; + CHAR CheckFile[MAX_PATH]; + UINT16 Major, Minor, Build, Revision; + + Log("Windows11BypassCheck for <%s> %C:", isofile, MntLetter); + + if (FALSE == IsFileExist("%C:\\sources\\boot.wim", MntLetter) || + FALSE == IsFileExist("%C:\\sources\\compatresources.dll", MntLetter)) + { + Log("boot.wim/compatresources.dll not exist, this is not a windows install media."); + goto End; + } + + if (FALSE == IsFileExist("%C:\\sources\\install.wim", MntLetter) && + FALSE == IsFileExist("%C:\\sources\\install.esd", MntLetter)) + { + Log("install.wim/install.esd not exist, this is not a windows install media."); + goto End; + } + + sprintf_s(CheckFile, sizeof(CheckFile), "%C:\\sources\\compatresources.dll", MntLetter); + dwSize = GetFileVersionInfoSizeA(CheckFile, &dwHandle); + if (0 == dwSize) + { + Log("Failed to get file version info size: %u", LASTERR); + goto End; + } + + Buffer = malloc(dwSize); + if (!Buffer) + { + goto End; + } + + if (FALSE == GetFileVersionInfoA(CheckFile, dwHandle, dwSize, Buffer)) + { + Log("Failed to get file version info : %u", LASTERR); + goto End; + } + + if (VerQueryValueA(Buffer, "\\", (LPVOID)&VerInfo, &VerLen) && VerLen != 0) + { + if (VerInfo->dwSignature == VS_FFI_SIGNATURE) + { + Major = HIWORD(VerInfo->dwFileVersionMS); + Minor = LOWORD(VerInfo->dwFileVersionMS); + Build = HIWORD(VerInfo->dwFileVersionLS); + Revision = LOWORD(VerInfo->dwFileVersionLS); + + Log("FileVersionze: <%u %u %u %u>", Major, Minor, Build, Revision); + + if (Major == 10 && Build > 20000) + { + Major = 11; + } + + if (Major != 11) + { + Log("This is not Windows 11, not need to bypass.", Major); + goto End; + } + } + } + + //Now we really need to bypass windows 11 check. create registry + HKEY hKey = NULL; + HKEY hSubKey = NULL; + LSTATUS Status; + + Status = RegCreateKeyExA(HKEY_LOCAL_MACHINE, "System\\Setup", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &dwSize); + if (ERROR_SUCCESS != Status) + { + Log("Failed to create reg key System\\Setup %u %u", LASTERR, Status); + goto End; + } + + Status = RegCreateKeyExA(hKey, "LabConfig", 0, NULL, 0, KEY_SET_VALUE | KEY_QUERY_VALUE | KEY_CREATE_SUB_KEY, NULL, &hSubKey, &dwSize); + if (ERROR_SUCCESS != Status) + { + Log("Failed to create LabConfig reg %u %u", LASTERR, Status); + goto End; + } + + //set reg value + Status += RegSetValueExA(hSubKey, "BypassRAMCheck", 0, REG_DWORD, (LPBYTE)&dwValue, sizeof(DWORD)); + Status += RegSetValueExA(hSubKey, "BypassTPMCheck", 0, REG_DWORD, (LPBYTE)&dwValue, sizeof(DWORD)); + Status += RegSetValueExA(hSubKey, "BypassSecureBootCheck", 0, REG_DWORD, (LPBYTE)&dwValue, sizeof(DWORD)); + Status += RegSetValueExA(hSubKey, "BypassStorageCheck", 0, REG_DWORD, (LPBYTE)&dwValue, sizeof(DWORD)); + Status += RegSetValueExA(hSubKey, "BypassCPUCheck", 0, REG_DWORD, (LPBYTE)&dwValue, sizeof(DWORD)); + + Log("Create bypass registry %s %u", (Status == ERROR_SUCCESS) ? "SUCCESS" : "FAILED", Status); + + Ret = 0; + +End: + if (Buffer) + { + free(Buffer); + } + + return Ret; +} + static int VentoyHook(ventoy_os_param *param) { int i; @@ -1327,7 +1438,7 @@ static int VentoyHook(ventoy_os_param *param) rc = MountIsoFile(IsoPath, DiskExtent.DiskNumber); NewDrives = GetLogicalDrives(); - Log("Drives after mount: 0x%x", NewDrives); + Log("Drives after mount: 0x%x (0x%x)", NewDrives, (NewDrives ^ Drives)); MntLetter = 'A'; NewDrives = (NewDrives ^ Drives); @@ -1335,7 +1446,14 @@ static int VentoyHook(ventoy_os_param *param) { if (NewDrives & 0x01) { - Log("Maybe the ISO file is mounted at %C:", MntLetter); + if ((NewDrives >> 1) == 0) + { + Log("The ISO file is mounted at %C:", MntLetter); + } + else + { + Log("Maybe the ISO file is mounted at %C:", MntLetter); + } break; } @@ -1345,6 +1463,12 @@ static int VentoyHook(ventoy_os_param *param) Log("Mount ISO FILE: %s", rc == 0 ? "SUCCESS" : "FAILED"); + //Windows 11 bypass check + if (g_windows_data.windows11_bypass_check == 1) + { + Windows11BypassCheck(IsoPath, MntLetter); + } + // for protect rc = DeleteVentoyPart2MountPoint(DiskExtent.DiskNumber); Log("Delete ventoy mountpoint: %s", rc == 0 ? "SUCCESS" : "NO NEED"); @@ -1407,6 +1531,8 @@ static int VentoyHook(ventoy_os_param *param) sprintf_s(StrBuf, sizeof(StrBuf), "cmd.exe /c %s \"%s\" %C", AUTO_RUN_BAT, IsoPath, MntLetter); CreateProcessA(NULL, StrBuf, NULL, NULL, TRUE, flags, NULL, NULL, &Si, &Pi); WaitForSingleObject(Pi.hProcess, INFINITE); + + SAFE_CLOSE_HANDLE(hOut); } else { diff --git a/vtoyjump/vtoyjump/vtoyjump.h b/vtoyjump/vtoyjump/vtoyjump.h index 01b96eed..3af9f855 100644 --- a/vtoyjump/vtoyjump/vtoyjump.h +++ b/vtoyjump/vtoyjump/vtoyjump.h @@ -69,7 +69,8 @@ typedef struct ventoy_windows_data { char auto_install_script[384]; char injection_archive[384]; - UINT8 reserved[256]; + UINT8 windows11_bypass_check; + UINT8 reserved[255]; }ventoy_windows_data; diff --git a/vtoyjump/vtoyjump/vtoyjump.vcxproj b/vtoyjump/vtoyjump/vtoyjump.vcxproj index 9659c449..49edb89c 100644 --- a/vtoyjump/vtoyjump/vtoyjump.vcxproj +++ b/vtoyjump/vtoyjump/vtoyjump.vcxproj @@ -135,7 +135,7 @@ true true true - VirtDisk.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + Version.lib;VirtDisk.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) @@ -155,7 +155,8 @@ true true true - VirtDisk.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + Version.lib;VirtDisk.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + Version.dll;VirtDisk.dll