Update setupScriptInfo.ps1

This commit is contained in:
2023-10-10 15:05:54 +00:00
parent 5be5111a2e
commit 50faf80352

View File

@@ -194,6 +194,29 @@ $urlShortcut = $wshShell.CreateShortcut((Join-Path $env:PUBLIC "Desktop\Framindm
$urlShortcut.TargetPath = "https://framindmap.org/"
$urlShortcut.Save()
# Set Firefox as the default browser
if (Test-Path "C:\Program Files\Mozilla Firefox\firefox.exe") {
$browserPath = "C:\Program Files\Mozilla Firefox\firefox.exe"
$browserName = "Mozilla Firefox"
$protocolKeys = "HTTP", "HTTPS", "ftp"
foreach ($key in $protocolKeys) {
$registryPath = "HKLM:\SOFTWARE\Clients\StartMenuInternet\$browserName\shell\$key\command"
Set-ItemProperty -Path $registryPath -Name "" -Value "$browserPath `"%1`""
}
$htmlRegistryPath = "HKLM:\SOFTWARE\Classes\http\shell\open\command"
Set-ItemProperty -Path $htmlRegistryPath -Name "" -Value "$browserPath `"%1`""
$urlRegistryPath = "HKLM:\SOFTWARE\Classes\https\shell\open\command"
Set-ItemProperty -Path $urlRegistryPath -Name "" -Value "$browserPath `"%1`""
$htmlAssocPath = "HKLM:\SOFTWARE\Classes\.html"
Set-ItemProperty -Path $htmlAssocPath -Name "Default" -Value "$browserName"
$urlAssocPath = "HKLM:\SOFTWARE\Classes\.url"
Set-ItemProperty -Path $urlAssocPath -Name "Default" -Value "$browserName"
[System.Diagnostics.Process]::Start("cmd.exe", "/C rundll32.exe iernonce.dll,OpenURL `$http://www.example.com`")
Write-Host "Firefox has been set as the default browser."
} else {
Write-Host "Firefox is not installed in the default path."
}
# Update Windows
Install-Module -Name PSWindowsUpdate -Force