67 lines
1.7 KiB
Batchfile
67 lines
1.7 KiB
Batchfile
@echo off
|
|
REM Build Former for Windows
|
|
setlocal
|
|
|
|
REM --- Dependency checks ---
|
|
set "missing="
|
|
|
|
where go >nul 2>&1
|
|
if %ERRORLEVEL% NEQ 0 (
|
|
set "missing=1"
|
|
echo ERROR: Go not found.
|
|
echo Install: winget install GoLang.Go
|
|
echo Or download from https://go.dev/dl/
|
|
echo.
|
|
)
|
|
|
|
where node >nul 2>&1
|
|
if %ERRORLEVEL% NEQ 0 (
|
|
set "missing=1"
|
|
echo ERROR: Node.js not found.
|
|
echo Install: winget install OpenJS.NodeJS.LTS
|
|
echo Or download from https://nodejs.org/
|
|
echo.
|
|
)
|
|
|
|
where wails >nul 2>&1
|
|
if %ERRORLEVEL% NEQ 0 (
|
|
set "missing=1"
|
|
echo ERROR: Wails CLI not found.
|
|
echo Install: go install github.com/wailsapp/wails/v2/cmd/wails@latest
|
|
echo Docs: https://wails.io/docs/gettingstarted/installation
|
|
echo.
|
|
)
|
|
|
|
REM Check for WebView2 runtime (required by Wails on Windows)
|
|
reg query "HKLM\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" >nul 2>&1
|
|
if %ERRORLEVEL% NEQ 0 (
|
|
reg query "HKLM\SOFTWARE\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" >nul 2>&1
|
|
if %ERRORLEVEL% NEQ 0 (
|
|
set "missing=1"
|
|
echo ERROR: WebView2 runtime not found.
|
|
echo Usually pre-installed on Windows 10/11 with Edge.
|
|
echo Download: https://developer.microsoft.com/en-us/microsoft-edge/webview2/
|
|
echo.
|
|
)
|
|
)
|
|
|
|
if defined missing (
|
|
echo Install the tools listed above and re-run this script.
|
|
exit /b 1
|
|
)
|
|
|
|
REM --- Build ---
|
|
echo Generating app icon...
|
|
go run ./cmd/genicon 2>nul && echo Icon generated. || echo Icon generation skipped.
|
|
|
|
echo Building Former for Windows...
|
|
wails build -skipbindings
|
|
if %ERRORLEVEL% NEQ 0 (
|
|
echo Build failed.
|
|
exit /b 1
|
|
)
|
|
|
|
echo.
|
|
echo Done: build\bin\Former.exe
|
|
endlocal
|