Created
June 14, 2012 23:38
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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