diff --git a/packages/googlechrome.vm/googlechrome.vm.nuspec b/packages/googlechrome.vm/googlechrome.vm.nuspec index 38e02806e..b93e9873d 100644 --- a/packages/googlechrome.vm/googlechrome.vm.nuspec +++ b/packages/googlechrome.vm/googlechrome.vm.nuspec @@ -2,11 +2,11 @@ googlechrome.vm - 0.0.0.20240405 + 0.0.0.20240425 Google LLC. Chrome is a popular web browser. - + diff --git a/packages/googlechrome.vm/tools/chocolateyinstall.ps1 b/packages/googlechrome.vm/tools/chocolateyinstall.ps1 index ebb97e19c..a89192328 100644 --- a/packages/googlechrome.vm/tools/chocolateyinstall.ps1 +++ b/packages/googlechrome.vm/tools/chocolateyinstall.ps1 @@ -22,7 +22,8 @@ try { } Install-ChocolateyInstallPackage @packageArgs -ErrorAction SilentlyContinue - VM-Assert-Path "${env:ProgramFiles}\Google\Chrome\Application\chrome.exe" + $exePath = "${env:ProgramFiles}\Google\Chrome\Application\chrome.exe" + VM-Assert-Path $exePath } catch { VM-Write-Log-Exception $_ } @@ -30,6 +31,12 @@ try { # Try to set configuration, but do not fail the package if it fails $ErrorActionPreference = 'Continue' +# Delete Desktop shortcut created during installation +$desktopShortcut = Join-Path ${Env:Public} "Desktop\Google Chrome.lnk" +if (Test-Path $desktopShortcut) { + Remove-Item $desktopShortcut -Force -ea 0 +} + # Expand the path to the Chrome User Data folder and create the "User Data" folder if it doesn't exist. $userDataPath = ${Env:LOCALAPPDATA} + "\Google\Chrome\User Data" New-Item -ItemType Directory -Path $userDataPath -Force -ea 0 | Out-Null @@ -52,3 +59,11 @@ $contentOptions = @{ Value = "`{`"privacy_sandbox`":{`"m1`":{`"row_notice_acknowledged`":true}}`}" } Set-Content @contentOptions + +# Make Chrome the default for .html files +VM-Set-Open-With-Association $exePath ".html" + +# Remove Edge from being default for file extensions so Chrome can be the default +ForEach ($hive in @("HKCU:", "HKLM:")) { + Remove-Item -Path "${hive}\SOFTWARE\Classes\MSEdgeHTM" -Recurse -ErrorAction SilentlyContinue +}