-
Notifications
You must be signed in to change notification settings - Fork 373
/
chocolateyInstall.ps1
38 lines (35 loc) · 1.13 KB
/
chocolateyInstall.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
$ErrorActionPreference = 'Stop'
$scriptDir=$toolsDir = $(Split-Path -parent $MyInvocation.MyCommand.Definition)
. (Join-Path $scriptDir 'helper.ps1')
$version = "112.0.5613.0-snapshots"
$hive = "hkcu"
$chromium_string = "\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Chromium"
$Chromium = $hive + ":" + $chromium_string
if (Test-Path $Chromium) {
$silentArgs = '--do-not-launch-chrome'
} else {
$silentArgs = '--system-level --do-not-launch-chrome'
}
$packageArgs = @{
packageName = 'chromium'
file = "$toolsdir\chromium_x32.exe"
file64 = "$toolsdir\chromium_x64.exe"
fileType = 'exe'
silentArgs = $silentArgs
validExitCodes= @(0)
softwareName = 'Chromium'
}
if ( Get-CompareVersion -version $version -notation "-snapshots" -package "chromium" ) {
Install-ChocolateyInstallPackage @packageArgs
} else {
Write-Host "Chromium $version is already installed."
}
# Detritus Package Cleanup
$detritus = @("exe","tmp","ignore")
foreach ( $type in $detritus ) {
if ( $type -eq "tmp" ) {
Remove-Item "$toolsDir\*.${type}" -ea 0 -Force -Recurse
} else {
Remove-Item "$toolsDir\*.${type}" -ea 0 -force
}
}