From c60974d92273ef0ee9f4af7a465a61f12a312784 Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Tue, 25 May 2021 17:32:08 -0700 Subject: [PATCH] feat: do not rely on chocolatey to install Google Chrome Beta (#6735) --- .github/workflows/tests_secondary.yml | 7 +++---- utils/install-chrome-beta/reinstall_win.ps1 | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 utils/install-chrome-beta/reinstall_win.ps1 diff --git a/.github/workflows/tests_secondary.yml b/.github/workflows/tests_secondary.yml index a7d75ec332..c677a73b5b 100644 --- a/.github/workflows/tests_secondary.yml +++ b/.github/workflows/tests_secondary.yml @@ -476,13 +476,12 @@ jobs: name: "Chrome Beta (Win)" runs-on: windows-latest steps: + - uses: actions/checkout@v2 + - name: Install Chrome Beta + run: pwsh -command ".\$GITHUB_WORKSPACE\utils\install-chrome-beta\reinstall_win.ps1" - name: Install Media Pack shell: powershell run: Install-WindowsFeature Server-Media-Foundation - - name: Install Chrome Beta - shell: powershell - run: choco install -y googlechromebeta --pre --force - - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: node-version: 12 diff --git a/utils/install-chrome-beta/reinstall_win.ps1 b/utils/install-chrome-beta/reinstall_win.ps1 new file mode 100644 index 0000000000..e3aaafbcc3 --- /dev/null +++ b/utils/install-chrome-beta/reinstall_win.ps1 @@ -0,0 +1,20 @@ +$url = 'https://dl.google.com/tag/s/dl/chrome/install/beta/googlechromebetastandaloneenterprise.msi'; + +if ([Environment]::Is64BitProcess) { + $url = 'https://dl.google.com/tag/s/dl/chrome/install/beta/googlechromebetastandaloneenterprise64.msi' +} + +$app = Get-WmiObject -Class Win32_Product | Where-Object { + $_.Name -match "Google Chrome Beta" +} +if ($app) { + $app.Uninstall() +} + +$wc = New-Object net.webclient +$msiInstaller = "$env:temp\google-chrome-beta.msi" +Remove-Item $msiInstaller +$wc.Downloadfile($url, $msiInstaller) + +$arguments = "/i `"$msiInstaller`" /quiet" +Start-Process msiexec.exe -ArgumentList $arguments -Wait