Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dadigang
Ventoy
Commits
ef80baf1
Commit
ef80baf1
authored
Apr 08, 2020
by
longpanda
Browse files
bug fix
parent
99862acb
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
71 additions
and
10 deletions
+71
-10
INSTALL/Ventoy2Disk.exe
INSTALL/Ventoy2Disk.exe
+0
-0
INSTALL/grub/grub.cfg
INSTALL/grub/grub.cfg
+13
-2
INSTALL/ventoy/vtoyjump32.exe
INSTALL/ventoy/vtoyjump32.exe
+0
-0
INSTALL/ventoy/vtoyjump64.exe
INSTALL/ventoy/vtoyjump64.exe
+0
-0
Ventoy2Disk/Ventoy2Disk/Language.c
Ventoy2Disk/Ventoy2Disk/Language.c
+4
-4
vtoyjump/vtoyjump/vtoyjump.c
vtoyjump/vtoyjump/vtoyjump.c
+54
-4
No files found.
INSTALL/Ventoy2Disk.exe
View file @
ef80baf1
No preview for this file type
INSTALL/grub/grub.cfg
View file @
ef80baf1
...
@@ -79,6 +79,10 @@ function uefi_windows_menu_func {
...
@@ -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
if [ -n "$vtoy_chain_mem_addr" ]; then
terminal_output console
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}
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 {
...
@@ -158,6 +162,10 @@ function uefi_iso_menu_func {
vt_img_sector ${1}${chosen_path}
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
uefi_windows_menu_func $1
uefi_windows_menu_func $1
else
else
uefi_linux_menu_func $1
uefi_linux_menu_func $1
...
@@ -273,6 +281,9 @@ function legacy_iso_menu_func {
...
@@ -273,6 +281,9 @@ function legacy_iso_menu_func {
vt_img_sector ${1}${chosen_path}
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
legacy_windows_menu_func $1
else
else
legacy_linux_menu_func $1
legacy_linux_menu_func $1
...
@@ -291,7 +302,7 @@ function legacy_iso_menu_func {
...
@@ -291,7 +302,7 @@ function legacy_iso_menu_func {
#############################################################
#############################################################
#############################################################
#############################################################
set VENTOY_VERSION="1.0.0
0
"
set VENTOY_VERSION="1.0.0
1
"
#disable timeout
#disable timeout
unset timeout
unset timeout
...
...
INSTALL/ventoy/vtoyjump32.exe
View file @
ef80baf1
No preview for this file type
INSTALL/ventoy/vtoyjump64.exe
View file @
ef80baf1
No preview for this file type
Ventoy2Disk/Ventoy2Disk/Language.c
View file @
ef80baf1
...
@@ -38,9 +38,9 @@ const TCHAR * g_Str_English[STR_ID_MAX] =
...
@@ -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\n
Continue?"
),
TEXT
(
"The disk will be formatted and all the data will be lost.
\r\n
Continue?"
),
TEXT
(
"The disk will be formatted and all the data will be lost.
\r\n
Continue? (Double Check)"
),
TEXT
(
"The disk will be formatted and all the data will be lost.
\r\n
Continue? (Double Check)"
),
TEXT
(
"Congratulations!
\r\n
Ventoy has been successfully installed to the device."
),
TEXT
(
"Congratulations!
\r\n
Ventoy 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\n
Ventoy has been successfully updated to the device."
),
TEXT
(
"Congratulations!
\r\n
Ventoy 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] =
...
@@ -61,9 +61,9 @@ const TCHAR * g_Str_ChineseSimple[STR_ID_MAX] =
TEXT
(
"磁盘会被格式化, 所有数据都会丢失!
\r\n
是否继续?"
),
TEXT
(
"磁盘会被格式化, 所有数据都会丢失!
\r\n
是否继续?"
),
TEXT
(
"磁盘会被格式化, 所有数据都会丢失!
\r\n
再次确认是否继续?"
),
TEXT
(
"磁盘会被格式化, 所有数据都会丢失!
\r\n
再次确认是否继续?"
),
TEXT
(
"恭喜你! Ventoy 已经成功安装到此设备中."
),
TEXT
(
"恭喜你! Ventoy 已经成功安装到此设备中."
),
TEXT
(
"安装 Ventoy 过程中发生错误. 详细信息请查阅 log.txt 文件."
),
TEXT
(
"安装 Ventoy 过程中发生错误.
你可以重试一次,
详细信息请查阅 log.txt 文件."
),
TEXT
(
"恭喜你! 新版本的 Ventoy 已经成功更新到此设备中."
),
TEXT
(
"恭喜你! 新版本的 Ventoy 已经成功更新到此设备中."
),
TEXT
(
"更新 Ventoy 过程中遇到错误. 详细信息请查阅 log.txt 文件."
),
TEXT
(
"更新 Ventoy 过程中遇到错误.
你可以重试一次,
详细信息请查阅 log.txt 文件."
),
TEXT
(
"当前有任务正在运行, 请等待..."
),
TEXT
(
"当前有任务正在运行, 请等待..."
),
};
};
...
...
vtoyjump/vtoyjump/vtoyjump.c
View file @
ef80baf1
...
@@ -754,6 +754,25 @@ static int VentoyHook(ventoy_os_param *param)
...
@@ -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
VentoyJump
(
INT
argc
,
CHAR
**
argv
,
CHAR
*
LunchFile
)
{
{
int
rc
=
1
;
int
rc
=
1
;
...
@@ -764,9 +783,6 @@ int VentoyJump(INT argc, CHAR **argv, CHAR *LunchFile)
...
@@ -764,9 +783,6 @@ int VentoyJump(INT argc, CHAR **argv, CHAR *LunchFile)
ventoy_os_param
os_param
;
ventoy_os_param
os_param
;
CHAR
ExeFileName
[
MAX_PATH
];
CHAR
ExeFileName
[
MAX_PATH
];
Log
(
"######## VentoyJump ##########"
);
Log
(
"argc = %d argv[0] = <%s>"
,
argc
,
argv
[
0
]);
sprintf_s
(
ExeFileName
,
sizeof
(
ExeFileName
),
"%s"
,
argv
[
0
]);
sprintf_s
(
ExeFileName
,
sizeof
(
ExeFileName
),
"%s"
,
argv
[
0
]);
if
(
!
IsPathExist
(
FALSE
,
"%s"
,
ExeFileName
))
if
(
!
IsPathExist
(
FALSE
,
"%s"
,
ExeFileName
))
{
{
...
@@ -816,7 +832,7 @@ int VentoyJump(INT argc, CHAR **argv, CHAR *LunchFile)
...
@@ -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
);
SaveBuffer2File
(
LunchFile
,
Buffer
+
PeStart
,
FileSize
-
PeStart
);
break
;
break
;
}
}
...
@@ -849,12 +865,46 @@ End:
...
@@ -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
];
CHAR
LunchFile
[
MAX_PATH
];
STARTUPINFOA
Si
;
STARTUPINFOA
Si
;
PROCESS_INFORMATION
Pi
;
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
)
if
(
VentoyJump
(
argc
,
argv
,
LunchFile
)
==
0
)
{
{
Log
(
"Ventoy jump success ..."
);
Log
(
"Ventoy jump success ..."
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment