Skip to content

Commit

Permalink
Update setup.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
xmt3061123 committed Jun 21, 2024
1 parent cb26cf0 commit 7c325fe
Showing 1 changed file with 39 additions and 3 deletions.
42 changes: 39 additions & 3 deletions setup.ps1
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit 7c325fe

Please sign in to comment.