From 0d90fd1057a6497db6329d9724f37a6675dfbf4f Mon Sep 17 00:00:00 2001 From: rooyca Date: Thu, 27 Jul 2023 04:18:57 -0500 Subject: [PATCH 1/2] update: update.bat create a backup before deleting files --- update.bat | 41 +++++++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/update.bat b/update.bat index d3d8a4c..531d799 100644 --- a/update.bat +++ b/update.bat @@ -1,12 +1,41 @@ @echo off + +REM Backup files before Deleting +IF EXIST "Medicat Installer.exe" ( + copy "Medicat Installer.exe" "Medicat Installer.exe.bak" +) +IF EXIST "MediCat_Installer.exe" ( + copy "MediCat_Installer.exe" "MediCat_Installer.exe.bak" +) +IF EXIST "Medicat Installer.bat" ( + copy "Medicat Installer.bat" "Medicat Installer.bat.bak" +) +IF EXIST "MediCat_Installer.bat" ( + copy "MediCat_Installer.bat" "MediCat_Installer.bat.bak" +) + timeout 2 > nul -DEL "Medicat Installer.exe" -DEL "MediCat_Installer.exe" -DEL "Medicat Installer.bat" -DEL "MediCat_Installer.bat" + +DEL "Medicat Installer.exe" 2>nul +DEL "MediCat_Installer.exe" 2>nul +DEL "Medicat Installer.bat" 2>nul +DEL "MediCat_Installer.bat" 2>nul + cls echo.Updating Medicat Installer. Please wait while the new file is downloaded. curl http://url.medicatusb.com/installerupdate -o Medicat_Installer.bat -q -L + +REM Check if the download was successful +IF NOT EXIST "Medicat_Installer.bat" ( + echo ERROR: Failed to download the new file. + REM Restore the backup if it exists + IF EXIST "Medicat Installer.bat.bak" ( + copy "Medicat Installer.bat.bak" "Medicat Installer.bat" + ) + pause + exit /b 1 +) + cls -start cmd /k Medicat_Installer.bat Medicat_Installer.bat -del %0 && exit +start cmd /k Medicat_Installer.bat +del %0 && exit \ No newline at end of file From d5917755caec287229583fbdaf1218e3291901eb Mon Sep 17 00:00:00 2001 From: rooyca Date: Thu, 27 Jul 2023 04:19:35 -0500 Subject: [PATCH 2/2] remove duplicated line --- Medicat_Installer.bat | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Medicat_Installer.bat b/Medicat_Installer.bat index 64d0709..b334688 100644 --- a/Medicat_Installer.bat +++ b/Medicat_Installer.bat @@ -78,10 +78,6 @@ If /I "%Errorlevel%"=="4" ( set lang=gr goto curver ) -If /I "%Errorlevel%"=="4" ( -set lang=gr -goto curver -) If /I "%Errorlevel%"=="5" ( set lang=tr goto curver