A couple of weeks ago I made a batch script, using curl, for downloading all Chrome executable files that I could find, for just in case Chrome gets messed up by an update.
Right after running the script, I didn't check to see if the executables are running fine, because I was assuming there wouldn't be a problem with them. So, after letting the script pile up Chrome versions, just a few days ago I got a big surprise when I tried installing an older version of Chrome. None of the files downloaded by the script worked. Each time I'd try running them, I'd get "unknown installer error".
This is the script:
@echo off
set date_and_time=#1_%date:~-10,2%-%date:~3,2%-%date:~-4,4%_%time:~0,2%.%time:~3,2%.%time:~6,2%.#2
md "%USERPROFILE%\Chrome_old_versions\"
set dirct="%USERPROFILE%\Chrome_old_versions\Chrome_%date:~-10,2%-%date:~3,2%-%date:~-4,4%_%time:~0,2%.%time:~3,2%.%time:~6,2%"
md "%dirct%"
cd "%dirct%"
curl --output-dir %dirct% https://dl.google.com/chrome/install/{ChromeStandaloneSetup64}.{exe} -o %date_and_time%
curl --output-dir %dirct% https://dl.google.com/chrome/install/beta/{ChromeBetaStandaloneSetup64}.{exe} -o %date_and_time%
curl --output-dir %dirct% https://dl.google.com/chrome/install/dev/{ChromeDevStandaloneSetup64}.{exe} -o %date_and_time%
curl --output-dir %dirct% https://dl.google.com/chrome/install/{ChromeStandaloneSetup}.{exe} -o %date_and_time%
curl --output-dir %dirct% https://dl.google.com/chrome/install/beta/{ChromeBetaStandaloneSetup}.{exe} -o %date_and_time%
curl --output-dir %dirct% https://dl.google.com/chrome/install/dev/{ChromeDevStandaloneSetup}.{exe} -o %date_and_time%
curl --output-dir %dirct% https://dl.google.com/chrome/mac/beta/{googlechromebeta}.{dmg} -o %date_and_time%
curl --output-dir %dirct% https://dl.google.com/release2/q/canary/{googlechrome}.{dmg} -o %date_and_time%
curl --output-dir %dirct% https://dl.google.com/chrome/mac/dev/{googlechromedev}.{dmg} -o %date_and_time%
That got me curios about why isn't it working, so I accessed https://dl.google.com/chrome/install/ChromeStandaloneSetup64.exe in Chrome and that got me a perfectly working exe. The strange thing is both exes downloaded through Chrome and curl had the same sha 512 hash. As I was puzzled, I tried wget and a powershell script.
For wget, I tried:
wget https://dl.google.com/chrome/install/ChromeStandaloneSetup64.exe --no-check-certificate
, which got me again "unknown installer error".
Thanks to @John Seerden, I then used his powershell script, which downloaded a googlechromestandaloneenterprise64.msi working executable. Seeing this, I replaced googlechromestandaloneenterprise64.msi URL in his script with https://dl.google.com/chrome/install/ChromeStandaloneSetup64.exe, but still got that error.
$uri = "https://dl.google.com/chrome/install/googlechromestandaloneenterprise64.msi"
if (-not $PSScriptRoot) {
$PSScriptRoot = Split-Path -Parent -Path $script:MyInvocation.MyCommand.Definition
}
$outFile = "$PSScriptRoot\googlechromestandaloneenterprise64.msi"
Start-BitsTransfer -Source $uri -Destination $outFile
Start-Process -FilePath $outFile -Args "/qn" -Wait
I even tried downloading https://dl.google.com/chrome/install/googlechromestandaloneenterprise64.msi using wget and curl, but still got the error.
After some googling, I got across this post, which states something about getting an untagged installer, which I think has been downloaded through a 3rd party program like curl or wget, which ended in prompting "unknown installer error".
After some more googling, I got to this post, but instead of using Charles, I used Chrome Dev Tools to get the curl request from the Network tab. This didn't work either, same error.
Is it there any way I could download perfectly fine running Chrome executables through a script or is it there any way to fix the broken executables? I would prefer to not resort to something like headless Chrome.