I have created a script to check for Architecture and snag the correct installer for Chrome. This is currently working, hope this helps others.
There is a similar Topic here: https://community.jamf.com/t5/jamf-pro/install-latest-version-of-google-chrome-without-re-packaging/m-p/156742/page/2
Wanted to start a new one with the focus on Intel and M1
Thanks to @cbrewer for the solution I did not need to choose between and intel and an M1 installer, I also Changed the .dmg to a .pkg with the extra bit of agreeing to the license etc, with the appended URL.
#!/bin/zsh
# Changed the installer from .dmg to .pkg and took out the bit for choosing an architecture.
# make temp folder for downloads
mkdir "/tmp/googlechrome"
# change working directory
cd "/tmp/googlechrome"
# Download Google Chrome
curl -L -o "/tmp/googlechrome/googlechrome.pkg" "https://dl.google.com/chrome/mac/stable/accept_tos%3Dhttps%253A%252F%252Fwww.google.com%252Fintl%252Fen_ph%252Fchrome%252Fterms%252F%26_and_accept_tos%3Dhttps%253A%252F%252Fpolicies.google.com%252Fterms/googlechrome.pkg"
# Install Google Chrome
sudo /usr/sbin/installer -pkg googlechrome.pkg -target /
#Tidy Up
sudo rm -rf "/tmp/googlechrome"
#Bless Google Chrome app
xattr -rc "/Applications/Google Chrome.app"
In case anyone has found an installer that has separate Installers for Intel Vs. ARM You could use this as a template in the download section:
# Download Correct installer based on Architecture
arch_name="$(uname -m)"
if [ "${arch_name}" = "x86_64" ];
then
curl -L -o "<path to temp directory>/<Package Name>" "URL to Intel Package"
elif [ "${arch_name}" = "arm64"]
then curl -L -o "<path to temp directory>/<Package Name>" "URL to ARM Package"
fi