diff --git a/installer/setup_online.bat b/installer/setup_online.bat index 14121f6..bcbb8d7 100644 --- a/installer/setup_online.bat +++ b/installer/setup_online.bat @@ -8,9 +8,18 @@ echo Everything is installed into the subfolder "app" echo ============================================================ if /i not "%~1"=="update" goto :step0 -echo UPDATE: re-downloading project code, installed components stay... -if exist app rmdir /s /q app +echo UPDATE: downloading fresh code, installed components inside delivery stay... if exist repo.zip del /q repo.zip +curl -L -f --retry 3 -o repo.zip https://gitea.viktot14.com/Sadmin/docchecker/archive/main.zip || goto :err +tar -xf repo.zip -C app || goto :err +for /d %%D in (app\docchecker-*) do ( + robocopy "%%D" "app\docchecker" /E /NFL /NDL /NJH /NJS /NP + rmdir /s /q "%%D" +) +if not exist app\docchecker\app.py goto :err +if exist app\docchecker\exceptions.txt if not exist "%~dp0exceptions.txt" copy /y app\docchecker\exceptions.txt "%~dp0exceptions.txt" >nul +del repo.zip +goto :app_ready :step0 if exist app\docchecker\app.py goto :app_ready echo [1/6] Downloading project archive from Gitea... @@ -20,7 +29,7 @@ if exist app\docchecker rmdir /s /q app\docchecker tar -xf repo.zip -C app || goto :err for /d %%D in (app\docchecker*) do ren "%%D" "docchecker" if not exist app\docchecker\app.py goto :err -if exist app\docchecker\exceptions.txt if not exist ..\exceptions.txt copy /y app\docchecker\exceptions.txt ..\exceptions.txt >nul +if exist app\docchecker\exceptions.txt if not exist "%~dp0exceptions.txt" copy /y app\docchecker\exceptions.txt "%~dp0exceptions.txt" >nul del repo.zip :app_ready cd /d app\docchecker || goto :err