├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── README.md └── src └── main.rs /.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | [[package]] 2 | name = "antidote" 3 | version = "1.0.0" 4 | source = "registry+https://github.com/rust-lang/crates.io-index" 5 | 6 | [[package]] 7 | name = "bitflags" 8 | version = "0.9.1" 9 | source = "registry+https://github.com/rust-lang/crates.io-index" 10 | 11 | [[package]] 12 | name = "cc" 13 | version = "1.0.15" 14 | source = "registry+https://github.com/rust-lang/crates.io-index" 15 | 16 | [[package]] 17 | name = "chromium_updater" 18 | version = "0.1.0" 19 | dependencies = [ 20 | "hyper 0.10.4 (registry+https://github.com/rust-lang/crates.io-index)", 21 | "hyper-native-tls 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", 22 | "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", 23 | ] 24 | 25 | [[package]] 26 | name = "core-foundation" 27 | version = "0.2.3" 28 | source = "registry+https://github.com/rust-lang/crates.io-index" 29 | dependencies = [ 30 | "core-foundation-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", 31 | "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", 32 | ] 33 | 34 | [[package]] 35 | name = "core-foundation-sys" 36 | version = "0.2.3" 37 | source = "registry+https://github.com/rust-lang/crates.io-index" 38 | dependencies = [ 39 | "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", 40 | ] 41 | 42 | [[package]] 43 | name = "foreign-types" 44 | version = "0.3.2" 45 | source = "registry+https://github.com/rust-lang/crates.io-index" 46 | dependencies = [ 47 | "foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 48 | ] 49 | 50 | [[package]] 51 | name = "foreign-types-shared" 52 | version = "0.1.1" 53 | source = "registry+https://github.com/rust-lang/crates.io-index" 54 | 55 | [[package]] 56 | name = "httparse" 57 | version = "1.2.1" 58 | source = "registry+https://github.com/rust-lang/crates.io-index" 59 | 60 | [[package]] 61 | name = "hyper" 62 | version = "0.10.4" 63 | source = "registry+https://github.com/rust-lang/crates.io-index" 64 | dependencies = [ 65 | "httparse 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 66 | "language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 67 | "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", 68 | "mime 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 69 | "num_cpus 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 70 | "rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", 71 | "rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", 72 | "time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", 73 | "traitobject 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)", 74 | "typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", 75 | "unicase 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 76 | "url 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 77 | ] 78 | 79 | [[package]] 80 | name = "hyper-native-tls" 81 | version = "0.2.4" 82 | source = "registry+https://github.com/rust-lang/crates.io-index" 83 | dependencies = [ 84 | "antidote 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 85 | "hyper 0.10.4 (registry+https://github.com/rust-lang/crates.io-index)", 86 | "native-tls 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", 87 | ] 88 | 89 | [[package]] 90 | name = "idna" 91 | version = "0.1.0" 92 | source = "registry+https://github.com/rust-lang/crates.io-index" 93 | dependencies = [ 94 | "matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", 95 | "unicode-bidi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", 96 | "unicode-normalization 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", 97 | ] 98 | 99 | [[package]] 100 | name = "kernel32-sys" 101 | version = "0.2.2" 102 | source = "registry+https://github.com/rust-lang/crates.io-index" 103 | dependencies = [ 104 | "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 105 | "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 106 | ] 107 | 108 | [[package]] 109 | name = "language-tags" 110 | version = "0.2.2" 111 | source = "registry+https://github.com/rust-lang/crates.io-index" 112 | 113 | [[package]] 114 | name = "lazy_static" 115 | version = "0.2.2" 116 | source = "registry+https://github.com/rust-lang/crates.io-index" 117 | 118 | [[package]] 119 | name = "lazy_static" 120 | version = "1.0.0" 121 | source = "registry+https://github.com/rust-lang/crates.io-index" 122 | 123 | [[package]] 124 | name = "libc" 125 | version = "0.2.20" 126 | source = "registry+https://github.com/rust-lang/crates.io-index" 127 | 128 | [[package]] 129 | name = "log" 130 | version = "0.3.6" 131 | source = "registry+https://github.com/rust-lang/crates.io-index" 132 | 133 | [[package]] 134 | name = "matches" 135 | version = "0.1.4" 136 | source = "registry+https://github.com/rust-lang/crates.io-index" 137 | 138 | [[package]] 139 | name = "mime" 140 | version = "0.2.2" 141 | source = "registry+https://github.com/rust-lang/crates.io-index" 142 | dependencies = [ 143 | "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", 144 | ] 145 | 146 | [[package]] 147 | name = "native-tls" 148 | version = "0.1.5" 149 | source = "registry+https://github.com/rust-lang/crates.io-index" 150 | dependencies = [ 151 | "lazy_static 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 152 | "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", 153 | "openssl 0.9.24 (registry+https://github.com/rust-lang/crates.io-index)", 154 | "schannel 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", 155 | "security-framework 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", 156 | "security-framework-sys 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", 157 | "tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", 158 | ] 159 | 160 | [[package]] 161 | name = "num_cpus" 162 | version = "1.2.1" 163 | source = "registry+https://github.com/rust-lang/crates.io-index" 164 | dependencies = [ 165 | "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", 166 | ] 167 | 168 | [[package]] 169 | name = "openssl" 170 | version = "0.9.24" 171 | source = "registry+https://github.com/rust-lang/crates.io-index" 172 | dependencies = [ 173 | "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", 174 | "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", 175 | "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 176 | "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", 177 | "openssl-sys 0.9.30 (registry+https://github.com/rust-lang/crates.io-index)", 178 | ] 179 | 180 | [[package]] 181 | name = "openssl-sys" 182 | version = "0.9.30" 183 | source = "registry+https://github.com/rust-lang/crates.io-index" 184 | dependencies = [ 185 | "cc 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", 186 | "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", 187 | "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", 188 | "vcpkg 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", 189 | ] 190 | 191 | [[package]] 192 | name = "pkg-config" 193 | version = "0.3.9" 194 | source = "registry+https://github.com/rust-lang/crates.io-index" 195 | 196 | [[package]] 197 | name = "rand" 198 | version = "0.3.15" 199 | source = "registry+https://github.com/rust-lang/crates.io-index" 200 | dependencies = [ 201 | "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", 202 | ] 203 | 204 | [[package]] 205 | name = "redox_syscall" 206 | version = "0.1.16" 207 | source = "registry+https://github.com/rust-lang/crates.io-index" 208 | 209 | [[package]] 210 | name = "rustc-serialize" 211 | version = "0.3.22" 212 | source = "registry+https://github.com/rust-lang/crates.io-index" 213 | 214 | [[package]] 215 | name = "rustc_version" 216 | version = "0.1.7" 217 | source = "registry+https://github.com/rust-lang/crates.io-index" 218 | dependencies = [ 219 | "semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", 220 | ] 221 | 222 | [[package]] 223 | name = "schannel" 224 | version = "0.1.12" 225 | source = "registry+https://github.com/rust-lang/crates.io-index" 226 | dependencies = [ 227 | "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 228 | "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 229 | ] 230 | 231 | [[package]] 232 | name = "security-framework" 233 | version = "0.1.16" 234 | source = "registry+https://github.com/rust-lang/crates.io-index" 235 | dependencies = [ 236 | "core-foundation 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", 237 | "core-foundation-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", 238 | "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", 239 | "security-framework-sys 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", 240 | ] 241 | 242 | [[package]] 243 | name = "security-framework-sys" 244 | version = "0.1.16" 245 | source = "registry+https://github.com/rust-lang/crates.io-index" 246 | dependencies = [ 247 | "core-foundation-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", 248 | "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", 249 | ] 250 | 251 | [[package]] 252 | name = "semver" 253 | version = "0.1.20" 254 | source = "registry+https://github.com/rust-lang/crates.io-index" 255 | 256 | [[package]] 257 | name = "tempdir" 258 | version = "0.3.5" 259 | source = "registry+https://github.com/rust-lang/crates.io-index" 260 | dependencies = [ 261 | "rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", 262 | ] 263 | 264 | [[package]] 265 | name = "time" 266 | version = "0.1.36" 267 | source = "registry+https://github.com/rust-lang/crates.io-index" 268 | dependencies = [ 269 | "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 270 | "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", 271 | "redox_syscall 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", 272 | "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 273 | ] 274 | 275 | [[package]] 276 | name = "traitobject" 277 | version = "0.0.1" 278 | source = "registry+https://github.com/rust-lang/crates.io-index" 279 | 280 | [[package]] 281 | name = "typeable" 282 | version = "0.1.2" 283 | source = "registry+https://github.com/rust-lang/crates.io-index" 284 | 285 | [[package]] 286 | name = "unicase" 287 | version = "1.4.0" 288 | source = "registry+https://github.com/rust-lang/crates.io-index" 289 | dependencies = [ 290 | "rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", 291 | ] 292 | 293 | [[package]] 294 | name = "unicode-bidi" 295 | version = "0.2.5" 296 | source = "registry+https://github.com/rust-lang/crates.io-index" 297 | dependencies = [ 298 | "matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", 299 | ] 300 | 301 | [[package]] 302 | name = "unicode-normalization" 303 | version = "0.1.4" 304 | source = "registry+https://github.com/rust-lang/crates.io-index" 305 | 306 | [[package]] 307 | name = "url" 308 | version = "1.4.0" 309 | source = "registry+https://github.com/rust-lang/crates.io-index" 310 | dependencies = [ 311 | "idna 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 312 | "matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", 313 | ] 314 | 315 | [[package]] 316 | name = "vcpkg" 317 | version = "0.2.3" 318 | source = "registry+https://github.com/rust-lang/crates.io-index" 319 | 320 | [[package]] 321 | name = "winapi" 322 | version = "0.2.8" 323 | source = "registry+https://github.com/rust-lang/crates.io-index" 324 | 325 | [[package]] 326 | name = "winapi" 327 | version = "0.3.4" 328 | source = "registry+https://github.com/rust-lang/crates.io-index" 329 | dependencies = [ 330 | "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 331 | "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 332 | ] 333 | 334 | [[package]] 335 | name = "winapi-build" 336 | version = "0.1.1" 337 | source = "registry+https://github.com/rust-lang/crates.io-index" 338 | 339 | [[package]] 340 | name = "winapi-i686-pc-windows-gnu" 341 | version = "0.4.0" 342 | source = "registry+https://github.com/rust-lang/crates.io-index" 343 | 344 | [[package]] 345 | name = "winapi-x86_64-pc-windows-gnu" 346 | version = "0.4.0" 347 | source = "registry+https://github.com/rust-lang/crates.io-index" 348 | 349 | [metadata] 350 | "checksum antidote 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "34fde25430d87a9388dadbe6e34d7f72a462c8b43ac8d309b42b0a8505d7e2a5" 351 | "checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5" 352 | "checksum cc 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)" = "0ebb87d1116151416c0cf66a0e3fb6430cccd120fd6300794b4dfaa050ac40ba" 353 | "checksum core-foundation 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "25bfd746d203017f7d5cbd31ee5d8e17f94b6521c7af77ece6c9e4b2d4b16c67" 354 | "checksum core-foundation-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "065a5d7ffdcbc8fa145d6f0746f3555025b9097a9e9cda59f7467abae670c78d" 355 | "checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 356 | "checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 357 | "checksum httparse 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a6e7a63e511f9edffbab707141fbb8707d1a3098615fb2adbd5769cdfcc9b17d" 358 | "checksum hyper 0.10.4 (registry+https://github.com/rust-lang/crates.io-index)" = "220407e5a263f110ec30a071787c9535918fdfc97def5680c90013c3f30c38c1" 359 | "checksum hyper-native-tls 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "72332e4a35d3059583623b50e98e491b78f8b96c5521fcb3f428167955aa56e8" 360 | "checksum idna 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1053236e00ce4f668aeca4a769a09b3bf5a682d802abd6f3cb39374f6b162c11" 361 | "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" 362 | "checksum language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" 363 | "checksum lazy_static 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6abe0ee2e758cd6bc8a2cd56726359007748fbf4128da998b65d0b70f881e19b" 364 | "checksum lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c8f31047daa365f19be14b47c29df4f7c3b581832407daabe6ae77397619237d" 365 | "checksum libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)" = "684f330624d8c3784fb9558ca46c4ce488073a8d22450415c5eb4f4cfb0d11b5" 366 | "checksum log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ab83497bf8bf4ed2a74259c1c802351fcd67a65baa86394b6ba73c36f4838054" 367 | "checksum matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "efd7622e3022e1a6eaa602c4cea8912254e5582c9c692e9167714182244801b1" 368 | "checksum mime 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b5c93a4bd787ddc6e7833c519b73a50883deb5863d76d9b71eb8216fb7f94e66" 369 | "checksum native-tls 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f74dbadc8b43df7864539cedb7bc91345e532fdd913cfdc23ad94f4d2d40fbc0" 370 | "checksum num_cpus 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a225d1e2717567599c24f88e49f00856c6e825a12125181ee42c4257e3688d39" 371 | "checksum openssl 0.9.24 (registry+https://github.com/rust-lang/crates.io-index)" = "a3605c298474a3aa69de92d21139fb5e2a81688d308262359d85cdd0d12a7985" 372 | "checksum openssl-sys 0.9.30 (registry+https://github.com/rust-lang/crates.io-index)" = "73ae718c3562989cd3a0a5c26610feca02f8116822f6f195e6cf4887481e57f5" 373 | "checksum pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "3a8b4c6b8165cd1a1cd4b9b120978131389f64bdaf456435caa41e630edba903" 374 | "checksum rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "022e0636ec2519ddae48154b028864bdce4eaf7d35226ab8e65c611be97b189d" 375 | "checksum redox_syscall 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "8dd35cc9a8bdec562c757e3d43c1526b5c6d2653e23e2315065bc25556550753" 376 | "checksum rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)" = "237546c689f20bb44980270c73c3b9edd0891c1be49cc1274406134a66d3957b" 377 | "checksum rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "c5f5376ea5e30ce23c03eb77cbe4962b988deead10910c372b226388b594c084" 378 | "checksum schannel 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "85fd9df495640643ad2d00443b3d78aae69802ad488debab4f1dd52fc1806ade" 379 | "checksum security-framework 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "dfa44ee9c54ce5eecc9de7d5acbad112ee58755239381f687e564004ba4a2332" 380 | "checksum security-framework-sys 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "5421621e836278a0b139268f36eee0dc7e389b784dc3f79d8f11aabadf41bead" 381 | "checksum semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "d4f410fedcf71af0345d7607d246e7ad15faaadd49d240ee3b24e5dc21a820ac" 382 | "checksum tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "87974a6f5c1dfb344d733055601650059a3363de2a6104819293baff662132d6" 383 | "checksum time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)" = "211b63c112206356ef1ff9b19355f43740fc3f85960c598a93d3a3d3ba7beade" 384 | "checksum traitobject 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "07eaeb7689bb7fca7ce15628319635758eda769fed481ecfe6686ddef2600616" 385 | "checksum typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" 386 | "checksum unicase 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "13a5906ca2b98c799f4b1ab4557b76367ebd6ae5ef14930ec841c74aed5f3764" 387 | "checksum unicode-bidi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d3a078ebdd62c0e71a709c3d53d2af693fe09fe93fbff8344aebe289b78f9032" 388 | "checksum unicode-normalization 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "e28fa37426fceeb5cf8f41ee273faa7c82c47dc8fba5853402841e665fcd86ff" 389 | "checksum url 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f5ba8a749fb4479b043733416c244fa9d1d3af3d7c23804944651c8a448cb87e" 390 | "checksum vcpkg 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7ed0f6789c8a85ca41bbc1c9d175422116a9869bd1cf31bb08e1493ecce60380" 391 | "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" 392 | "checksum winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "04e3bd221fcbe8a271359c04f21a76db7d0c6028862d1bb5512d85e1e2eb5bb3" 393 | "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" 394 | "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 395 | "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 396 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "chromium_updater" 3 | version = "0.1.0" 4 | authors = ["Manvir"] 5 | 6 | [dependencies] 7 | libc = "0.2.20" 8 | hyper = "0.10.4" 9 | hyper-native-tls = "0.2.3" -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Chromium_Updater 2 | Just a single binary no config file Chromium(64bit) updater, updates Chromium(64bit) on windows startup. 3 | 4 | # Install 5 | 1) Download the binary from https://github.com/Programming4life/chromium_updater/releases, or build it yourself `cargo build --release` 6 | 7 | 2) Place it into the windows startup folder located at `C:\Users\\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\` 8 | 9 | # Force Update Check 10 | You can force an update check by just running the excatuble `chromium_updater.exe` yourself. 11 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | extern crate libc; 2 | extern crate hyper; 3 | extern crate hyper_native_tls; 4 | 5 | use std::str; 6 | use std::ptr; 7 | use std::thread; 8 | use std::io::Read; 9 | use std::fs::{File, remove_file}; 10 | use std::io::prelude::*; 11 | use std::process::Command; 12 | use std::ffi::{CString, CStr}; 13 | 14 | use libc::{c_char, c_ulong, c_void}; 15 | 16 | use hyper::Client; 17 | use hyper::net::HttpsConnector; 18 | use hyper_native_tls::NativeTlsClient; 19 | use hyper::header::Connection; 20 | 21 | #[link(name = "version")] 22 | extern "stdcall" { 23 | pub fn GetFileVersionInfoSizeA(path: *const c_char, ignore: *const u32) -> c_ulong; 24 | pub fn GetFileVersionInfoA(path: *const c_char, ignore: *const u32, buff_size: *const c_ulong, info_size_buff: *mut c_void) -> c_ulong; 25 | pub fn VerQueryValueA(info_buff: *const c_void, info_block: *const c_char, result: &mut *mut c_void, ignore: *const u32) -> c_ulong; 26 | } 27 | 28 | fn get_file_version_info_size(path: &str) -> u32 { 29 | unsafe { GetFileVersionInfoSizeA(CString::new(path).unwrap().as_ptr(), ptr::null()) } 30 | } 31 | 32 | fn get_file_version_info(exe_path: &str, size: &u32) -> Option> { 33 | let exe_path = CString::new(exe_path).unwrap(); 34 | let mut buff = vec![0; *size as usize]; // TODO Check this 35 | let result = unsafe { GetFileVersionInfoA(exe_path.as_ptr(), ptr::null(), size as *const c_ulong, buff.as_mut_ptr() as *mut c_void) }; 36 | if result != 1 { return None } 37 | Some(buff) 38 | } 39 | 40 | fn ver_query_value(version_info_buff: &Vec) -> &'static str { 41 | let mut result_ptr = ptr::null_mut(); 42 | let result = unsafe { 43 | VerQueryValueA(version_info_buff.as_ptr() as *const c_void, CString::new("\\StringFileInfo\\040904B0\\LastChange").unwrap().as_ptr(), &mut result_ptr, ptr::null()) 44 | }; 45 | if result != 1 { 46 | panic!("VerQueryValueA failed!"); 47 | } 48 | unsafe { CStr::from_ptr(result_ptr as *const c_char).to_str().unwrap() } 49 | } 50 | 51 | /* 52 | * returns 0 if unable to get local verion 53 | */ 54 | fn get_local_version(exe_path: &str) -> String { 55 | let size = get_file_version_info_size(exe_path); 56 | let buff = match get_file_version_info(exe_path, &size) { 57 | Some(val) => val, 58 | None => return "0".to_string(), 59 | }; 60 | 61 | let last_change = ver_query_value(&buff).split('#').last().unwrap(); 62 | String::from(last_change.trim_matches('}')) 63 | } 64 | 65 | fn get_remote_version(url: &str) -> String { 66 | let ssl = NativeTlsClient::new().unwrap(); 67 | let connector = HttpsConnector::new(ssl); 68 | let client = Client::with_connector(connector); 69 | let mut response = client.get(url).header(Connection::close()).send().unwrap(); 70 | let mut body = String::new(); 71 | response.read_to_string(&mut body).unwrap(); 72 | body 73 | } 74 | 75 | fn dl_intaller(out_path: &str, last_change: &str) { 76 | let installer_url = "https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Win_x64%2F".to_string() + last_change + "%2Fmini_installer.exe?alt=media"; 77 | let ssl = NativeTlsClient::new().unwrap(); 78 | let connector = HttpsConnector::new(ssl); 79 | let client = Client::with_connector(connector); 80 | let mut response = client.get(&installer_url).header(Connection::close()).send().unwrap(); 81 | let mut body = Vec::new(); 82 | response.read_to_end(&mut body).unwrap(); 83 | 84 | let mut out_file = File::create(out_path).unwrap(); 85 | out_file.write_all(&body).expect("Failed to write installer to disk!"); 86 | } 87 | 88 | fn run_installer(path: &str) { 89 | Command::new(path).output().expect("Failed to run installer!"); 90 | remove_file(path).expect("Failed to delete installer!"); 91 | } 92 | 93 | fn update(out_path: &str, remote: &str) { 94 | dl_intaller(out_path, remote); 95 | run_installer(out_path); 96 | } 97 | 98 | fn main() { 99 | const LAST_CHANGE_URL: &str = "https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Win_x64%2FLAST_CHANGE?alt=media"; 100 | const OUT_PATH: &str = "mini_installer.exe"; 101 | let chrome_exe = env!("LOCALAPPDATA").to_string() + "\\Chromium\\Application\\chrome.exe"; 102 | 103 | let remote_thread = thread::spawn(move|| { 104 | get_remote_version(LAST_CHANGE_URL) 105 | }); 106 | 107 | let local_thread = thread::spawn(move|| { 108 | get_local_version(&chrome_exe) 109 | }); 110 | 111 | let remote = remote_thread.join().unwrap(); 112 | let local = local_thread.join().unwrap(); 113 | 114 | println!("Local: {}", local); 115 | println!("Remote: {}", remote); 116 | 117 | if local != remote { 118 | update(OUT_PATH, &remote); 119 | } 120 | } 121 | --------------------------------------------------------------------------------