Skip to content

Instantly share code, notes, and snippets.

@jl2
Created June 14, 2012 23:38
Show Gist options
  • Save jl2/2933673 to your computer and use it in GitHub Desktop.
Save jl2/2933673 to your computer and use it in GitHub Desktop.
Haskell code to download and install the latest Chromium continuous build on Windows.
module Main (main) where
import System.Cmd
import Network.Socket
import System.Environment
import Network.HTTP.Conduit
import qualified Data.ByteString.Lazy.Char8 as C8
main = do
let versionUrl = "http://commondatastorage.googleapis.com/chromium-browser-continuous/Win/LAST_CHANGE"
version <- withSocketsDo $ simpleHttp versionUrl
putStrLn ("Upgrading to " ++ (C8.unpack version))
let installerUrl = ("http://commondatastorage.googleapis.com/chromium-browser-continuous/Win/" ++ (C8.unpack version) ++ "/mini_installer.exe")
chromeExe <- withSocketsDo $ simpleHttp installerUrl
tdir <- getEnv "TEMP"
let installer = (tdir ++ "/mini_installer.exe")
C8.writeFile installer chromeExe
rawSystem installer []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment