Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion .github/scripts/boot-check.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,29 @@ function killTree(child) {
}

/** Abre o exe com a pasta de dados isolada e a porta do CDP. */
/** A chave do registro com a versão do WebView2 Runtime instalada (`pv`). */
export const WEBVIEW2_CLIENT_KEY = "SOFTWARE\\WOW6432Node\\Microsoft\\EdgeUpdate\\Clients\\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}";

/**
* O que o Windows vê quando nenhuma página aparece (release da 3.0.1, 29/11/2026: 120 s sem página e sem pista): o
* processo do app e o título da janela dele (uma caixa de erro aparece aqui), os processos do WebView2 e a versão do
* runtime. Só leitura.
*/
export function diagnosticsScript(pid) {
return [
`$p = Get-Process -Id ${Number(pid)} -ErrorAction SilentlyContinue`,
`if ($p) { Write-Output ("app process alive; window title: '" + $p.MainWindowTitle + "'") } else { Write-Output "app process gone" }`,
`Write-Output ("msedgewebview2 processes: " + @(Get-Process -Name msedgewebview2 -ErrorAction SilentlyContinue).Count)`,
`$pv = (Get-ItemProperty -Path "HKLM:\\${WEBVIEW2_CLIENT_KEY}" -Name pv -ErrorAction SilentlyContinue).pv`,
`Write-Output ("WebView2 runtime: " + $(if ($pv) { $pv } else { "not installed" }))`,
].join("; ");
}

function printDiagnostics(pid) {
const r = spawnSync("powershell", ["-NoProfile", "-Command", diagnosticsScript(pid)], { encoding: "utf8", windowsHide: true });
for (const line of `${r.stdout ?? ""}`.split(/\r?\n/).filter(Boolean)) console.error(`boot-check: ${line}`);
}

export function spawnApp({ exe, port, dataDir }) {
return spawn(exe, [], { env: bootEnv(process.env, { dataDir, port }), stdio: "ignore", windowsHide: true });
}
Expand All @@ -178,7 +201,10 @@ export async function bootCheck({ exe, port, timeoutMs, settleMs }, { log = cons
const deadline = Date.now() + timeoutMs;
const page = await waitForPage(port, deadline, () => exitInfo !== undefined);
if (exitInfo) return fail(`the app exited (code ${exitInfo.code}, ${exitInfo.signal ?? "no signal"}) before the WebView2 page came up (another instance already running?)`);
if (!page) return fail(`no WebView2 page on port ${port} after ${timeoutMs / 1000}s`);
if (!page) {
printDiagnostics(child.pid);
return fail(`no WebView2 page on port ${port} after ${timeoutMs / 1000}s`);
}
log(`boot-check: CDP page ${page.url}`);
cdp = await connect(page.webSocketDebuggerUrl, (m) => {
const d = describeCdpEvent(m);
Expand Down
16 changes: 16 additions & 0 deletions .github/scripts/boot-check.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,26 @@ import {
bootEnv,
bootVerdict,
describeCdpEvent,
diagnosticsScript,
WEBVIEW2_CLIENT_KEY,
parseArgs,
pickMainPage,
} from "./boot-check.mjs";

// Release da 3.0.1 (29/11/2026): no runner do GitHub o app abriu e nenhuma página apareceu em 120 s, sem nenhuma pista
// no log. A falha agora diz o que o Windows vê: o processo, o título da janela (uma caixa de erro aparece aqui), os
// processos do WebView2 e a versão do runtime instalada.
describe("boot-check failure diagnostics", () => {
it("asks Windows about the app process, its window, the WebView2 processes and the runtime version", () => {
const script = diagnosticsScript(4242);
expect(script).toContain("Get-Process -Id 4242");
expect(script).toContain("MainWindowTitle");
expect(script).toContain("msedgewebview2");
expect(script).toContain(WEBVIEW2_CLIENT_KEY);
expect(WEBVIEW2_CLIENT_KEY).toContain("{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}");
});
});

describe("boot-check arguments", () => {
it("needs the exe and has defaults for the rest", () => {
expect(() => parseArgs([])).toThrow(/--exe/);
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/release-v4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,29 @@ jobs:
ConvertTo-Json $tauriConf -Depth 32 | Set-Content -LiteralPath $file -Encoding utf8
}

# O runner do GitHub não traz o WebView2 Runtime garantido (a imagem lista só o Edge): sem ele o exe abre e
# nenhuma página aparece (release da 3.0.1, 29/11/2026). O log diz se o runtime já estava lá; se não, o
# instalador oficial (evergreen) o instala em silêncio, antes dos boot checks.
- name: Ensure the WebView2 runtime
run: |
$keys = @(
"HKLM:\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}",
"HKLM:\SOFTWARE\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}"
)
function RuntimeVersion { foreach ($k in $keys) { $pv = (Get-ItemProperty -Path $k -Name pv -ErrorAction SilentlyContinue).pv; if ($pv -and $pv -ne "0.0.0.0") { return $pv } }; return $null }
$pv = RuntimeVersion
if ($pv) {
Write-Host "WebView2 runtime already installed: $pv"
} else {
Write-Host "WebView2 runtime not found; installing the evergreen bootstrapper"
$setup = Join-Path $env:RUNNER_TEMP "MicrosoftEdgeWebview2Setup.exe"
Invoke-WebRequest -Uri "https://go.microsoft.com/fwlink/p/?LinkId=2124703" -OutFile $setup
Start-Process -FilePath $setup -ArgumentList "/silent", "/install" -Wait
$pv = RuntimeVersion
if (-not $pv) { throw "WebView2 runtime still missing after the install" }
Write-Host "WebView2 runtime installed: $pv"
}

- name: Build standard edition and create the draft release
id: standard_build
uses: tauri-apps/tauri-action@84b9d35b5fc46c1e45415bdb6144030364f7ebc5 # v0
Expand Down
Loading