-
Notifications
You must be signed in to change notification settings - Fork 372
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[skip ci] https://gist.github.com/a14b1e5bfaf70839b338eb1ab7f8226f/a59d1f046e118f2b7989e56670c1637a86a000df
- Loading branch information
Chocolatey
committed
Jan 20, 2018
1 parent
b07556d
commit 3dafa2a
Showing
8 changed files
with
176 additions
and
176 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
# <img src="https://cdn.rawgit.com/chocolatey/chocolatey-coreteampackages/edba4a5849ff756e767cba86641bea97ff5721fe/icons/chromium.svg" width="48" height="48"/> [chromium](https://chocolatey.org/packages/chromium) | ||
|
||
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all Internet users to experience the web. This site contains design documents, architecture overviews, testing information, and more to help you learn to build and work with the Chromium source code. | ||
|
||
## Notes | ||
|
||
- This package installs by default to the `%programfiles(x86)%` instead of `%localappdata%\Chromium`. | ||
- If you have installed this package in the past to the `%localappdata%\Chromium` location it will continue to be installed in this location. | ||
# <img src="https://cdn.rawgit.com/chocolatey/chocolatey-coreteampackages/edba4a5849ff756e767cba86641bea97ff5721fe/icons/chromium.svg" width="48" height="48"/> [chromium](https://chocolatey.org/packages/chromium) | ||
|
||
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all Internet users to experience the web. This site contains design documents, architecture overviews, testing information, and more to help you learn to build and work with the Chromium source code. | ||
|
||
## Notes | ||
|
||
- This package installs by default to the `%programfiles(x86)%` instead of `%localappdata%\Chromium`. | ||
- If you have installed this package in the past to the `%localappdata%\Chromium` location it will continue to be installed in this location. |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
// Copyright 2015 The Chromium Authors. All rights reserved. | ||
// | ||
// Redistribution and use in source and binary forms, with or without | ||
// modification, are permitted provided that the following conditions are | ||
// met: | ||
// | ||
// * Redistributions of source code must retain the above copyright | ||
// notice, this list of conditions and the following disclaimer. | ||
// * Redistributions in binary form must reproduce the above | ||
// copyright notice, this list of conditions and the following disclaimer | ||
// in the documentation and/or other materials provided with the | ||
// distribution. | ||
// * Neither the name of Google Inc. nor the names of its | ||
// contributors may be used to endorse or promote products derived from | ||
// this software without specific prior written permission. | ||
// | ||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
// Copyright 2015 The Chromium Authors. All rights reserved. | ||
// | ||
// Redistribution and use in source and binary forms, with or without | ||
// modification, are permitted provided that the following conditions are | ||
// met: | ||
// | ||
// * Redistributions of source code must retain the above copyright | ||
// notice, this list of conditions and the following disclaimer. | ||
// * Redistributions in binary form must reproduce the above | ||
// copyright notice, this list of conditions and the following disclaimer | ||
// in the documentation and/or other materials provided with the | ||
// distribution. | ||
// * Neither the name of Google Inc. nor the names of its | ||
// contributors may be used to endorse or promote products derived from | ||
// this software without specific prior written permission. | ||
// | ||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
$registry = Get-UninstallRegistryKey -SoftwareName "chromium*" | ||
$file = $registry.UninstallString | ||
$Arg_chk = ($file -match "--system-level") | ||
$chromiumArgs = @{$true = "--uninstall --system-level"; $false = "--uninstall"}[ $Arg_chk ] | ||
$silentArgs = @{$true = '--uninstall --system-level --force-uninstall'; $false = '--uninstall --force-uninstall'}[ $Arg_chk ] | ||
$myfile = $file -replace ( $chromiumArgs ) | ||
# All arguments for the Uninstallation of this package | ||
$packageArgs = @{ | ||
PackageName = 'Chromium' | ||
FileType = 'exe' | ||
SilentArgs = $silentArgs | ||
validExitCodes = @(0, 19, 21) | ||
File = $myfile | ||
} | ||
# Now to Uninstall the Package | ||
Uninstall-ChocolateyPackage @packageArgs | ||
# This at the moment does not remove the libs\Chromium folder | ||
$registry = Get-UninstallRegistryKey -SoftwareName "chromium*" | ||
$file = $registry.UninstallString | ||
$Arg_chk = ($file -match "--system-level") | ||
$chromiumArgs = @{$true = "--uninstall --system-level"; $false = "--uninstall"}[ $Arg_chk ] | ||
$silentArgs = @{$true = '--uninstall --system-level --force-uninstall'; $false = '--uninstall --force-uninstall'}[ $Arg_chk ] | ||
$myfile = $file -replace ( $chromiumArgs ) | ||
# All arguments for the Uninstallation of this package | ||
$packageArgs = @{ | ||
PackageName = 'Chromium' | ||
FileType = 'exe' | ||
SilentArgs = $silentArgs | ||
validExitCodes = @(0, 19, 21) | ||
File = $myfile | ||
} | ||
# Now to Uninstall the Package | ||
Uninstall-ChocolateyPackage @packageArgs | ||
# This at the moment does not remove the libs\Chromium folder |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
|
||
function Get-CompareVersion { | ||
param( | ||
[string]$version, | ||
[string]$notation, | ||
[string]$package | ||
) | ||
$vorgehen = $true; | ||
$packver = @{$true = $version; $false = ($version -replace($notation,""))}[ ( $version -notmatch $notation ) ] | ||
[array]$key = Get-UninstallRegistryKey -SoftwareName "$package*" | ||
if ($packver -eq ( $key.Version )) { | ||
$vorgehen = $false | ||
} | ||
return $vorgehen | ||
} | ||
|
||
function Get-CompareVersion { | ||
param( | ||
[string]$version, | ||
[string]$notation, | ||
[string]$package | ||
) | ||
$vorgehen = $true; | ||
$packver = @{$true = $version; $false = ($version -replace($notation,""))}[ ( $version -notmatch $notation ) ] | ||
[array]$key = Get-UninstallRegistryKey -SoftwareName "$package*" | ||
if ($packver -eq ( $key.Version )) { | ||
$vorgehen = $false | ||
} | ||
return $vorgehen | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,104 +1,104 @@ | ||
|
||
import-module au | ||
$releases_stable = 'https://api.github.com/repos/henrypp/chromium/releases' | ||
$releases_snapshots = 'https://chromium.woolyss.com/api/v2/?os=windows&bit=<bit>&out=string' | ||
$ChecksumType = 'sha256' | ||
|
||
function global:au_SearchReplace { | ||
@{ | ||
".\legal\verification.txt" = @{ | ||
"(?i)(\s*32\-Bit Software.*)\<.*\>" = "`${1}<$($Latest.URL32)>" | ||
"(?i)(\s*64\-Bit Software.*)\<.*\>" = "`${1}<$($Latest.URL64)>" | ||
"(?i)(^\s*checksum\s*type\:).*" = "`${1} $($Latest.ChecksumType32)" | ||
"(?i)(^\s*checksum32\:).*" = "`${1} $($Latest.Checksum32)" | ||
"(?i)(^\s*checksum64\:).*" = "`${1} $($Latest.Checksum64)" | ||
} | ||
".\tools\chocolateyInstall.ps1" = @{ | ||
'(^[$]version\s*=\s*)(".*")' = "`$1""$($Latest.Version)""" | ||
"(?i)(^\s*file\s*=\s*`"[$]toolsdir\\).*" = "`${1}$($Latest.FileName32)`"" | ||
"(?i)(^\s*file64\s*=\s*`"[$]toolsdir\\).*" = "`${1}$($Latest.FileName64)`"" | ||
} | ||
".\chromium.nuspec" = @{ | ||
"(?i)(^\s*\<title\>).*(\<\/title\>)" = "`${1}$($Latest.Title)`${2}" | ||
} | ||
} | ||
} | ||
|
||
function global:au_BeforeUpdate { | ||
Get-RemoteFiles -Purge -FileNameBase "$($Latest.PackageName)" | ||
} | ||
|
||
|
||
function Get-Snapshots { | ||
param( | ||
[string]$releases, | ||
[string]$Title | ||
) | ||
|
||
$releases_x32 = $releases -replace('<bit>','32') | ||
$releases_x64 = $releases -replace('<bit>','64') | ||
$download_page32 = Invoke-WebRequest -Uri $releases_x32 | ||
$download_page64 = Invoke-WebRequest -Uri $releases_x64 | ||
|
||
$val32 = $download_page32 -split ";" | ||
$val64 = $download_page64 -split ";" | ||
|
||
$chromium32 = $val32 | out-string | ConvertFrom-StringData | ||
$chromium64 = $val64 | out-string | ConvertFrom-StringData | ||
|
||
$version = $chromium32.version + "-snapshots" | ||
$Pre_Url = 'https://storage.googleapis.com/chromium-browser-snapshots/' | ||
$url32 = $Pre_Url+"Win/<revision>/mini_installer.exe" | ||
$url64 = $Pre_Url+"Win_x64/<revision>/mini_installer.exe" | ||
$url32 = $url32 -replace '<revision>', $chromium32.revision | ||
$url64 = $url64 -replace '<revision>', $chromium64.revision | ||
|
||
@{ | ||
Title = $Title | ||
URL32 = $url32 | ||
URL64 = $url64 | ||
Version = $version | ||
ChecksumType32 = $ChecksumType | ||
ChecksumType64 = $ChecksumType | ||
} | ||
} | ||
|
||
function Get-Stable { | ||
param( | ||
[string]$releases, | ||
[string]$Title | ||
) | ||
|
||
$allVersions = Invoke-WebRequest -Uri $releases -UseBasicParsing | ConvertFrom-Json | ||
$allStableVersions = $allVersions | Where-Object {$_.body -match "stable" -and $_.body -match "windows x86 and x64"} | ||
$latestStableVersionNumber = ($allStableVersions[0].tag_name.split('-') | Select-Object -First 1) -replace 'v', '' | ||
$anyArchLatestStablesVersions = $allVersions | Where-Object {$_.tag_name -match $latestStableVersionNumber} | ||
|
||
$32LatestVersion = $anyArchLatestStablesVersions | Where-Object {$_.tag_name -match $latestStableVersionNumber -and $_.tag_name -match "win32"} | ||
$32LatestSyncInstallUrl = ($32LatestVersion.assets | Where-Object name -match "-sync.exe").browser_download_url | ||
|
||
$64LatestVersion = $anyArchLatestStablesVersions | Where-Object {$_.tag_name -match $latestStableVersionNumber -and $_.tag_name -match "win64"} | ||
$64LatestSyncInstallUrl = ($64LatestVersion.assets | Where-Object name -match "-sync.exe").browser_download_url | ||
|
||
@{ | ||
Title = $Title | ||
URL32 = $32LatestSyncInstallUrl | ||
URL64 = $64LatestSyncInstallUrl | ||
Version = $latestStableVersionNumber | ||
ChecksumType32 = $ChecksumType | ||
ChecksumType64 = $ChecksumType | ||
} | ||
|
||
} | ||
|
||
function global:au_GetLatest { | ||
$streams = [ordered] @{ | ||
stable = Get-Stable -releases $releases_stable -Title "Chromium" | ||
snapshots = Get-Snapshots -releases $releases_snapshots -Title "Chromium Snapshots" | ||
} | ||
|
||
return @{ Streams = $streams } | ||
} | ||
|
||
|
||
update -ChecksumFor none | ||
|
||
import-module au | ||
$releases_stable = 'https://api.github.com/repos/henrypp/chromium/releases' | ||
$releases_snapshots = 'https://chromium.woolyss.com/api/v2/?os=windows&bit=<bit>&out=string' | ||
$ChecksumType = 'sha256' | ||
|
||
function global:au_SearchReplace { | ||
@{ | ||
".\legal\verification.txt" = @{ | ||
"(?i)(\s*32\-Bit Software.*)\<.*\>" = "`${1}<$($Latest.URL32)>" | ||
"(?i)(\s*64\-Bit Software.*)\<.*\>" = "`${1}<$($Latest.URL64)>" | ||
"(?i)(^\s*checksum\s*type\:).*" = "`${1} $($Latest.ChecksumType32)" | ||
"(?i)(^\s*checksum32\:).*" = "`${1} $($Latest.Checksum32)" | ||
"(?i)(^\s*checksum64\:).*" = "`${1} $($Latest.Checksum64)" | ||
} | ||
".\tools\chocolateyInstall.ps1" = @{ | ||
'(^[$]version\s*=\s*)(".*")' = "`$1""$($Latest.Version)""" | ||
"(?i)(^\s*file\s*=\s*`"[$]toolsdir\\).*" = "`${1}$($Latest.FileName32)`"" | ||
"(?i)(^\s*file64\s*=\s*`"[$]toolsdir\\).*" = "`${1}$($Latest.FileName64)`"" | ||
} | ||
".\chromium.nuspec" = @{ | ||
"(?i)(^\s*\<title\>).*(\<\/title\>)" = "`${1}$($Latest.Title)`${2}" | ||
} | ||
} | ||
} | ||
|
||
function global:au_BeforeUpdate { | ||
Get-RemoteFiles -Purge -FileNameBase "$($Latest.PackageName)" | ||
} | ||
|
||
|
||
function Get-Snapshots { | ||
param( | ||
[string]$releases, | ||
[string]$Title | ||
) | ||
|
||
$releases_x32 = $releases -replace('<bit>','32') | ||
$releases_x64 = $releases -replace('<bit>','64') | ||
$download_page32 = Invoke-WebRequest -Uri $releases_x32 | ||
$download_page64 = Invoke-WebRequest -Uri $releases_x64 | ||
|
||
$val32 = $download_page32 -split ";" | ||
$val64 = $download_page64 -split ";" | ||
|
||
$chromium32 = $val32 | out-string | ConvertFrom-StringData | ||
$chromium64 = $val64 | out-string | ConvertFrom-StringData | ||
|
||
$version = $chromium32.version + "-snapshots" | ||
$Pre_Url = 'https://storage.googleapis.com/chromium-browser-snapshots/' | ||
$url32 = $Pre_Url+"Win/<revision>/mini_installer.exe" | ||
$url64 = $Pre_Url+"Win_x64/<revision>/mini_installer.exe" | ||
$url32 = $url32 -replace '<revision>', $chromium32.revision | ||
$url64 = $url64 -replace '<revision>', $chromium64.revision | ||
|
||
@{ | ||
Title = $Title | ||
URL32 = $url32 | ||
URL64 = $url64 | ||
Version = $version | ||
ChecksumType32 = $ChecksumType | ||
ChecksumType64 = $ChecksumType | ||
} | ||
} | ||
|
||
function Get-Stable { | ||
param( | ||
[string]$releases, | ||
[string]$Title | ||
) | ||
|
||
$allVersions = Invoke-WebRequest -Uri $releases -UseBasicParsing | ConvertFrom-Json | ||
$allStableVersions = $allVersions | Where-Object {$_.body -match "stable" -and $_.body -match "windows x86 and x64"} | ||
$latestStableVersionNumber = ($allStableVersions[0].tag_name.split('-') | Select-Object -First 1) -replace 'v', '' | ||
$anyArchLatestStablesVersions = $allVersions | Where-Object {$_.tag_name -match $latestStableVersionNumber} | ||
|
||
$32LatestVersion = $anyArchLatestStablesVersions | Where-Object {$_.tag_name -match $latestStableVersionNumber -and $_.tag_name -match "win32"} | ||
$32LatestSyncInstallUrl = ($32LatestVersion.assets | Where-Object name -match "-sync.exe").browser_download_url | ||
|
||
$64LatestVersion = $anyArchLatestStablesVersions | Where-Object {$_.tag_name -match $latestStableVersionNumber -and $_.tag_name -match "win64"} | ||
$64LatestSyncInstallUrl = ($64LatestVersion.assets | Where-Object name -match "-sync.exe").browser_download_url | ||
|
||
@{ | ||
Title = $Title | ||
URL32 = $32LatestSyncInstallUrl | ||
URL64 = $64LatestSyncInstallUrl | ||
Version = $latestStableVersionNumber | ||
ChecksumType32 = $ChecksumType | ||
ChecksumType64 = $ChecksumType | ||
} | ||
|
||
} | ||
|
||
function global:au_GetLatest { | ||
$streams = [ordered] @{ | ||
stable = Get-Stable -releases $releases_stable -Title "Chromium" | ||
snapshots = Get-Snapshots -releases $releases_snapshots -Title "Chromium Snapshots" | ||
} | ||
|
||
return @{ Streams = $streams } | ||
} | ||
|
||
|
||
update -ChecksumFor none |