Skip to content

Instantly share code, notes, and snippets.

@jl2
Created March 25, 2011 20:18
Show Gist options
  • Save jl2/887563 to your computer and use it in GitHub Desktop.
Save jl2/887563 to your computer and use it in GitHub Desktop.
Automatically install the latest build of Chromium
#!/usr/bin/env python3
import os
import subprocess
import http.client
# Install the latest Chromium snapshot build on Windows
conn = http.client.HTTPConnection('build.chromium.org')
conn.request("GET", '/f/chromium/snapshots/chromium-rel-xp/LATEST')
r1 = conn.getresponse()
version = r1.read().decode()
print("Upgrading to version", version)
conn.request("GET", '/f/chromium/snapshots/chromium-rel-xp/' + version + '/mini_installer.exe')
r2 = conn.getresponse()
ofname = os.environ['TEMP'] + '/mini_installer.exe'
with open(ofname, "wb") as outf:
outf.write(r2.read())
conn.close()
subprocess.call(ofname)
os.unlink(ofname)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment