Friday, January 6, 2017

Google Chrome silent install

Latest 64-bit msi installer: GoogleChromeStandaloneEnterprise64.msi
Latest 32-bit msi installer: GoogleChromeStandaloneEnterprise.msi

silent-install.cmd
@echo off
set n=Google Chrome
setlocal EnableDelayedExpansion
reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" /s | find "%n%"
if not !errorlevel!==0 (
echo %n%

:x64
if not "%ProgramFiles(x86)%"=="" (
for /f "delims=" %%f in ('dir /b "%~dp0googlechromestandaloneenterprise64.msi"') do (
%systemroot%\system32\msiexec.exe /i "%~dp0%%f" /qn
)
)

:x86
if "%ProgramFiles(x86)%"=="" (
for /f "delims=" %%f in ('dir /b "%~dp0googlechromestandaloneenterprise.msi"') do (
%systemroot%\system32\msiexec.exe /i "%~dp0%%f" /qn
)
)

) else echo %n% already exists!
endlocal

0 comments:

Post a Comment

Blog Archive