Skip to content

Instantly share code, notes, and snippets.

@mikhaelkh
Last active December 13, 2020 04:56
  • Star 5 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save mikhaelkh/12dec36d4a1c4136628b to your computer and use it in GitHub Desktop.
Chromium updater for Windows
@echo off
pushd "%~dp0"
if exist running exit
if "%PROCESSOR_ARCHITECTURE%" == "x86" set platform=Win
if "%PROCESSOR_ARCHITECTURE%" == "AMD64" set platform=Win_x64
if "%PROCESSOR_ARCHITEW6432%" == "AMD64" set platform=Win_x64
if "%platform%" == "" echo Supported only x86 and amd64 cpu architectures. & pause & exit
set channel=snapshots
set url=https://storage.googleapis.com/chromium-browser-%channel%/%platform%
set wget=wget.exe -N
type nul > running
if "%1" == "" (
%wget% %url%/LAST_CHANGE || goto hell
fc LAST_CHANGE LAST_INSTALLED && goto hell
for /f %%i in (LAST_CHANGE) do %wget% %url%/%%i/mini_installer.exe || goto hell
) else %wget% %url%/%1/mini_installer.exe || goto hell
tasklist | find "chrome.exe" && goto hell
move /y LAST_CHANGE LAST_INSTALLED
echo Installing Chromium...
start /wait mini_installer.exe
:hell
del /q running LAST_CHANGE
pushd "%localappdata%\Chromium\Application\" && del /s /q chrome.7z & popd
popd
@mikhaelkh
Copy link
Author

mikhaelkh commented Aug 7, 2014

This batch file installs and updates Chromium on Windows.
You need Wget! You can download it here. Simply put wget.exe where ChrUpdWin.cmd is.
It is recommended to put batch file in a separate directory, because it overwrites running,mini_installer.exe,LAST_CHANGE,LAST_INSTALLED without prompt!

@DDL56x
Copy link

DDL56x commented Dec 12, 2020

What's the purpose of appending "goto and/or hell" to lines 13-17/21 of this script?

@mikhaelkh
Copy link
Author

What's the purpose of appending "goto and/or hell" to lines 13-17/21 of this script?

del running & popd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment