lib/.playwright/package/bin/reinstall_chrome_stable_win.ps1
$ErrorActionPreference = 'Stop' $url = 'https://dl.google.com/tag/s/dl/chrome/install/googlechromestandaloneenterprise64.msi' $wc = Microsoft.PowerShell.Utility\New-Object net.webclient $msiInstaller = "$env:temp\google-chrome.msi" Microsoft.PowerShell.Utility\Write-Host "Downloading Google Chrome" $wc.Downloadfile($url, $msiInstaller) Microsoft.PowerShell.Utility\Write-Host "Installing Google Chrome" $arguments = "/i `"$msiInstaller`" /quiet" Microsoft.PowerShell.Management\Start-Process msiexec.exe -ArgumentList $arguments -Wait Microsoft.PowerShell.Management\Remove-Item $msiInstaller $suffix = "\\Google\\Chrome\\Application\\chrome.exe" if (Microsoft.PowerShell.Management\Test-Path "${env:ProgramFiles(x86)}$suffix") { (Microsoft.PowerShell.Management\Get-Item "${env:ProgramFiles(x86)}$suffix").VersionInfo } elseif (Microsoft.PowerShell.Management\Test-Path "${env:ProgramFiles}$suffix") { (Microsoft.PowerShell.Management\Get-Item "${env:ProgramFiles}$suffix").VersionInfo } else { Microsoft.PowerShell.Utility\Write-Host "ERROR: Failed to install Google Chrome." Microsoft.PowerShell.Utility\Write-Host "ERROR: This could be due to insufficient privileges, in which case re-running as Administrator may help." exit 1 } |