Files
EuerChat/build.bat
T

38 lines
979 B
Batchfile

@echo off
title EuerChat Build
cd /d "%~dp0"
if not exist node_modules (
echo Installiere Tauri-CLI...
call npm install
if errorlevel 1 goto :fail
)
echo Baue EuerChat.exe ...
call npx tauri build --no-bundle
if errorlevel 1 goto :fail
for /f "usebackq delims=" %%v in (`node -p "require('./src-tauri/tauri.conf.json').version"`) do set VERSION=%%v
set MAKENSIS=%LOCALAPPDATA%\tauri\NSIS\makensis.exe
if not exist "%MAKENSIS%" set MAKENSIS=%ProgramFiles(x86)%\NSIS\makensis.exe
if not exist "%MAKENSIS%" (
echo [FEHLER] makensis nicht gefunden. NSIS 3 installieren: winget install NSIS.NSIS
goto :fail
)
if not exist dist mkdir dist
echo Baue Installer %VERSION% ...
"%MAKENSIS%" /V2 /DVERSION=%VERSION% installer\EuerChat.nsi
if errorlevel 1 goto :fail
copy /y src-tauri\target\release\euer-chat.exe EuerChat.exe >nul
echo [OK] Installer: dist\EuerChat_%VERSION%_x64-setup.exe
pause
exit /b 0
:fail
echo [FEHLER] Build fehlgeschlagen!
pause
exit /b 1