fix(chrome installers): Check for existence
- Don't launch Chrome installers if they're already installed - Heuristic for Canary is a path check - Heuristic for dev channel is path check + reg key
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
<releaseNotes></releaseNotes>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="..\core\ChromeHelpers.ps1" target="tools" />
|
||||
<file src="tools\**" target="tools" />
|
||||
</files>
|
||||
</package>
|
||||
|
@@ -2,9 +2,25 @@ $package = 'Chrome.Canary'
|
||||
|
||||
try {
|
||||
|
||||
$url = 'https://dl.google.com/tag/s/appguid%3D%7B4ea16ac7-fd5a-47c3-875b-dbf4a2008c20%7D%26iid%3D%7B0281A7E2-6043-D983-8BBA-7FD622493C9D%7D%26lang%3Den%26browser%3D4%26usagestats%3D1%26appname%3DGoogle%2520Chrome%2520Canary%26needsadmin%3Dfalse/update2/installers/ChromeSetup.exe'
|
||||
function Get-CurrentDirectory
|
||||
{
|
||||
$thisName = $MyInvocation.MyCommand.Name
|
||||
[IO.Path]::GetDirectoryName((Get-Content function:$thisName).File)
|
||||
}
|
||||
|
||||
Install-ChocolateyPackage 'ChromeSetup' 'exe' '' $url
|
||||
. (Join-Path (Get-CurrentDirectory) 'ChromeHelpers.ps1')
|
||||
|
||||
$installedPath = Get-ChromePath -Canary
|
||||
if (Test-Path $installedPath)
|
||||
{
|
||||
Write-Host "Chrome Canary already installed at $installedPath"
|
||||
}
|
||||
else
|
||||
{
|
||||
$url = 'https://dl.google.com/tag/s/appguid%3D%7B4ea16ac7-fd5a-47c3-875b-dbf4a2008c20%7D%26iid%3D%7B0281A7E2-6043-D983-8BBA-7FD622493C9D%7D%26lang%3Den%26browser%3D4%26usagestats%3D1%26appname%3DGoogle%2520Chrome%2520Canary%26needsadmin%3Dfalse/update2/installers/ChromeSetup.exe'
|
||||
|
||||
Install-ChocolateyPackage 'ChromeSetup' 'exe' '' $url
|
||||
}
|
||||
|
||||
Write-ChocolateySuccess $package
|
||||
} catch {
|
||||
|
Reference in New Issue
Block a user