From 7c325fe9569fdcc4b4d5b7bd1db27d18c49baca7 Mon Sep 17 00:00:00 2001 From: xmt3061123 <71756356+xmt3061123@users.noreply.github.com> Date: Fri, 21 Jun 2024 10:57:57 +0800 Subject: [PATCH] Update setup.ps1 --- setup.ps1 | 42 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/setup.ps1 b/setup.ps1 index b5d0509..6dfd84a 100644 --- a/setup.ps1 +++ b/setup.ps1 @@ -1,3 +1,39 @@ -Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False -& {$P = $env:TEMP + '\chromeremotedesktophost.msi'; Invoke-WebRequest 'https://dl.google.com/edgedl/chrome-remote-desktop/chromeremotedesktophost.msi' -OutFile $P; Start-Process $P -Wait; Remove-Item $P} -& {$P = $env:TEMP + '\chrome_installer.exe'; Invoke-WebRequest 'https://dl.google.com/chrome/install/latest/chrome_installer.exe' -OutFile $P; Start-Process -FilePath $P -Args '/install' -Verb RunAs -Wait; Remove-Item $P} +# Disable Firewall Profiles +try { + Write-Output "Disabling Firewall Profiles for Domain, Public, and Private..." + Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False + Write-Output "Firewall Profiles disabled successfully." +} catch { + Write-Error "Failed to disable Firewall Profiles: $_" + exit 1 +} + +# Download and Install Chrome Remote Desktop Host +try { + $remoteDesktopInstaller = "$env:TEMP\chromeremotedesktophost.msi" + Write-Output "Downloading Chrome Remote Desktop Host..." + Invoke-WebRequest -Uri 'https://dl.google.com/edgedl/chrome-remote-desktop/chromeremotedesktophost.msi' -OutFile $remoteDesktopInstaller + Write-Output "Installing Chrome Remote Desktop Host..." + Start-Process -FilePath $remoteDesktopInstaller -Wait + Write-Output "Cleaning up installer..." + Remove-Item -Path $remoteDesktopInstaller + Write-Output "Chrome Remote Desktop Host installed successfully." +} catch { + Write-Error "Failed to install Chrome Remote Desktop Host: $_" + exit 1 +} + +# Download and Install Google Chrome +try { + $chromeInstaller = "$env:TEMP\chrome_installer.exe" + Write-Output "Downloading Google Chrome..." + Invoke-WebRequest -Uri 'https://dl.google.com/chrome/install/latest/chrome_installer.exe' -OutFile $chromeInstaller + Write-Output "Installing Google Chrome..." + Start-Process -FilePath $chromeInstaller -ArgumentList '/install' -Verb RunAs -Wait + Write-Output "Cleaning up installer..." + Remove-Item -Path $chromeInstaller + Write-Output "Google Chrome installed successfully." +} catch { + Write-Error "Failed to install Google Chrome: $_" + exit 1 +}