Online setup: one-script installer for Windows PCs with internet access

This commit is contained in:
Sadmin committed 2026-11-02 10:41:54 +03:00
1 parent a34d7c8478
commit 2bb2dc82a1
4 files changed
+165 -6

No files matched your search

+88
View File
@@ -0,0 +1,88 @@
@echo off
setlocal EnableExtensions
cd /d %~dp0
echo ============================================================
echo docchecker online setup
echo Windows 10 (1803+), internet needed, ~4 GB download, ~20 min
echo Everything is installed into the subfolder "app"
echo ============================================================
if not exist app\docchecker\app.py (
echo [1/6] Downloading project archive from Gitea...
if not exist repo.zip curl -L -f --retry 3 -o repo.zip https://gitea.viktot14.com/Sadmin/docchecker/archive/main.zip || goto :err
mkdir app 2>nul
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
del repo.zip
)
cd /d app\docchecker || goto :err
if not exist delivery\OllamaSetup.exe (
echo [2/6] Downloading Ollama installer (~1.7 GB)...
curl -L -f -C - --retry 3 -o delivery\OllamaSetup.exe https://ollama.com/download/OllamaSetup.exe || goto :err
)
if not exist delivery\python-3.12.10-amd64.exe (
echo [3/6] Downloading Python 3.12 installer...
curl -L -f --retry 3 -o delivery\python-3.12.10-amd64.exe https://www.python.org/ftp/python/3.12.10/python-3.12.10-amd64.exe || goto :err
)
if not exist delivery\jre17\jre\bin\java.exe (
echo [4/6] Downloading Java 17 JRE + LanguageTool...
if not exist delivery\jre.zip curl -L -f --retry 3 -o delivery\jre.zip "https://api.adoptium.net/v3/binary/latest/17/ga/windows/x64/jre/hotspot/normal/eclipse"
mkdir delivery\jre17 2>nul
tar -xf delivery\jre.zip -C delivery\jre17 || goto :err
for /d %%D in (delivery\jre17\jdk-*) do ren "%%D" "jre"
del delivery\jre.zip
if not exist delivery\LT.zip curl -L -f --retry 3 -o delivery\LT.zip https://languagetool.org/download/LanguageTool-stable.zip
tar -xf delivery\LT.zip -C delivery || goto :err
for /d %%D in (delivery\LanguageTool-*) do ren "%%D" "languagetool"
del delivery\LT.zip
)
if not exist delivery\ollama\model\Qwen_Qwen3-4B-Instruct-2507-Q4_K_M.gguf (
echo [5/6] Downloading punctuation model (~2.5 GB, be patient)...
if not exist delivery\ollama\model mkdir delivery\ollama\model
curl -L -f -C - --retry 3 -o delivery\ollama\model\Qwen_Qwen3-4B-Instruct-2507-Q4_K_M.gguf "https://huggingface.co/bartowski/Qwen_Qwen3-4B-Instruct-2507-GGUF/resolve/main/Qwen_Qwen3-4B-Instruct-2507-Q4_K_M.gguf" || goto :err
)
echo [6/6] Installing components...
call delivery\install.bat || goto :err
set "OLLAMA_EXE="
where ollama >nul 2>nul && set "OLLAMA_EXE=ollama"
if defined OLLAMA_EXE goto :ollama_ok
set "OLLAMA_EXE=%LocalAppData%\Programs\Ollama\ollama.exe"
if exist "%OLLAMA_EXE%" goto :ollama_ok
echo Running Ollama installer (if a window opens - click Next)...
start /wait "" delivery\OllamaSetup.exe
set "OLLAMA_EXE=%LocalAppData%\Programs\Ollama\ollama.exe"
if exist "%OLLAMA_EXE%" goto :ollama_ok
if exist "%ProgramFiles%\Ollama\ollama.exe" set "OLLAMA_EXE=%ProgramFiles%\Ollama\ollama.exe"
if defined OLLAMA_EXE goto :ollama_ok
echo ERROR: Ollama was not installed.
echo Run delivery\OllamaSetup.exe manually, then run this script again.
goto :err
:ollama_ok
echo Registering punctuation model...
"%OLLAMA_EXE%" --version >nul 2>nul || goto :err
pushd delivery
"%OLLAMA_EXE%" create qwen3-4b-instruct -f Modelfile || goto :err
"%OLLAMA_EXE%" list
popd
echo.
echo Setup finished. Opening the check page...
call delivery\start_all.bat
pause
exit /b 0
:err
echo.
echo SETUP FAILED - read the messages above and run the script again.
echo Re-runs are safe: finished steps are skipped, interrupted downloads resume.
pause
exit /b 1