mirror of
https://github.com/nyakang/nyaterm.git
synced 2026-09-22 00:01:30 +00:00
- Introduced multiple PowerShell scripts to ensure compatibility of WebView2 with Windows 7, including runtime verification, installer content checks, and PE import audits. - Added a workflow configuration for building and bundling the application specifically for Windows 7, ensuring proper handling of dependencies and runtime requirements. - Implemented logic to prepare and validate the WebView2 fixed runtime and loader, enhancing the overall compatibility and user experience on Windows 7.
35 lines
1.3 KiB
PowerShell
35 lines
1.3 KiB
PowerShell
[CmdletBinding()]
|
|
param(
|
|
[string]$RuntimeDirectory = (Join-Path $PSScriptRoot "..\..\src-tauri\webview2-fixed-runtime"),
|
|
[string]$ExpectedVersion = "109.0.1518.78"
|
|
)
|
|
|
|
Set-StrictMode -Version Latest
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
if (!(Test-Path -LiteralPath $RuntimeDirectory -PathType Container)) {
|
|
throw "Expected WebView2 fixed runtime directory does not exist: $RuntimeDirectory"
|
|
}
|
|
|
|
$runtimeExe = Join-Path $RuntimeDirectory "msedgewebview2.exe"
|
|
if (!(Test-Path -LiteralPath $runtimeExe -PathType Leaf)) {
|
|
throw "Expected WebView2 runtime executable is missing: $runtimeExe"
|
|
}
|
|
|
|
$actualVersion = (Get-Item -LiteralPath $runtimeExe).VersionInfo.ProductVersion
|
|
if ($actualVersion -notlike "$ExpectedVersion*") {
|
|
throw "Unexpected WebView2 runtime version. Expected $ExpectedVersion, actual $actualVersion."
|
|
}
|
|
|
|
$signature = Get-AuthenticodeSignature -LiteralPath $runtimeExe
|
|
if ($signature.Status -ne [System.Management.Automation.SignatureStatus]::Valid -or
|
|
$null -eq $signature.SignerCertificate -or
|
|
$signature.SignerCertificate.Subject -notmatch "Microsoft Corporation") {
|
|
throw "WebView2 runtime executable is not signed by Microsoft Corporation: $runtimeExe"
|
|
}
|
|
|
|
Write-Host "WebView2 fixed runtime verified:"
|
|
Write-Host " Directory: $RuntimeDirectory"
|
|
Write-Host " Version: $actualVersion"
|
|
Write-Host " Signer: $($signature.SignerCertificate.Subject)"
|