What i do is that the download is done via AutoPKG and the packaging via Composer. There i use a postinstall/postupgrade script which does (maybe this could also be done through munki as a install script)
- create a Google Chrome Master Preference with the adequate values (you should modify them for your needs)
So when you look at the Chrome help the updater shows an error 10 and cannot update anymore, also some first run dialogs doesn't come up
#!/usr/bin/env bash
## postinstall
pathToScript=$0
pathToPackage=$1
targetLocation=$2
targetVolume=$3
# adjust Chrome Version
ChromeVersion="49.0.2623.75"
LibraryDir="Library"
GoogleDir="Google"
ChromeDir="Chrome"
FirstRunFile="First Run"
ApplicationSupportDir="Application Support"
UserTemplateBasePath="/System/${LibraryDir}/User Template"
GoogleChromeMasterPreferencesFile="Google Chrome Master Preferences"
UserBasePath="/Users"
UserDirs=( $( (cd "${UserBasePath}" && find * -type d -maxdepth 0 \( -iname guest* -o -iname shared \) -prune -o -type d -print) ) )
Nul=/dev/null
# disable Google Updater check interval
defaults write com.google.Keystone.Agent checkInterval 0 >${Nul} 2>&1
# delete Google Updater
ksinstallCmdFQFN="/Applications/Google\ Chrome.app/Contents/Versions/${ChromeVersion}/Google\ Chrome\ Framework.framework/Frameworks/KeystoneRegistration.framework/Resources/ksinstall"
if [[ -x "${ksinstallCmdFQFN}" ]]; then
RClog="$(${ksinstallCmdFQFN} --nuke 2>&1)"
RC=${?}
if [[ ${RC} -ne 0 ]]; then
echo "ERROR: System ksinstall failed, RC=${RC}, Log=${RClog}"
exit 1
fi
fi
# create First Run for new users
for UserTemplate in "${UserTemplateBasePath}"/*; do
ChromeUserTemplateDir="${UserTemplate}/${ApplicationSupportDir}/${GoogleDir}/${ChromeDir}"
RClog="$(mkdir -p "${ChromeUserTemplateDir}" 2>&1)"
RC=${?}
if [[ ${RC} -eq 0 ]]; then
FirstRunFQFN="${ChromeUserTemplateDir}/${FirstRunFile}"
RClog="$(touch "${FirstRunFQFN}" 2>&1)"
RC=${?}
if [[ ${RC} -ne 0 ]]; then
echo "ERROR: System touch ${FirstRunFQFN} failed, RC=${RC}, Log=${RClog}"
exit 1
fi
else
echo "ERROR: System mkdir ${ChromeUserTemplateDir} failed, RC=${RC}, Log=${RClog}"
exit 1
fi
done
# delete Google Updater and create First Run for existing users
for UserDir in "${UserDirs[@]}"; do
eval $(dscl . read "${UserBasePath}/${UserDir}" UniqueID PrimaryGroupID 2>${Nul} | awk 'BEGIN { FS=": " } /^UniqueID:/ { printf("User%s=%s; ", $1, $2) } /^PrimaryGroupID:/ { printf("User%s=%s; ", $1, $2) }')
if [[ ! -z "${UserUniqueID}" && ! -z "${UserPrimaryGroupID}" ]]; then
UserLibraryDir="${UserBasePath}/${UserDir}/${LibraryDir}"
GoogleBasePath="${UserLibraryDir}/${GoogleDir}"
GoogleSoftwareUpdateDir="${GoogleBasePath}/GoogleSoftwareUpdate"
if [[ -e "${GoogleSoftwareUpdateDir}" ]]; then
ksinstallCmdFQFN="${GoogleSoftwareUpdateDir}/GoogleSoftwareUpdate.bundle/Contents/Resources/ksinstall"
if [[ -f "${ksinstallCmdFQFN}" ]]; then
RClog="$(${ksinstallCmdFQFN} --nuke 2>&1)"
RC=${?}
if [[ ${RC} -ne 0 ]]; then
echo "ERROR: User ksinstall failed, RC=${RC}, Log=${RClog}"
exit 1
fi
fi
fi
if [[ ! -d "${GoogleBasePath}" ]]; then
RClog="$(mkdir -p "${GoogleBasePath}" 2>&1)"
RC=${?}
if [[ ${RC} -ne 0 ]]; then
echo "ERROR: User mkdir ${GoogleBasePath} failed, RC=${RC}, Log=${RClog}"
exit 1
fi
fi
rm -rf "${GoogleSoftwareUpdateDir}" 2>${Nul}
RClog="$(touch "${GoogleSoftwareUpdateDir}" 2>&1)"
RC=${?}
if [[ ${RC} -eq 0 ]]; then
RClog="$(chown ${UserUniqueID}:${UserPrimaryGroupID} "${GoogleSoftwareUpdateDir}")"
RC=${?}
if [[ ${RC} -ne 0 ]]; then
echo "ERROR: User chown ${GoogleSoftwareUpdateDir} failed, RC=${RC}, Log=${RClog}"
exit 1
fi
else
echo "ERROR: User touch ${GoogleSoftwareUpdateDir} failed, RC=${RC}, Log=${RClog}"
exit 1
fi
FirstRunBaseDir="${UserLibraryDir}/${ApplicationSupportDir}/${GoogleDir}"
FirstRunDir="${FirstRunBaseDir}/${ChromeDir}"
FirstRunFQFN="${FirstRunDir}/${FirstRunFile}"
if [[ ! -d "${FirstRunDir}" ]]; then
RClog="$(mkdir -p "${FirstRunDir}" 2>&1)"
RC=${?}
if [[ ${RC} -ne 0 ]]; then
echo "ERROR: User mkdir ${FirstRunDir} failed, RC=${RC}, Log=${RClog}"
exit 1
fi
fi
RClog="$(touch "${FirstRunFQFN}" 2>&1)"
RC=${?}
if [[ ${RC} -eq 0 ]]; then
RClog="$(chown -R ${UserUniqueID}:${UserPrimaryGroupID} "${FirstRunBaseDir}")"
RC=${?}
if [[ ${RC} -eq 0 ]]; then
RClog="$(chmod 600 ${FirstRunFQFN})"
RC=${?}
if [[ ${RC} -ne 0 ]]; then
echo "ERROR: User chown -R ${FirstRunBaseDir} failed, RC=${RC}, Log=${RClog}"
exit 1
fi
else
echo "ERROR: User chown ${FirstRunFQFN} failed, RC=${RC}, Log=${RClog}"
exit 1
fi
else
echo "ERROR: User touch ${FirstRunFQFN} failed, RC=${RC}, Log=${RClog}"
exit 1
fi
fi
done
# create the Google Chrome Master Preferences
GoogleBasePath="/${LibraryDir}/${GoogleDir}"
GoogleChromeMasterPreferencesFQFN="${GoogleBasePath}/${GoogleChromeMasterPreferencesFile}"
if [[ ! -d ${GoogleBasePath} ]]; then
RClog="$(mkdir ${GoogleBasePath} 2>&1)"
RC=${?}
if [[ ${RC} -ne 0 ]]; then
echo "ERROR: mkdir ${GoogleBasePath} failed, RC=${RC}, Log=${RClog}"
exit 1
fi
fi
cat >"${GoogleChromeMasterPreferencesFQFN}" 2>${Nul} <<EOF
{
"enable_do_not_track": true,
"bookmark_bar": {
"show_on_all_tabs": true
},
"browser": {
"check_default_browser": false,
"show_home_button": true
},
"distribution": {
"auto_launch_chrome": false,
"chrome": true,
"do_not_launch_chrome": true,
"do_not_register_for_update_launch": true,
"make_chrome_default": false,
"make_chrome_default_for_user": false,
"multi_install": true,
"import_bookmarks": false,
"import_bookmarks_from_file": "",
"import_home_page": false,
"import_search_engine": false,
"oem_bubble": false,
"require_eula": false,
"show_welcome_page": false,
"skip_first_run_ui": true,
"suppress_first_run_bubble": true,
"suppress_first_run_default_browser_prompt": true,
"system_level": true,
"verbose_logging": false
},
"first_run_tabs": [
],
"homepage_is_newtabpage": false,
"session": {
"restore_on_startup": 4,
},
"sync_promo": {
"show_on_first_run_allowed": false,
"user_skipped": true
}
}
EOF
RC=${?}
if [[ ${RC} -eq 0 ]]; then
RClog="$(chown -R root:wheel "${GoogleBasePath}" 2>&1)"
RC=${?}
if [[ ${RC} -eq 0 ]]; then
RClog="$(chmod -R 755 "${GoogleBasePath}" 2>&1)"
RC=${?}
if [[ ${RC} -ne 0 ]]; then
echo "ERROR: chmod ${GoogleBasePath} failed, RC=${RC}, Log=${RClog}"
exit 1
fi
else
echo "ERROR: chown ${GoogleBasePath} failed, RC=${RC}, Log=${RClog}"
exit 1
fi
else
echo "ERROR: Could not write ${GoogleChromeMasterPreferencesFQFN}, RC=${RC}"
exit 1
fi
exit 0 ## Success
exit 1 ## Failure
######### End of script #########