]> glassweightruler.freedombox.rocks Git - Ventoy.git/commitdiff
bug fix
authorlongpanda <admin@ventoy.net>
Tue, 7 Apr 2020 16:06:23 +0000 (00:06 +0800)
committerlongpanda <admin@ventoy.net>
Tue, 7 Apr 2020 16:06:24 +0000 (00:06 +0800)
INSTALL/Ventoy2Disk.exe
INSTALL/grub/grub.cfg
INSTALL/ventoy/vtoyjump32.exe
INSTALL/ventoy/vtoyjump64.exe
Ventoy2Disk/Ventoy2Disk/Language.c
vtoyjump/vtoyjump/vtoyjump.c

index 5d3c55111828deefbe6dd58a7958d1aaecc1589d..38d912e6d5c476b56898e621f4fb7d8ccd6bec75 100644 (file)
Binary files a/INSTALL/Ventoy2Disk.exe and b/INSTALL/Ventoy2Disk.exe differ
index 6872363785865fcf3d5fd17733e1fbd4a49333f3..444a337a517f42dbf40987502946011a247b95eb 100644 (file)
@@ -79,6 +79,10 @@ function uefi_windows_menu_func {
     
     vt_windows_chain_data ${1}${chosen_path}
 
     
     vt_windows_chain_data ${1}${chosen_path}
 
+    if [ -n "${vtdebug_flag}" ]; then
+        sleep 5
+    fi
+
     if [ -n "$vtoy_chain_mem_addr" ]; then
         terminal_output  console       
         chainloader ${vtoy_path}/ventoy_x64.efi  env_param=${env_param} isoefi=${LoadIsoEfiDriver} ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
     if [ -n "$vtoy_chain_mem_addr" ]; then
         terminal_output  console       
         chainloader ${vtoy_path}/ventoy_x64.efi  env_param=${env_param} isoefi=${LoadIsoEfiDriver} ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
@@ -158,6 +162,10 @@ function uefi_iso_menu_func {
     vt_img_sector ${1}${chosen_path}
     
     if [ "$vtoy_os" = "Windows" ]; then
     vt_img_sector ${1}${chosen_path}
     
     if [ "$vtoy_os" = "Windows" ]; then
+        if [ "$ventoy_fs_probe" = "iso9660" ]; then
+            set ventoy_compatible=YES
+        fi
+    
         uefi_windows_menu_func  $1
     else
         uefi_linux_menu_func  $1
         uefi_windows_menu_func  $1
     else
         uefi_linux_menu_func  $1
@@ -271,8 +279,11 @@ function legacy_iso_menu_func {
     vt_check_compatible (loop)
     
     vt_img_sector ${1}${chosen_path}
     vt_check_compatible (loop)
     
     vt_img_sector ${1}${chosen_path}
-   
+
     if [ "$vtoy_os" = "Windows" ]; then
     if [ "$vtoy_os" = "Windows" ]; then
+        if [ "$ventoy_fs_probe" = "iso9660" ]; then
+            set ventoy_compatible=YES
+        fi
         legacy_windows_menu_func  $1
     else
         legacy_linux_menu_func  $1
         legacy_windows_menu_func  $1
     else
         legacy_linux_menu_func  $1
@@ -291,7 +302,7 @@ function legacy_iso_menu_func {
 #############################################################
 #############################################################
 
 #############################################################
 #############################################################
 
-set VENTOY_VERSION="1.0.00"
+set VENTOY_VERSION="1.0.01"
 
 #disable timeout
 unset timeout
 
 #disable timeout
 unset timeout
index 24cd8ab1cc486805b1f514d937d5a92e2da7bac7..6213ed59ecb25da526f6c9f78be85a0fce0d1ca1 100644 (file)
Binary files a/INSTALL/ventoy/vtoyjump32.exe and b/INSTALL/ventoy/vtoyjump32.exe differ
index f6bb9473f7ace8cecee0772074e765ed7c2c2724..c28c7fd28c96a33780c815cb547f826b0ea19802 100644 (file)
Binary files a/INSTALL/ventoy/vtoyjump64.exe and b/INSTALL/ventoy/vtoyjump64.exe differ
index ce6bf9e22345e2a5f280acafed630da41566a85e..66a1e56e6fe62a30adfa460989eff558c2d4c86b 100644 (file)
@@ -38,9 +38,9 @@ const TCHAR * g_Str_English[STR_ID_MAX] =
     TEXT("The disk will be formatted and all the data will be lost.\r\nContinue?"),
     TEXT("The disk will be formatted and all the data will be lost.\r\nContinue? (Double Check)"),
     TEXT("Congratulations!\r\nVentoy has been successfully installed to the device."),
     TEXT("The disk will be formatted and all the data will be lost.\r\nContinue?"),
     TEXT("The disk will be formatted and all the data will be lost.\r\nContinue? (Double Check)"),
     TEXT("Congratulations!\r\nVentoy has been successfully installed to the device."),
-    TEXT("An error occurred during the installation. Please check log.txt for detail."),
+    TEXT("An error occurred during the installation. You can try again and check log.txt for detail."),
     TEXT("Congratulations!\r\nVentoy has been successfully updated to the device."),
     TEXT("Congratulations!\r\nVentoy has been successfully updated to the device."),
-    TEXT("An error occurred during the update. Please check log.txt for detail."),
+    TEXT("An error occurred during the update. You can try again and check log.txt for detail."),
 
     TEXT("A thread is running, please wait..."),
 };
 
     TEXT("A thread is running, please wait..."),
 };
@@ -61,9 +61,9 @@ const TCHAR * g_Str_ChineseSimple[STR_ID_MAX] =
     TEXT("´ÅÅ̻ᱻ¸ñʽ»¯, ËùÓÐÊý¾Ý¶¼»á¶ªÊ§!\r\nÊÇ·ñ¼ÌÐø£¿"),
     TEXT("´ÅÅ̻ᱻ¸ñʽ»¯, ËùÓÐÊý¾Ý¶¼»á¶ªÊ§!\r\nÔÙ´ÎÈ·ÈÏÊÇ·ñ¼ÌÐø£¿"),
     TEXT("¹§Ï²Äã! Ventoy ÒѾ­³É¹¦°²×°µ½´ËÉ豸ÖÐ."),
     TEXT("´ÅÅ̻ᱻ¸ñʽ»¯, ËùÓÐÊý¾Ý¶¼»á¶ªÊ§!\r\nÊÇ·ñ¼ÌÐø£¿"),
     TEXT("´ÅÅ̻ᱻ¸ñʽ»¯, ËùÓÐÊý¾Ý¶¼»á¶ªÊ§!\r\nÔÙ´ÎÈ·ÈÏÊÇ·ñ¼ÌÐø£¿"),
     TEXT("¹§Ï²Äã! Ventoy ÒѾ­³É¹¦°²×°µ½´ËÉ豸ÖÐ."),
-    TEXT("°²×° Ventoy ¹ý³ÌÖз¢Éú´íÎó. ÏêϸÐÅÏ¢Çë²éÔÄ log.txt Îļþ."),
+    TEXT("°²×° Ventoy ¹ý³ÌÖз¢Éú´íÎó. Äã¿ÉÒÔÖØÊÔÒ»´Î, ÏêϸÐÅÏ¢Çë²éÔÄ log.txt Îļþ."),
     TEXT("¹§Ï²Äã! Ð°汾µÄ Ventoy ÒѾ­³É¹¦¸üе½´ËÉ豸ÖÐ."),
     TEXT("¹§Ï²Äã! Ð°汾µÄ Ventoy ÒѾ­³É¹¦¸üе½´ËÉ豸ÖÐ."),
-    TEXT("¸üРVentoy ¹ý³ÌÖÐÓöµ½´íÎó. ÏêϸÐÅÏ¢Çë²éÔÄ log.txt Îļþ."),
+    TEXT("¸üРVentoy ¹ý³ÌÖÐÓöµ½´íÎó. Äã¿ÉÒÔÖØÊÔÒ»´Î, ÏêϸÐÅÏ¢Çë²éÔÄ log.txt Îļþ."),
 
     TEXT("µ±Ç°ÓÐÈÎÎñÕýÔÚÔËÐÐ, ÇëµÈ´ý..."),
 };
 
     TEXT("µ±Ç°ÓÐÈÎÎñÕýÔÚÔËÐÐ, ÇëµÈ´ý..."),
 };
index 221de4892a508cc3bd0eab8fe2e9759c17087467..1054ef06a1356fe74383023b8b7f86ed83e7c02b 100644 (file)
@@ -754,6 +754,25 @@ static int VentoyHook(ventoy_os_param *param)
     return 0;
 }
 
     return 0;
 }
 
+const char * GetFileNameInPath(const char *fullpath)
+{
+       int i;
+       const char *pos = NULL;
+
+       if (strstr(fullpath, ":"))
+       {
+               for (i = (int)strlen(fullpath); i > 0; i--)
+               {
+                       if (fullpath[i - 1] == '/' || fullpath[i - 1] == '\\')
+                       {
+                               return fullpath + i;
+                       }
+               }
+       }
+       
+       return fullpath;
+}
+
 int VentoyJump(INT argc, CHAR **argv, CHAR *LunchFile)
 {
        int rc = 1;
 int VentoyJump(INT argc, CHAR **argv, CHAR *LunchFile)
 {
        int rc = 1;
@@ -764,9 +783,6 @@ int VentoyJump(INT argc, CHAR **argv, CHAR *LunchFile)
        ventoy_os_param os_param;
        CHAR ExeFileName[MAX_PATH];
 
        ventoy_os_param os_param;
        CHAR ExeFileName[MAX_PATH];
 
-       Log("######## VentoyJump ##########");
-       Log("argc = %d argv[0] = <%s>", argc, argv[0]);
-
        sprintf_s(ExeFileName, sizeof(ExeFileName), "%s", argv[0]);
        if (!IsPathExist(FALSE, "%s", ExeFileName))
        {
        sprintf_s(ExeFileName, sizeof(ExeFileName), "%s", argv[0]);
        if (!IsPathExist(FALSE, "%s", ExeFileName))
        {
@@ -816,7 +832,7 @@ int VentoyJump(INT argc, CHAR **argv, CHAR *LunchFile)
                        }
 
                        PeStart += sizeof(ventoy_os_param);
                        }
 
                        PeStart += sizeof(ventoy_os_param);
-                       sprintf_s(LunchFile, MAX_PATH, "ventoy\\%s", ExeFileName);
+                       sprintf_s(LunchFile, MAX_PATH, "ventoy\\%s", GetFileNameInPath(ExeFileName));
                        SaveBuffer2File(LunchFile, Buffer + PeStart, FileSize - PeStart);
                        break;
                }
                        SaveBuffer2File(LunchFile, Buffer + PeStart, FileSize - PeStart);
                        break;
                }
@@ -849,12 +865,46 @@ End:
 
 int main(int argc, char **argv)
 {
 
 int main(int argc, char **argv)
 {
+       CHAR *Pos = NULL;
+       CHAR CurDir[MAX_PATH];
        CHAR LunchFile[MAX_PATH];
        STARTUPINFOA Si;
        PROCESS_INFORMATION Pi;
 
        CHAR LunchFile[MAX_PATH];
        STARTUPINFOA Si;
        PROCESS_INFORMATION Pi;
 
+       if (argv[0] && argv[0][0] && argv[0][1] == ':')
+       {
+               GetCurrentDirectoryA(sizeof(CurDir), CurDir);
+
+               strcpy_s(LunchFile, sizeof(LunchFile), argv[0]);
+               Pos = (char *)GetFileNameInPath(LunchFile);
+
+               strcat_s(CurDir, sizeof(CurDir), "\\");
+               strcat_s(CurDir, sizeof(CurDir), Pos);
+               
+               if (_stricmp(argv[0], CurDir) != 0)
+               {
+                       *Pos = 0;
+                       SetCurrentDirectoryA(LunchFile);
+               }
+       }
+
+       Log("######## VentoyJump ##########");
+       Log("argc = %d argv[0] = <%s>", argc, argv[0]);
+
+       if (Pos && *Pos == 0)
+       {
+               Log("Old current directory = <%s>", CurDir);
+               Log("New current directory = <%s>", LunchFile);
+       }
+       else
+       {
+               GetCurrentDirectoryA(sizeof(CurDir), CurDir);
+               Log("Current directory = <%s>", CurDir);
+       }
+
     GetStartupInfoA(&Si);
 
     GetStartupInfoA(&Si);
 
+       memset(LunchFile, 0, sizeof(LunchFile));
        if (VentoyJump(argc, argv, LunchFile) == 0)
        {
         Log("Ventoy jump success ...");
        if (VentoyJump(argc, argv, LunchFile) == 0)
        {
         Log("Ventoy jump success ...");