Skip to content

Commit

Permalink
(maint) Fix Edge Package Test
Browse files Browse the repository at this point in the history
Add handling to bring edge under Chocolatey management if it was natively installed by a newer server OS
  • Loading branch information
ryanrichter94 committed Jul 24, 2024
1 parent b7cd018 commit 24711b3
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions Start-C4bNexusSetup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,25 @@ process {
choco source add -n 'ChocolateyCore' -s "$((Get-NexusRepository -Name 'ChocolateyCore').url)/index.json" --priority 0 --admin-only

# Install a non-IE browser for browsing the Nexus web portal.
if (-not (Test-Path 'C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe')) {
if (Test-Path 'C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe'){
Write-Host "Syncing Microsoft Edge, to bring it under Chocolatey management"
choco sync --id="Microsoft Edge" --package-id="microsoft-edge"
if ($LASTEXITCODE -eq 0) {
if (Test-Path 'HKLM:\SOFTWARE\Microsoft\Edge') {
$RegArgs = @{
Path = 'HKLM:\SOFTWARE\Microsoft\Edge\'
Name = 'HideFirstRunExperience'
Type = 'Dword'
Value = 1
Force = $true
}
$null = Set-ItemProperty @RegArgs
}
}
}
else {
Write-Host "Installing Microsoft Edge, to allow viewing the Nexus site"
choco install microsoft-edge -y --source ChocolateyInternal
choco install microsoft-edge -y --source ChocolateyCore
if ($LASTEXITCODE -eq 0) {
if (Test-Path 'HKLM:\SOFTWARE\Microsoft\Edge') {
$RegArgs = @{
Expand Down

0 comments on commit 24711b3

Please sign in to comment.