playwright/bin/reinstall_chrome_stable_win.ps1
Andrey Lushnikov 919d258356
feat: support npx playwright install chrome (#6835)
This will install latest-and-greatest chrome stable.
2021-06-01 23:16:55 -07:00

21 lines
613 B
PowerShell

$url = 'https://dl.google.com/tag/s/dl/chrome/install/beta/googlechromestandaloneenterprise.msi';
if ([Environment]::Is64BitProcess) {
$url = 'https://dl.google.com/tag/s/dl/chrome/install/beta/googlechromestandaloneenterprise64.msi'
}
$app = Get-WmiObject -Class Win32_Product | Where-Object {
$_.Name -eq "Google Chrome"
}
if ($app) {
$app.Uninstall()
}
$wc = New-Object net.webclient
$msiInstaller = "$env:temp\google-chrome.msi"
Remove-Item $msiInstaller
$wc.Downloadfile($url, $msiInstaller)
$arguments = "/i `"$msiInstaller`" /quiet"
Start-Process msiexec.exe -ArgumentList $arguments -Wait