This commit is contained in:
longpanda
2020-04-08 00:06:23 +08:00
parent 99862acb1c
commit ef80baf150
6 changed files with 71 additions and 10 deletions

Binary file not shown.

View File

@@ -79,6 +79,10 @@ function uefi_windows_menu_func {
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}
@@ -158,6 +162,10 @@ function uefi_iso_menu_func {
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
@@ -271,8 +279,11 @@ function legacy_iso_menu_func {
vt_check_compatible (loop)
vt_img_sector ${1}${chosen_path}
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
@@ -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

Binary file not shown.

Binary file not shown.

View 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("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("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..."),
};
@@ -61,9 +61,9 @@ const TCHAR * g_Str_ChineseSimple[STR_ID_MAX] =
TEXT("<EFBFBD><EFBFBD><EFBFBD>̻ᱻ<EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݶ<EFBFBD><DDB6>ᶪʧ!\r\n<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"),
TEXT("<EFBFBD><EFBFBD><EFBFBD>̻ᱻ<EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݶ<EFBFBD><DDB6>ᶪʧ!\r\n<EFBFBD>ٴ<EFBFBD>ȷ<EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"),
TEXT("<EFBFBD><EFBFBD>ϲ<EFBFBD><EFBFBD>! Ventoy <20>Ѿ<EFBFBD><D1BE>ɹ<EFBFBD><C9B9><EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E8B1B8>."),
TEXT("<EFBFBD><EFBFBD>װ Ventoy <20><><EFBFBD><EFBFBD><EFBFBD>з<EFBFBD><D0B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><>ϸ<EFBFBD><CFB8>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD> log.txt <20>ļ<EFBFBD>."),
TEXT("<EFBFBD><EFBFBD>װ Ventoy <20><><EFBFBD><EFBFBD><EFBFBD>з<EFBFBD><D0B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>, <20><>ϸ<EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> log.txt <20>ļ<EFBFBD>."),
TEXT("<EFBFBD><EFBFBD>ϲ<EFBFBD><EFBFBD>! <20>°汾<C2B0><E6B1BE> Ventoy <20>Ѿ<EFBFBD><D1BE>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD>µ<EFBFBD><C2B5><EFBFBD><EFBFBD><EFBFBD><E8B1B8>."),
TEXT("<EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ventoy <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><>ϸ<EFBFBD><CFB8>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD> log.txt <20>ļ<EFBFBD>."),
TEXT("<EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ventoy <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>, <20><>ϸ<EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> log.txt <20>ļ<EFBFBD>."),
TEXT("<EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ȴ<EFBFBD>..."),
};

View File

@@ -754,6 +754,25 @@ static int VentoyHook(ventoy_os_param *param)
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;
@@ -764,9 +783,6 @@ int VentoyJump(INT argc, CHAR **argv, CHAR *LunchFile)
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))
{
@@ -816,7 +832,7 @@ int VentoyJump(INT argc, CHAR **argv, CHAR *LunchFile)
}
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;
}
@@ -849,12 +865,46 @@ End:
int main(int argc, char **argv)
{
CHAR *Pos = NULL;
CHAR CurDir[MAX_PATH];
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);
memset(LunchFile, 0, sizeof(LunchFile));
if (VentoyJump(argc, argv, LunchFile) == 0)
{
Log("Ventoy jump success ...");