local-buildlisted
Install: claude install-skill zeno528/Agmux
# 本地快速编译
在本机编译**当前工作区状态**(包括未提交改动)的安装包,不触发 GitHub 发行。工具链沿用根 `AGENTS.md`;当前 Mac 的 `pnpm …` 命令通过 `./work/dev-env/run.sh …` 执行。
## Step 0: 环境检测
先按当前系统与工具 shell 选择分支;macOS 可运行下列命令,Windows 不为检测系统而启动 WSL:
```bash
uname -s
```
| 输出 | 系统 | 执行 |
|:---|:---|:---|
| Windows 上下文(或 Git Bash 的 `MINGW*` / `MSYS*` / `CYGWIN*`) | Windows | 继续 Step 1 → Step 2W |
| `Darwin` | macOS | 继续 Step 1 → Step 2M |
| 其他(`Linux` 等) | 不在覆盖范围 | 停下报告"本项目本地构建只覆盖 Windows / macOS",不构建 |
## Step 1: 快速预检(共用)
运行 `pnpm typecheck`(约 10 秒)。失败就直接停下报告错误,不要进入几分钟的编译;用户修完类型错误再重来。
Rust 侧不用预检——`pnpm tauri build` 本身会编译,有错会当场报。
## Step 2W: Windows 分支
### 图片预检(NSIS 用)
如果 `src-tauri/icons/installer-header.bmp` 或 `installer-sidebar.bmp` 存在,先确认它们是 NSIS 可读的经典 BMP:`BITMAPINFOHEADER`(DIB 大小 40)、24-bit、`BI_RGB` 无压缩。不要把 ImageMagick 默认生成的 BMP V4/V5 直接交给 NSIS:
```powershell
foreach ($bmp in @('src-tauri/icons/installer-header.bmp', 'src-tauri/icons/installer-sidebar.bmp')) {
if (-not (Test-Path -LiteralPath $bmp)) { continue }
$bytes = [IO.File]::ReadAllBytes((Resolve-Path -LiteralPath $bmp))
$dib = [BitConverter]::ToUInt32($bytes, 14)
$bpp = [BitConverter]::ToUInt16($bytes, 28)
$compression = [BitConverter]::ToUInt32($bytes, 30)
if ($bytes.Length -lt 54 -or $bytes[0] -ne 0x42 -or $bytes[1] -ne 0x4d -or $dib -ne 40 -or $bpp -ne 24 -or $compression -ne 0) {
throw "NSIS installer image is not classic 24-bit BI_RGB BMP: $bmp"
}
}
```
NSIS 3.11 Modern UI 的官方推荐尺寸是 header `150×57`、welcome/finish sidebar `164×314