From: longpanda Date: Sat, 22 Oct 2022 11:54:54 +0000 (+0800) Subject: update vtoyjump X-Git-Tag: v1.0.81~2 X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/Ventoy.git/commitdiff_plain/f9c56c668624eebd7d726ff1a4890aa5aed29732?ds=inline update vtoyjump --- diff --git a/INSTALL/ventoy/vtoyjump32.exe b/INSTALL/ventoy/vtoyjump32.exe index 2cd7eff..6399b70 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 65a2fb1..79f1792 100644 Binary files a/INSTALL/ventoy/vtoyjump64.exe and b/INSTALL/ventoy/vtoyjump64.exe differ diff --git a/vtoyjump/vtoyjump/vtoyjump.c b/vtoyjump/vtoyjump/vtoyjump.c index f9a9034..ac01c66 100644 --- a/vtoyjump/vtoyjump/vtoyjump.c +++ b/vtoyjump/vtoyjump/vtoyjump.c @@ -2482,6 +2482,22 @@ End: } +static int vtoy_cmd_delete_file(char *File) +{ + CHAR szCmd[MAX_PATH]; + STARTUPINFOA Si; + PROCESS_INFORMATION Pi; + + GetStartupInfoA(&Si); + Si.dwFlags |= STARTF_USESHOWWINDOW; + Si.wShowWindow = SW_HIDE; + sprintf_s(szCmd, sizeof(szCmd), "cmd.exe /c del /F /Q %s", File); + CreateProcessA(NULL, szCmd, NULL, NULL, FALSE, 0, NULL, NULL, &Si, &Pi); + WaitForSingleObject(Pi.hProcess, INFINITE); + + return 0; +} + int real_main(int argc, char **argv) { int i = 0; @@ -2562,6 +2578,12 @@ int real_main(int argc, char **argv) sprintf_s(LunchFile, sizeof(LunchFile), "%s", "cmd.exe"); } + if (IsFileExist(ORG_PECMD_BK_PATH)) + { + Log("Delete backup file <%s>", ORG_PECMD_BK_PATH); + vtoy_cmd_delete_file(ORG_PECMD_BK_PATH); + } + Log("Backup log at this point"); CopyFileA(LOG_FILE, "X:\\Windows\\ventoy.backup", TRUE);