]> glassweightruler.freedombox.rocks Git - Ventoy.git/commitdiff
1.0.55 release v1.0.55
authorlongpanda <admin@ventoy.net>
Sun, 17 Oct 2021 13:56:30 +0000 (21:56 +0800)
committerlongpanda <admin@ventoy.net>
Sun, 17 Oct 2021 13:56:30 +0000 (21:56 +0800)
.github/ISSUE_TEMPLATE/issue_template.yml
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_windows.c
GRUB2/MOD_SRC/grub-2.04/include/grub/ventoy.h
INSTALL/Ventoy2Disk.exe
INSTALL/grub/grub.cfg
INSTALL/ventoy/vtoyjump32.exe
INSTALL/ventoy/vtoyjump64.exe
README.md
vtoyjump/vtoyjump/vtoyjump.c
vtoyjump/vtoyjump/vtoyjump.h
vtoyjump/vtoyjump/vtoyjump.vcxproj

index 3d635eee6bec5caf6b093b4e7d44edea5c470002..48c12ae08f79bbf2f4bab27d033d75b6a5570618 100644 (file)
@@ -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
index e4c9aa6a93f2dfd2316e83cecab7451a1109b3ce..b2e986bcd2afc925b49cc97c29e2f1230fb626d2 100644 (file)
@@ -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;
 }
 
index 11384b259f6aad867de5229dc119d6b4155ded80..ee76b5bd21f380f3ff1f726582cce5416bad8f5d 100644 (file)
@@ -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;
 
 
index 90b024faac71d0ca024deece66e130127409a3f6..6a7051329f219758120f639a450b8c289c7f49c7 100644 (file)
Binary files a/INSTALL/Ventoy2Disk.exe and b/INSTALL/Ventoy2Disk.exe differ
index 5c6797a9ae447a43380fddcba28425cee5798ab8..95db8044e0a5183aaceab6db5bc4962f4c5d7e7f 100644 (file)
@@ -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
index db8d0f2805f4547d5711c7cf3a7d8c8df9dce8cb..471bbeee344ca9cc9b1e8eaac134efe6e53fa9f6 100644 (file)
Binary files a/INSTALL/ventoy/vtoyjump32.exe and b/INSTALL/ventoy/vtoyjump32.exe differ
index 9e52ce4c319b6a01c46e957ad52e0f8aadc3b7e1..6d49fa960a5a93398f355caadfcff1a7c64552b8 100644 (file)
Binary files a/INSTALL/ventoy/vtoyjump64.exe and b/INSTALL/ventoy/vtoyjump64.exe differ
index 7994a4266f953038a405eab491fed113f1abf269..fcdea684de38ac508cf9c0bb6057b575e95a439d 100644 (file)
--- 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.<br/>
 Both MBR and GPT partition style are supported in the same way.<br/>
 Most type of OS supported(Windows/WinPE/Linux/Unix/ChromeOS/Vmware/Xen...) <br/>
-  740+ ISO files are tested (<a href="https://www.ventoy.net/en/isolist.html">List</a>). 90%+ distros in <a href="https://distrowatch.com/">distrowatch.com</a> supported (<a href="https://www.ventoy.net/en/distrowatch.html">Details</a>). <br/>
+  750+ ISO files are tested (<a href="https://www.ventoy.net/en/isolist.html">List</a>). 90%+ distros in <a href="https://distrowatch.com/">distrowatch.com</a> supported (<a href="https://www.ventoy.net/en/distrowatch.html">Details</a>). <br/>
 <br/>Official Website: <a href=https://www.ventoy.net>https://www.ventoy.net</a>
 </h4>
 
@@ -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
index aea2711856dd40b96b598fac4d3181103add277b..8421403d8ee41f8632257300c81f009e88ec763f 100644 (file)
@@ -1248,6 +1248,117 @@ static int ProcessUnattendedInstallation(const char *script)
     return 0;\r
 }\r
 \r
+static int Windows11BypassCheck(const char *isofile, const char MntLetter)\r
+{\r
+    int Ret = 1;\r
+    DWORD dwHandle;\r
+    DWORD dwSize;\r
+    DWORD dwValue = 1;\r
+    UINT VerLen = 0;\r
+    CHAR *Buffer = NULL;\r
+    VS_FIXEDFILEINFO* VerInfo = NULL;\r
+    CHAR CheckFile[MAX_PATH];\r
+    UINT16 Major, Minor, Build, Revision;\r
+\r
+    Log("Windows11BypassCheck for <%s> %C:", isofile, MntLetter);\r
+\r
+    if (FALSE == IsFileExist("%C:\\sources\\boot.wim", MntLetter) ||\r
+        FALSE == IsFileExist("%C:\\sources\\compatresources.dll", MntLetter))\r
+    {\r
+        Log("boot.wim/compatresources.dll not exist, this is not a windows install media.");\r
+        goto End;\r
+    }\r
+\r
+    if (FALSE == IsFileExist("%C:\\sources\\install.wim", MntLetter) && \r
+        FALSE == IsFileExist("%C:\\sources\\install.esd", MntLetter))\r
+    {\r
+        Log("install.wim/install.esd not exist, this is not a windows install media.");\r
+        goto End;\r
+    }\r
+\r
+    sprintf_s(CheckFile, sizeof(CheckFile), "%C:\\sources\\compatresources.dll", MntLetter);\r
+    dwSize = GetFileVersionInfoSizeA(CheckFile, &dwHandle);\r
+    if (0 == dwSize)\r
+    {\r
+        Log("Failed to get file version info size: %u", LASTERR);\r
+        goto End;\r
+    }\r
+\r
+    Buffer = malloc(dwSize);\r
+    if (!Buffer)\r
+    {\r
+        goto End;\r
+    }\r
+\r
+    if (FALSE == GetFileVersionInfoA(CheckFile, dwHandle, dwSize, Buffer))\r
+    {\r
+        Log("Failed to get file version info : %u", LASTERR);\r
+        goto End;\r
+    }\r
+\r
+    if (VerQueryValueA(Buffer, "\\", (LPVOID)&VerInfo, &VerLen) && VerLen != 0)\r
+    {\r
+        if (VerInfo->dwSignature == VS_FFI_SIGNATURE)\r
+        {\r
+            Major = HIWORD(VerInfo->dwFileVersionMS);\r
+            Minor = LOWORD(VerInfo->dwFileVersionMS);\r
+            Build = HIWORD(VerInfo->dwFileVersionLS);\r
+            Revision = LOWORD(VerInfo->dwFileVersionLS);\r
+\r
+            Log("FileVersionze: <%u %u %u %u>", Major, Minor, Build, Revision);\r
+\r
+            if (Major == 10 && Build > 20000)\r
+            {\r
+                Major = 11;\r
+            }\r
+\r
+            if (Major != 11)\r
+            {\r
+                Log("This is not Windows 11, not need to bypass.", Major);\r
+                goto End;\r
+            }\r
+        }\r
+    }\r
+\r
+    //Now we really need to bypass windows 11 check. create registry\r
+    HKEY hKey = NULL;\r
+    HKEY hSubKey = NULL;\r
+    LSTATUS Status;\r
+\r
+    Status = RegCreateKeyExA(HKEY_LOCAL_MACHINE, "System\\Setup", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &dwSize);\r
+    if (ERROR_SUCCESS != Status)\r
+    {\r
+        Log("Failed to create reg key System\\Setup %u %u", LASTERR, Status);\r
+        goto End;\r
+    }\r
+\r
+    Status = RegCreateKeyExA(hKey, "LabConfig", 0, NULL, 0, KEY_SET_VALUE | KEY_QUERY_VALUE | KEY_CREATE_SUB_KEY, NULL, &hSubKey, &dwSize);\r
+    if (ERROR_SUCCESS != Status)\r
+    {\r
+        Log("Failed to create LabConfig reg  %u %u", LASTERR, Status);\r
+        goto End;\r
+    }\r
+\r
+    //set reg value\r
+    Status += RegSetValueExA(hSubKey, "BypassRAMCheck", 0, REG_DWORD, (LPBYTE)&dwValue, sizeof(DWORD));\r
+    Status += RegSetValueExA(hSubKey, "BypassTPMCheck", 0, REG_DWORD, (LPBYTE)&dwValue, sizeof(DWORD));\r
+    Status += RegSetValueExA(hSubKey, "BypassSecureBootCheck", 0, REG_DWORD, (LPBYTE)&dwValue, sizeof(DWORD));\r
+    Status += RegSetValueExA(hSubKey, "BypassStorageCheck", 0, REG_DWORD, (LPBYTE)&dwValue, sizeof(DWORD));\r
+    Status += RegSetValueExA(hSubKey, "BypassCPUCheck", 0, REG_DWORD, (LPBYTE)&dwValue, sizeof(DWORD));\r
+\r
+    Log("Create bypass registry %s %u", (Status == ERROR_SUCCESS) ? "SUCCESS" : "FAILED", Status);\r
+\r
+    Ret = 0;\r
+\r
+End:\r
+    if (Buffer)\r
+    {\r
+        free(Buffer);\r
+    }\r
+    \r
+    return Ret; \r
+}\r
+\r
 static int VentoyHook(ventoy_os_param *param)\r
 {\r
     int i;\r
@@ -1327,7 +1438,7 @@ static int VentoyHook(ventoy_os_param *param)
     rc = MountIsoFile(IsoPath, DiskExtent.DiskNumber);\r
 \r
     NewDrives = GetLogicalDrives();\r
-    Log("Drives after mount: 0x%x", NewDrives);\r
+    Log("Drives after mount: 0x%x (0x%x)", NewDrives, (NewDrives ^ Drives));\r
 \r
     MntLetter = 'A';\r
     NewDrives = (NewDrives ^ Drives);\r
@@ -1335,7 +1446,14 @@ static int VentoyHook(ventoy_os_param *param)
     {\r
         if (NewDrives & 0x01)\r
         {\r
-            Log("Maybe the ISO file is mounted at %C:", MntLetter);\r
+            if ((NewDrives >> 1) == 0)\r
+            {\r
+                Log("The ISO file is mounted at %C:", MntLetter);\r
+            }\r
+            else\r
+            {\r
+                Log("Maybe the ISO file is mounted at %C:", MntLetter);\r
+            }\r
             break;\r
         }\r
 \r
@@ -1345,6 +1463,12 @@ static int VentoyHook(ventoy_os_param *param)
 \r
     Log("Mount ISO FILE: %s", rc == 0 ? "SUCCESS" : "FAILED");\r
 \r
+    //Windows 11 bypass check\r
+    if (g_windows_data.windows11_bypass_check == 1)\r
+    {\r
+        Windows11BypassCheck(IsoPath, MntLetter);\r
+    }\r
+\r
     // for protect\r
     rc = DeleteVentoyPart2MountPoint(DiskExtent.DiskNumber);\r
     Log("Delete ventoy mountpoint: %s", rc == 0 ? "SUCCESS" : "NO NEED");\r
@@ -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);\r
                 CreateProcessA(NULL, StrBuf, NULL, NULL, TRUE, flags, NULL, NULL, &Si, &Pi);\r
                 WaitForSingleObject(Pi.hProcess, INFINITE);\r
+\r
+                SAFE_CLOSE_HANDLE(hOut);\r
             }\r
             else\r
             {\r
index 01b96eed1c5bea62c72fd666cc2e773c645cb530..3af9f855bdd9460c100ebc6f8ceb36f84370836b 100644 (file)
@@ -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;
 
 
index 9659c449c5c8264c39a49105878955041e5f7a30..49edb89cb2b601a439313a29f473a4fc6701cf43 100644 (file)
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
-      <AdditionalDependencies>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)</AdditionalDependencies>
+      <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)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
-      <AdditionalDependencies>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)</AdditionalDependencies>
+      <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)</AdditionalDependencies>
+      <DelayLoadDLLs>Version.dll;VirtDisk.dll</DelayLoadDLLs>
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>