Files
zerorigin-toolbox/build.bat
T
zerorigin2019 0a1c1e82ea chore: 初始化仓库(零源工具箱 0.1.0 基线)
- Go 主进程 cmd/zerorigin(托盘常驻 + 触发器/规则/动作引擎)
- Wails v3 设置进程 cmd/settings(独立 module)
- 监督进程 cmd/watchdog(-supervise 异常重启)
- 构建脚本 build.bat / NSIS 安装包 deploy/、便携版 portable/
- 架构与 MVP 计划文档 docs/、阶段 0-4 验收记录 deploy/acceptance-0-4.md
2026-08-05 00:42:45 +08:00

53 lines
2.0 KiB
Batchfile
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@echo off
chcp 65001 >nul
cd /d "%~dp0"
echo [build] 终止旧进程...
taskkill /f /im zerorigin.exe >nul 2>&1
taskkill /f /im ZerOriginTool-Settings.exe >nul 2>&1
echo [build] 生成主进程图标资源 (rsrc.syso)...
for /f "tokens=*" %%i in ('go env GOPATH') do set "GOPATH=%%i"
"%GOPATH%\bin\rsrc.exe" -ico assets\logo.ico -manifest app.manifest -o cmd\zerorigin\rsrc.syso
if %errorlevel% neq 0 (echo [build] rsrc 失败! && exit /b 1)
echo [build] 编译主进程...
go build -ldflags="-s -w -H windowsgui -X zerorigin/internal/version.Version=0.1.0" -o bin\ZerOriginTool.exe .\cmd\zerorigin
if %errorlevel% neq 0 (del cmd\zerorigin\rsrc.syso 2>nul && echo [build] 编译失败! && exit /b 1)
del cmd\zerorigin\rsrc.syso 2>nul
echo [build] 构建设置进程(前端 + Wails)...
set PATH=%GOPATH%\bin;%PATH%
pushd cmd\settings
call wails3 build
popd
if not exist cmd\settings\bin\settings.exe (echo [build] 设置进程构建失败! && exit /b 1)
copy /y cmd\settings\bin\settings.exe bin\ZerOriginTool-Settings.exe >nul
echo [build] 编译监督进程 (watchdog)...
go build -ldflags="-s -w -H windowsgui" -o bin\watchdog.exe .\cmd\watchdog
if %errorlevel% neq 0 (echo [build] watchdog 编译失败! && exit /b 1)
echo [build] 生成便携版...
if not exist portable mkdir portable
copy /y bin\ZerOriginTool.exe portable\ZerOriginTool.exe >nul
copy /y bin\ZerOriginTool-Settings.exe portable\ZerOriginTool-Settings.exe >nul
copy /y bin\watchdog.exe portable\watchdog.exe >nul
echo [build] 编译安装包 (NSIS)...
if exist "C:\Program Files (x86)\NSIS\makensis.exe" (
pushd deploy
"C:\Program Files (x86)\NSIS\makensis.exe" -INPUTCHARSET UTF8 installer.nsi
popd
if exist deploy\ZerOriginTool_Setup.exe (
copy /y deploy\ZerOriginTool_Setup.exe bin\ZerOriginTool_Setup.exe >nul
del deploy\ZerOriginTool_Setup.exe
)
) else (
echo [build] 未找到 NSIS,跳过安装包。
)
echo [build] 完成:
dir /b bin\*.exe
echo 便携版:portable\(含两个 exe 与说明)