fix(windows): restore Windows 7 startup compatibility

This commit is contained in:
zipg
2026-08-05 00:07:41 +08:00
committed by GitHub
parent 4aa36cb893
commit e82c1aedf0
81 changed files with 17157 additions and 66 deletions
@@ -0,0 +1,56 @@
[CmdletBinding()]
param(
[string]$RuntimeDirectory = (Join-Path $PSScriptRoot "..\..\src-tauri\webview2-fixed-runtime"),
[string]$LoaderPath = (Join-Path ([System.IO.Path]::GetTempPath()) "dbx-win7-webview2-loader-probe\WebView2Loader.dll"),
[string]$ExpectedVersion = "109.0.1518.78"
)
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
$runtimeDirectory = (Resolve-Path -LiteralPath $RuntimeDirectory).Path
$runtimeExecutable = Join-Path $runtimeDirectory "msedgewebview2.exe"
if (!(Test-Path -LiteralPath $runtimeExecutable -PathType Leaf)) {
throw "WebView2 fixed runtime executable does not exist: $runtimeExecutable"
}
$loaderPath = (Resolve-Path -LiteralPath $LoaderPath).Path
$escapedLoaderPath = $loaderPath.Replace('"', '""')
$source = @"
using System;
using System.Runtime.InteropServices;
public static class DbxWebView2LoaderProbe
{
[DllImport(@"$escapedLoaderPath", CharSet = CharSet.Unicode, ExactSpelling = true)]
public static extern int GetAvailableCoreWebView2BrowserVersionString(
string browserExecutableFolder,
out IntPtr versionInfo);
}
"@
Add-Type -TypeDefinition $source -Language CSharp
$versionPointer = [IntPtr]::Zero
$result = [DbxWebView2LoaderProbe]::GetAvailableCoreWebView2BrowserVersionString(
$runtimeDirectory,
[ref]$versionPointer
)
if ($result -ne 0) {
throw "WebView2 loader failed to recognize fixed runtime at $runtimeDirectory (HRESULT 0x$($result.ToString('X8')))."
}
if ($versionPointer -eq [IntPtr]::Zero) {
throw "WebView2 loader returned an empty version pointer for $runtimeDirectory."
}
try {
$version = [Runtime.InteropServices.Marshal]::PtrToStringUni($versionPointer)
}
finally {
[Runtime.InteropServices.Marshal]::FreeCoTaskMem($versionPointer)
}
if ([string]::IsNullOrWhiteSpace($version) -or !$version.StartsWith($ExpectedVersion)) {
throw "Expected WebView2 fixed runtime $ExpectedVersion, detected '$version'."
}
Write-Host "WebView2 fixed runtime probe passed: loader=$loaderPath runtime=$runtimeDirectory version=$version"
@@ -0,0 +1,38 @@
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[string]$InstallerPath
)
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
$installerPath = (Resolve-Path -LiteralPath $InstallerPath).Path
$installDirectory = Join-Path ([System.IO.Path]::GetTempPath()) "dbx-win7-installer-audit"
if (Test-Path -LiteralPath $installDirectory) {
Remove-Item -LiteralPath $installDirectory -Recurse -Force
}
$installer = Start-Process -FilePath $installerPath -ArgumentList @("/S", "/D=$installDirectory") -Wait -PassThru
if ($installer.ExitCode -ne 0) {
throw "Windows 7 test installer failed with exit code $($installer.ExitCode)."
}
$expectedFiles = @(
(Join-Path $installDirectory "dbx.exe"),
(Join-Path $installDirectory "webview2-fixed-runtime\msedgewebview2.exe"),
(Join-Path $installDirectory "uninstall.exe")
)
foreach ($path in $expectedFiles) {
if (!(Test-Path -LiteralPath $path -PathType Leaf)) {
throw "Windows 7 test installer omitted required file: $path"
}
}
Write-Host "Windows 7 installer content audit passed: $installerPath"
$uninstallerPath = Join-Path $installDirectory "uninstall.exe"
$uninstaller = Start-Process -FilePath $uninstallerPath -ArgumentList @("/S", "_?=$installDirectory") -Wait -PassThru
if ($uninstaller.ExitCode -ne 0) {
Write-Warning "Windows 7 test uninstaller returned exit code $($uninstaller.ExitCode)."
}
+71
View File
@@ -0,0 +1,71 @@
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[string]$BinaryPath
)
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
if (!(Test-Path -LiteralPath $BinaryPath -PathType Leaf)) {
throw "Windows 7 PE audit target does not exist: $BinaryPath"
}
$dumpbinCommand = Get-Command dumpbin.exe -ErrorAction SilentlyContinue
$dumpbinPath = if ($null -ne $dumpbinCommand) { $dumpbinCommand.Source } else { $null }
if ($null -eq $dumpbinPath) {
$vswhere = Join-Path ${env:ProgramFiles(x86)} "Microsoft Visual Studio\Installer\vswhere.exe"
if (Test-Path -LiteralPath $vswhere) {
$visualStudio = & $vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
if ($visualStudio) {
$dumpbin = Get-ChildItem (Join-Path $visualStudio "VC\Tools\MSVC") -Filter dumpbin.exe -Recurse |
Where-Object { $_.FullName -match '\\bin\\Hostx64\\x64\\dumpbin\.exe$' } |
Sort-Object FullName -Descending |
Select-Object -First 1
if ($null -ne $dumpbin) {
$dumpbinPath = $dumpbin.FullName
}
}
}
}
if ($null -eq $dumpbinPath) {
throw "Unable to find dumpbin.exe for the Windows 7 PE compatibility audit."
}
$imports = (& $dumpbinPath /nologo /imports $BinaryPath 2>&1 | Out-String)
if ($LASTEXITCODE -ne 0) {
throw "dumpbin failed while auditing ${BinaryPath}:`n$imports"
}
$forbiddenImports = [ordered]@{
"combase.dll" = "COMBASE is only available starting with Windows 8; use OLE32 imports."
"api-ms-win-core-winrt-" = "WinRT API sets are unavailable on Windows 7."
"CoIncrementMTAUsage" = "CoIncrementMTAUsage is unavailable on Windows 7."
"EventSetInformation" = "EventSetInformation is unavailable on Windows 7. Use the legacy WebView2 loader."
"GetSystemTimePreciseAsFileTime" = "GetSystemTimePreciseAsFileTime is unavailable on Windows 7."
"GetDpiForWindow" = "GetDpiForWindow is unavailable on Windows 7."
"GetSystemMetricsForDpi" = "GetSystemMetricsForDpi is unavailable on Windows 7."
"SetThreadDpiAwarenessContext" = "SetThreadDpiAwarenessContext is unavailable on Windows 7."
"VCRUNTIME140.dll" = "The Windows 7 package must not require a separately installed VC++ Runtime."
"VCRUNTIME140_1.dll" = "The Windows 7 package must not require a separately installed VC++ Runtime."
"MSVCP140.dll" = "The Windows 7 package must not require a separately installed VC++ Runtime."
"ucrtbase.dll" = "The Windows 7 package must link the Universal CRT statically."
"api-ms-win-crt-" = "The Windows 7 package must not require separately installed Universal CRT API sets."
}
$violations = @()
foreach ($entry in $forbiddenImports.GetEnumerator()) {
if ($imports -match [regex]::Escape($entry.Key)) {
$violations += "$($entry.Key): $($entry.Value)"
}
}
if ($violations.Count -gt 0) {
$summary = $violations -join "`n"
Write-Host "Full PE import table for diagnosis:"
Write-Host $imports
throw "Windows 7 incompatible PE imports detected in ${BinaryPath}:`n$summary"
}
Write-Host "Windows 7 PE import audit passed: $BinaryPath"
@@ -0,0 +1,106 @@
[CmdletBinding()]
param()
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
# Newer WebView2 static loaders import EventSetInformation, which does not exist on Windows 7.
# The loader entry points are stable, so the Win7 bundle uses the last verified compatible SDK loader.
$sdkVersion = "1.0.1054.31"
$sdkPackageSha256 = "0afe683aa3d143a5f6330db1ce833c69278b38fe5e1eadec52f26910ad26e22f"
$loaderSha256 = "76314119685bbf4c2b2423a44e81b57beadc914c943d0e772fd6bc78c8e6b0e8"
$webView2ComSysVersion = "0.38.2"
$upstreamLoaderSha256 = "0659b741bde6348d4c4a6ec4ceb9af50e3d0048ed9cd3c8659bccbb61fde55ee"
$repositoryRoot = (Resolve-Path (Join-Path $PSScriptRoot "../..")).Path
$temporaryRoot = Join-Path ([System.IO.Path]::GetTempPath()) "dbx-win7-webview2-loader-$([Guid]::NewGuid())"
$packagePath = Join-Path $temporaryRoot "Microsoft.Web.WebView2.$sdkVersion.nupkg"
$extractedPath = Join-Path $temporaryRoot "extracted"
try {
New-Item -ItemType Directory -Path $extractedPath -Force | Out-Null
$packageUrl = "https://www.nuget.org/api/v2/package/Microsoft.Web.WebView2/$sdkVersion"
Write-Host "Downloading WebView2 SDK $sdkVersion for the Windows 7 loader..."
Invoke-WebRequest -Uri $packageUrl -OutFile $packagePath -UseBasicParsing
$actualPackageSha256 = (Get-FileHash -LiteralPath $packagePath -Algorithm SHA256).Hash.ToLowerInvariant()
if ($actualPackageSha256 -ne $sdkPackageSha256) {
throw "Unexpected WebView2 SDK package SHA256: $actualPackageSha256"
}
Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::ExtractToDirectory($packagePath, $extractedPath)
$legacyLoader = Join-Path $extractedPath "build/native/x64/WebView2LoaderStatic.lib"
if (!(Test-Path -LiteralPath $legacyLoader -PathType Leaf)) {
throw "WebView2 SDK $sdkVersion does not contain the x64 static loader."
}
$legacyLoaderDll = Join-Path $extractedPath "build/native/x64/WebView2Loader.dll"
if (!(Test-Path -LiteralPath $legacyLoaderDll -PathType Leaf)) {
throw "WebView2 SDK $sdkVersion does not contain the x64 loader DLL."
}
$actualLoaderSha256 = (Get-FileHash -LiteralPath $legacyLoader -Algorithm SHA256).Hash.ToLowerInvariant()
if ($actualLoaderSha256 -ne $loaderSha256) {
throw "Unexpected Windows 7 WebView2 loader SHA256: $actualLoaderSha256"
}
Push-Location $repositoryRoot
try {
& cargo fetch --locked --target x86_64-win7-windows-msvc
if ($LASTEXITCODE -ne 0) {
throw "cargo fetch failed while preparing the Windows 7 WebView2 loader."
}
$metadataJson = & cargo metadata --locked --format-version 1
if ($LASTEXITCODE -ne 0) {
throw "cargo metadata failed while locating webview2-com-sys."
}
}
finally {
Pop-Location
}
$metadata = $metadataJson | ConvertFrom-Json
$webView2Packages = @($metadata.packages | Where-Object {
$_.name -eq "webview2-com-sys" -and $_.version -eq $webView2ComSysVersion
})
if ($webView2Packages.Count -ne 1) {
throw "Expected exactly one webview2-com-sys $webView2ComSysVersion package, found $($webView2Packages.Count)."
}
$crateRoot = Split-Path -Parent $webView2Packages[0].manifest_path
$loaderDestination = Join-Path $crateRoot "x64/WebView2LoaderStatic.lib"
if (!(Test-Path -LiteralPath $loaderDestination -PathType Leaf)) {
throw "webview2-com-sys static loader does not exist: $loaderDestination"
}
$existingLoaderSha256 = (Get-FileHash -LiteralPath $loaderDestination -Algorithm SHA256).Hash.ToLowerInvariant()
$knownLoaderHashes = @($upstreamLoaderSha256, $loaderSha256)
if ($existingLoaderSha256 -notin $knownLoaderHashes) {
throw "Refusing to replace an unknown webview2-com-sys loader SHA256: $existingLoaderSha256"
}
Set-ItemProperty -LiteralPath $loaderDestination -Name IsReadOnly -Value $false
Copy-Item -LiteralPath $legacyLoader -Destination $loaderDestination -Force
$installedLoaderSha256 = (Get-FileHash -LiteralPath $loaderDestination -Algorithm SHA256).Hash.ToLowerInvariant()
if ($installedLoaderSha256 -ne $loaderSha256) {
throw "Windows 7 WebView2 loader replacement failed: $installedLoaderSha256"
}
$probeDirectory = Join-Path ([System.IO.Path]::GetTempPath()) "dbx-win7-webview2-loader-probe"
New-Item -ItemType Directory -Path $probeDirectory -Force | Out-Null
$probeLoader = Join-Path $probeDirectory "WebView2Loader.dll"
Copy-Item -LiteralPath $legacyLoaderDll -Destination $probeLoader -Force
Write-Host "Prepared WebView2 SDK $sdkVersion static loader for Windows 7: $loaderDestination"
Write-Host "Prepared WebView2 SDK $sdkVersion loader probe DLL: $probeLoader"
}
finally {
if (Test-Path -LiteralPath $temporaryRoot) {
Remove-Item -LiteralPath $temporaryRoot -Recurse -Force
}
}
@@ -1,65 +1,76 @@
[CmdletBinding()]
param(
[string]$CacheRoot = (Join-Path $env:LOCALAPPDATA "tauri"),
[string]$RuntimeDirectory = (Join-Path $PSScriptRoot "..\..\src-tauri\webview2-fixed-runtime"),
[string]$DownloadDirectory = $env:RUNNER_TEMP
)
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
$runtimeVersion = "109.0.1518.140"
$runtimeUrl = "https://catalog.s.download.windowsupdate.com/c/msdownload/update/software/updt/2023/09/microsoftedgestandaloneinstallerx64_1c890b4b8dd6b7c93da98ebdc08ecdc5e30e50cb.exe"
$runtimeSha256 = "eac95c8095ec5f9971eade9827d8fb67fd251f5c16e702b5312d31067e39119b"
$evergreenUrl = "https://go.microsoft.com/fwlink/?linkid=2124701"
$runtimeVersion = "109.0.1518.78"
$runtimeFolderName = "Microsoft.WebView2.FixedVersionRuntime.$runtimeVersion.x64"
$archiveName = "$runtimeFolderName.cab"
$runtimeUrl = "https://github.com/westinyang/WebView2RuntimeArchive/releases/download/$runtimeVersion/$archiveName"
$runtimeSha256 = "7622281cf83de1a35e3a471f432f7a897d65f0a7d3975df08512b7b253dd45c7"
if ([string]::IsNullOrWhiteSpace($CacheRoot)) {
throw "A Tauri cache root is required."
if ([string]::IsNullOrWhiteSpace($RuntimeDirectory)) {
throw "A WebView2 fixed runtime directory is required."
}
if ([string]::IsNullOrWhiteSpace($DownloadDirectory)) {
$DownloadDirectory = [System.IO.Path]::GetTempPath()
}
New-Item -ItemType Directory -Force -Path $DownloadDirectory | Out-Null
$downloadPath = Join-Path $DownloadDirectory "MicrosoftEdgeWebView2Runtime-$runtimeVersion-x64.exe"
$archivePath = Join-Path $DownloadDirectory $archiveName
if (Test-Path $downloadPath) {
$downloadHash = (Get-FileHash -LiteralPath $downloadPath -Algorithm SHA256).Hash.ToLowerInvariant()
if (Test-Path $archivePath) {
$downloadHash = (Get-FileHash -LiteralPath $archivePath -Algorithm SHA256).Hash.ToLowerInvariant()
if ($downloadHash -ne $runtimeSha256) {
Remove-Item -LiteralPath $downloadPath -Force
Remove-Item -LiteralPath $archivePath -Force
}
}
if (!(Test-Path $downloadPath)) {
Write-Host "Downloading WebView2 Runtime $runtimeVersion for Windows 7..."
Invoke-WebRequest -Uri $runtimeUrl -OutFile $downloadPath
if (!(Test-Path $archivePath)) {
Write-Host "Downloading WebView2 fixed runtime $runtimeVersion for Windows 7..."
Invoke-WebRequest -Uri $runtimeUrl -OutFile $archivePath
}
$actualHash = (Get-FileHash -LiteralPath $downloadPath -Algorithm SHA256).Hash.ToLowerInvariant()
$actualHash = (Get-FileHash -LiteralPath $archivePath -Algorithm SHA256).Hash.ToLowerInvariant()
if ($actualHash -ne $runtimeSha256) {
throw "WebView2 Runtime SHA-256 mismatch. Expected $runtimeSha256, got $actualHash."
throw "WebView2 fixed runtime SHA-256 mismatch. Expected $runtimeSha256, got $actualHash."
}
# Tauri 2.11 does not expose an offline-installer path override. It resolves the
# Evergreen URL and reuses a matching cache entry, so place the verified 109
# installer at that exact location before bundling.
$response = Invoke-WebRequest -Uri $evergreenUrl -Method Head
$resolvedUrl = $response.BaseResponse.RequestMessage.RequestUri.AbsoluteUri
$match = [regex]::Match(
$resolvedUrl,
"/filestreamingservice/files/(?<guid>[^/]+)/(?<filename>[^/?]+)"
)
if (!$match.Success) {
throw "Unexpected Evergreen WebView2 URL: $resolvedUrl"
# Microsoft no longer publishes old Fixed Version downloads. The archive is
# accepted only when both its pinned hash and original Microsoft signature match.
$signature = Get-AuthenticodeSignature -LiteralPath $archivePath
if ($signature.Status -ne [System.Management.Automation.SignatureStatus]::Valid -or
$null -eq $signature.SignerCertificate -or
$signature.SignerCertificate.Subject -notmatch "Microsoft Corporation") {
throw "WebView2 fixed runtime does not have a valid Microsoft signature."
}
$cacheDirectory = Join-Path $CacheRoot (Join-Path "x64" $match.Groups["guid"].Value)
$cachePath = Join-Path $cacheDirectory $match.Groups["filename"].Value
New-Item -ItemType Directory -Force -Path $cacheDirectory | Out-Null
Copy-Item -LiteralPath $downloadPath -Destination $cachePath -Force
$extractDirectory = Join-Path $DownloadDirectory "dbx-webview2-fixed-runtime-$runtimeVersion"
if (Test-Path $extractDirectory) {
Remove-Item -LiteralPath $extractDirectory -Recurse -Force
}
New-Item -ItemType Directory -Force -Path $extractDirectory | Out-Null
$cacheHash = (Get-FileHash -LiteralPath $cachePath -Algorithm SHA256).Hash.ToLowerInvariant()
if ($cacheHash -ne $runtimeSha256) {
throw "Cached WebView2 Runtime SHA-256 mismatch. Expected $runtimeSha256, got $cacheHash."
$expand = Join-Path $env:SystemRoot "System32\expand.exe"
& $expand $archivePath "-F:*" $extractDirectory
if ($LASTEXITCODE -ne 0) {
throw "Failed to extract WebView2 fixed runtime archive (exit code $LASTEXITCODE)."
}
Write-Host "Prepared WebView2 Runtime $runtimeVersion at $cachePath"
$extractedRuntime = Join-Path $extractDirectory $runtimeFolderName
$runtimeExecutable = Join-Path $extractedRuntime "msedgewebview2.exe"
if (!(Test-Path $runtimeExecutable)) {
throw "Extracted WebView2 runtime is missing msedgewebview2.exe."
}
if (Test-Path $RuntimeDirectory) {
Remove-Item -LiteralPath $RuntimeDirectory -Recurse -Force
}
New-Item -ItemType Directory -Force -Path (Split-Path -Parent $RuntimeDirectory) | Out-Null
Move-Item -LiteralPath $extractedRuntime -Destination $RuntimeDirectory
Write-Host "Prepared WebView2 fixed runtime $runtimeVersion at $RuntimeDirectory"
+60 -10
View File
@@ -101,6 +101,7 @@ jobs:
timeout-minutes: 90
env:
CARGO_INCREMENTAL: "0"
RUSTFLAGS: -C debuginfo=line-tables-only -C target-feature=+crt-static
steps:
- uses: actions/checkout@v5
@@ -118,36 +119,73 @@ jobs:
- name: Install frontend dependencies
run: pnpm install --frozen-lockfile
- name: Setup Rust for standard Windows
uses: dtolnay/rust-toolchain@1.97.1
- name: Check standard Windows dependency path
run: cargo check --locked --package dbx --no-default-features --target x86_64-pc-windows-msvc
- name: Setup Rust for Windows 7
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly-2026-07-22
components: rust-src
- name: Prepare Win7-compatible WebView2 loader
shell: pwsh
run: ./.github/scripts/prepare-webview2-win7-loader.ps1
- name: Prepare WebView2 109 fixed runtime
shell: pwsh
run: ./.github/scripts/prepare-webview2-win7-runtime.ps1
- name: Probe WebView2 109 fixed runtime
shell: pwsh
run: ./.github/scripts/assert-webview2-win7-runtime.ps1
- name: Build frontend
run: pnpm build
- name: Build DBX for Windows 7
run: cargo build --locked --package dbx --release --target x86_64-win7-windows-msvc -Z build-std=std,panic_abort
- name: Prepare WebView2 109 offline runtime
shell: pwsh
run: ./.github/scripts/prepare-webview2-win7-runtime.ps1
run: |
$env:TAURI_CONFIG = Get-Content src-tauri/tauri.webview2-win7-fixed.conf.json -Raw
cargo build --locked --package dbx --release --features custom-protocol --target x86_64-win7-windows-msvc -Z build-std=std,panic_abort
- name: Bundle Windows 7 offline installer
- name: Audit Windows 7 PE imports
shell: pwsh
run: ./.github/scripts/assert-win7-pe-compat.ps1 -BinaryPath target/x86_64-win7-windows-msvc/release/dbx.exe
- name: Bundle Windows 7 fixed-runtime installer
shell: pwsh
run: |
$bundleDir = "target/x86_64-win7-windows-msvc/release/bundle/nsis"
pnpm tauri bundle --bundles nsis --target x86_64-win7-windows-msvc --config src-tauri/tauri.webview2-win7-offline.conf.json
pnpm tauri bundle --bundles nsis --target x86_64-win7-windows-msvc --config src-tauri/tauri.webview2-win7-fixed.conf.json
$installer = Get-ChildItem $bundleDir -Filter "*.exe" |
Sort-Object LastWriteTimeUtc -Descending |
Select-Object -First 1
if (!$installer) {
Write-Error "Missing Windows 7 WebView2 offline installer in ${bundleDir}"
Write-Error "Missing Windows 7 fixed-runtime installer in ${bundleDir}"
exit 1
}
Get-FileHash -LiteralPath $installer.FullName -Algorithm SHA256
- name: Audit Windows 7 installer contents
shell: pwsh
run: |
$installer = Get-ChildItem "target/x86_64-win7-windows-msvc/release/bundle/nsis" -Filter "*.exe" |
Sort-Object LastWriteTimeUtc -Descending |
Select-Object -First 1
./.github/scripts/assert-win7-installer-content.ps1 -InstallerPath $installer.FullName
- name: Upload Windows 7 test installer
uses: actions/upload-artifact@v4
with:
name: DBX-win7-fixed-runtime-test
path: target/x86_64-win7-windows-msvc/release/bundle/nsis/*.exe
if-no-files-found: error
retention-days: 7
duckdb-windows-driver:
needs: changes
if: needs.changes.outputs.duckdb_windows == 'true'
@@ -453,6 +491,7 @@ jobs:
rust:
- 'crates/**'
- 'src-tauri/**'
- 'vendor/**'
- 'Cargo.toml'
- 'Cargo.lock'
- 'rust-toolchain*'
@@ -488,16 +527,27 @@ jobs:
- '.github/workflows/ci.yml'
- '.github/workflows/update-nix-pnpm-hash.yml'
windows_win7_bundle:
- '.github/scripts/assert-win7-pe-compat.ps1'
- '.github/scripts/assert-win7-installer-content.ps1'
- '.github/scripts/assert-webview2-win7-runtime.ps1'
- '.github/scripts/prepare-webview2-win7-loader.ps1'
- '.github/scripts/prepare-webview2-win7-runtime.ps1'
- '.github/workflows/ci.yml'
- '.github/workflows/release.yml'
- 'src-tauri/tauri.webview2-win7-offline.conf.json'
- 'src-tauri/tauri.webview2-win7-fixed.conf.json'
- 'src-tauri/build.rs'
- 'src-tauri/Cargo.toml'
- 'src-tauri/windows/nsis/**'
- 'src-tauri/src/commands/update.rs'
- 'crates/dbx-core/Cargo.toml'
- 'crates/dbx-core/src/db/postgres.rs'
- 'crates/dbx-core/src/update.rs'
- 'Cargo.toml'
- 'Cargo.lock'
- 'vendor/ctor/**'
- 'vendor/dirs-sys/**'
- 'vendor/pageant/**'
- 'vendor/wry/**'
github_scripts:
- '.github/scripts/**'
- '.github/workflows/ci.yml'
@@ -522,13 +572,13 @@ jobs:
while IFS= read -r file; do
case "$file" in
Cargo.toml|Cargo.lock|rust-toolchain*|.github/workflows/ci.yml|*/Cargo.toml)
Cargo.toml|Cargo.lock|rust-toolchain*|.github/workflows/ci.yml|*/Cargo.toml|vendor/*)
full=true
break
;;
esac
done < <(git diff --name-only "$BASE_SHA" HEAD -- Cargo.toml Cargo.lock 'rust-toolchain*' crates src-tauri .github/workflows/ci.yml)
done < <(git diff --name-only "$BASE_SHA" HEAD -- Cargo.toml Cargo.lock 'rust-toolchain*' crates src-tauri vendor .github/workflows/ci.yml)
fi
echo "full=$full" >> "$GITHUB_OUTPUT"
+25 -7
View File
@@ -357,6 +357,7 @@ jobs:
CARGO_INCREMENTAL: "0"
RUSTC_WRAPPER: sccache
SCCACHE_GHA_ENABLED: ${{ secrets.SCCACHE_S3_BUCKET == '' && 'true' || 'false' }}
RUSTFLAGS: -C debuginfo=line-tables-only -C target-feature=+crt-static
steps:
- uses: actions/checkout@v5
@@ -377,6 +378,18 @@ jobs:
toolchain: nightly-2026-07-22
components: rust-src
- name: Prepare Win7-compatible WebView2 loader
shell: pwsh
run: ./.github/scripts/prepare-webview2-win7-loader.ps1
- name: Prepare WebView2 109 fixed runtime
shell: pwsh
run: ./.github/scripts/prepare-webview2-win7-runtime.ps1
- name: Probe WebView2 109 fixed runtime
shell: pwsh
run: ./.github/scripts/assert-webview2-win7-runtime.ps1
- name: Setup sccache
uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10
with:
@@ -416,13 +429,16 @@ jobs:
run: pnpm build
- name: Build DBX for Windows 7
run: cargo build --locked --package dbx --release --target x86_64-win7-windows-msvc -Z build-std=std,panic_abort
- name: Prepare WebView2 109 offline runtime
shell: pwsh
run: ./.github/scripts/prepare-webview2-win7-runtime.ps1
run: |
$env:TAURI_CONFIG = Get-Content src-tauri/tauri.webview2-win7-fixed.conf.json -Raw
cargo build --locked --package dbx --release --features custom-protocol --target x86_64-win7-windows-msvc -Z build-std=std,panic_abort
- name: Bundle and upload Windows 7 offline installer
- name: Audit Windows 7 PE imports
shell: pwsh
run: ./.github/scripts/assert-win7-pe-compat.ps1 -BinaryPath target/x86_64-win7-windows-msvc/release/dbx.exe
- name: Bundle and upload Windows 7 fixed-runtime installer
shell: pwsh
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -438,16 +454,18 @@ jobs:
exit 1
}
pnpm tauri bundle --bundles nsis --target x86_64-win7-windows-msvc --config src-tauri/tauri.webview2-win7-offline.conf.json
pnpm tauri bundle --bundles nsis --target x86_64-win7-windows-msvc --config src-tauri/tauri.webview2-win7-fixed.conf.json
$installer = Get-ChildItem $bundleDir -Filter "*.exe" |
Sort-Object LastWriteTimeUtc -Descending |
Select-Object -First 1
if (!$installer) {
Write-Error "Missing Windows 7 WebView2 offline installer in ${bundleDir}"
Write-Error "Missing Windows 7 fixed-runtime installer in ${bundleDir}"
exit 1
}
./.github/scripts/assert-win7-installer-content.ps1 -InstallerPath $installer.FullName
Copy-Item $installer.FullName $offlineName -Force
gh release upload "${env:GITHUB_REF_NAME}" $offlineName --repo "${env:GITHUB_REPOSITORY}" --clobber