From dcfeb405bff26183c4aa02e7e2f7ceb4653a8269 Mon Sep 17 00:00:00 2001 From: baiqing Date: Mon, 4 May 2026 20:39:10 +0800 Subject: [PATCH] =?UTF-8?q?chore(release):=201.2.15=20=E2=80=94=20Windows?= =?UTF-8?q?=20MSI=20=E4=BF=AE=E5=A4=8D=20IME=20bundle=20=E9=9B=86=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1.2.14 三轮 release pipeline Windows job 全挂在 WiX 集成上: 1. 没构建 IME DLL → light.exe 找不到文件 2. 加了 build 步骤后用相对路径 src-tauri\target\... → Tauri wix bundler cwd 和本地脚本不同,相对路径 resolve 错位 3. 改 $(env.OPENLESS_IME_DLL_X64) 想用绝对路径 → candle 处理 env var substitution 时 abort(具体原因被 Tauri 吞掉) 1.2.15 切换到本地 windows-package-msvc.ps1 已经验证可行的 Repair 思路: - wxs 维持字面相对路径 src-tauri\target\... (让 candle 正常吃过) - workflow 接住 tauri build 失败:从 appRoot (openless-all/app/) 手动跑 light.exe 重链 main.wixobj + openless-ime.wixobj。这是 light 唯一能 resolve 该相对路径的 cwd。 --- .github/workflows/release-tauri.yml | 49 ++++++++++++++++--- openless-all/app/package-lock.json | 4 +- openless-all/app/package.json | 2 +- openless-all/app/src-tauri/Cargo.lock | 2 +- openless-all/app/src-tauri/Cargo.toml | 2 +- openless-all/app/src-tauri/tauri.conf.json | 2 +- .../app/src-tauri/wix/openless-ime.wxs | 4 +- 7 files changed, 50 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release-tauri.yml b/.github/workflows/release-tauri.yml index bd4124d5..a452a714 100644 --- a/.github/workflows/release-tauri.yml +++ b/.github/workflows/release-tauri.yml @@ -214,20 +214,55 @@ jobs: Write-Host "[ok] built $dll (exported $($t.EnvName))" } - # ── Windows:仅 Windows 跑通用 tauri build(Linux 用下方专用 step,避免重复构建)── + # ── Windows:跑 tauri build;如果失败,从 appRoot 手动调 light.exe 重链 + # (mirror 本地 windows-package-msvc.ps1::Repair-TauriMsiBundle)。 + # 根因:openless-ime.wxs 用相对路径 src-tauri\target\... 引 IME DLL, + # Tauri wix bundler 内部 cwd 不固定,light 找不到文件;本地脚本通过把 + # light 从 openless-all/app/ 跑一遍来 resolve。issue: rounds 1-3 reaches + # same dead end via Tauri-only bundling. - name: Build (Windows) if: matrix.platform == 'windows-latest' - shell: bash + shell: pwsh working-directory: 'openless-all/app' env: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} run: | - if [ -n "${TAURI_SIGNING_PRIVATE_KEY:-}" ]; then - npm run tauri -- build --config '{"bundle":{"createUpdaterArtifacts":true}}' - else - npm run tauri build - fi + $appRoot = (Resolve-Path .).Path + if ($env:TAURI_SIGNING_PRIVATE_KEY) { + & npm run tauri -- build --config '{"bundle":{"createUpdaterArtifacts":true}}' + } else { + & npm run tauri build + } + $tauriExit = $LASTEXITCODE + + $msi = Get-ChildItem "src-tauri\target\release\bundle\msi\*.msi" -ErrorAction SilentlyContinue | Select-Object -First 1 + if (-not $msi -and $tauriExit -ne 0) { + Write-Warning "Tauri MSI failed (exit $tauriExit). Trying manual light.exe relink from app root." + $wixRoot = Join-Path $appRoot "src-tauri\target\release\wix\x64" + $mainObj = Join-Path $wixRoot "main.wixobj" + $imeObj = Join-Path $wixRoot "openless-ime.wixobj" + $locale = Join-Path $wixRoot "locale.wxl" + foreach ($p in @($mainObj, $imeObj, $locale)) { + if (-not (Test-Path $p)) { throw "Required WiX object missing: $p" } + } + $light = (Get-ChildItem "$env:LOCALAPPDATA\tauri\WixTools314\light.exe" -ErrorAction SilentlyContinue | Select-Object -First 1).FullName + if (-not $light) { throw "WiX light.exe not found in $env:LOCALAPPDATA\tauri\WixTools314" } + $version = (Get-Content src-tauri\tauri.conf.json -Raw | ConvertFrom-Json).version + $bundleDir = Join-Path $appRoot "src-tauri\target\release\bundle\msi" + New-Item -ItemType Directory -Force -Path $bundleDir | Out-Null + $msiPath = Join-Path $bundleDir "OpenLess_${version}_x64_en-US.msi" + Push-Location $appRoot + try { + & $light -nologo -ext WixUIExtension -ext WixUtilExtension -loc $locale -out $msiPath $mainObj $imeObj + if ($LASTEXITCODE -ne 0) { throw "light.exe relink failed with exit $LASTEXITCODE" } + } finally { + Pop-Location + } + Write-Host "[ok] MSI rebuilt at $msiPath" + } elseif ($tauriExit -ne 0) { + throw "Tauri build failed with exit $tauriExit and no recoverable wixobj." + } # ── Linux:产 deb / rpm / AppImage ── - name: Build (Linux) diff --git a/openless-all/app/package-lock.json b/openless-all/app/package-lock.json index d082a3b9..19aec24c 100644 --- a/openless-all/app/package-lock.json +++ b/openless-all/app/package-lock.json @@ -1,12 +1,12 @@ { "name": "openless-app", - "version": "1.2.14", + "version": "1.2.15", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "openless-app", - "version": "1.2.14", + "version": "1.2.15", "dependencies": { "@tauri-apps/api": "^2.1.1", "@tauri-apps/plugin-autostart": "^2.5.1", diff --git a/openless-all/app/package.json b/openless-all/app/package.json index efab67f3..71cb8905 100644 --- a/openless-all/app/package.json +++ b/openless-all/app/package.json @@ -1,7 +1,7 @@ { "name": "openless-app", "private": true, - "version": "1.2.14", + "version": "1.2.15", "type": "module", "scripts": { "dev": "vite", diff --git a/openless-all/app/src-tauri/Cargo.lock b/openless-all/app/src-tauri/Cargo.lock index 9e4ca497..f96af718 100644 --- a/openless-all/app/src-tauri/Cargo.lock +++ b/openless-all/app/src-tauri/Cargo.lock @@ -3281,7 +3281,7 @@ dependencies = [ [[package]] name = "openless" -version = "1.2.14" +version = "1.2.15" dependencies = [ "anyhow", "arboard", diff --git a/openless-all/app/src-tauri/Cargo.toml b/openless-all/app/src-tauri/Cargo.toml index 5983378e..a2892206 100644 --- a/openless-all/app/src-tauri/Cargo.toml +++ b/openless-all/app/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "openless" -version = "1.2.14" +version = "1.2.15" description = "OpenLess — local voice input that types where your cursor is" authors = ["OpenLess"] edition = "2021" diff --git a/openless-all/app/src-tauri/tauri.conf.json b/openless-all/app/src-tauri/tauri.conf.json index 30cff677..16a81215 100644 --- a/openless-all/app/src-tauri/tauri.conf.json +++ b/openless-all/app/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "OpenLess", - "version": "1.2.14", + "version": "1.2.15", "identifier": "com.openless.app", "build": { "beforeDevCommand": "npm run dev", diff --git a/openless-all/app/src-tauri/wix/openless-ime.wxs b/openless-all/app/src-tauri/wix/openless-ime.wxs index 027c22b1..f7571a1b 100644 --- a/openless-all/app/src-tauri/wix/openless-ime.wxs +++ b/openless-all/app/src-tauri/wix/openless-ime.wxs @@ -5,12 +5,12 @@ - + - +