@@ -10,6 +10,7 @@ param (
10
10
# Software is no longer installed with a package manager anymore to be as fast and as reliable as possible. #
11
11
# ----------------------------------------------------------------------------------------------------------- #
12
12
13
+ $timeouts = @ (" --connect-timeout" , " 5" , " --max-time" , " 10" , " --retry" , " 5" , " --retry-delay" , " 0" , " --retry-max-time" , " 40" , " --retry-all-errors" )
13
14
$msiArgs = " /qn /quiet /norestart ALLUSERS=1 REBOOT=ReallySuppress"
14
15
$arm = ((Get-CimInstance - Class Win32_ComputerSystem).SystemType -match ' ARM64' ) -or ($env: PROCESSOR_ARCHITECTURE -eq ' ARM64' )
15
16
@@ -22,7 +23,7 @@ Push-Location $tempDir
22
23
# Brave
23
24
if ($Brave ) {
24
25
Write-Output " Downloading Brave..."
25
- & curl.exe - LSs " https://laptop-updates.brave.com/latest/winx64" - o " $tempDir \BraveSetup.exe"
26
+ & curl.exe - LSs " https://laptop-updates.brave.com/latest/winx64" - o " $tempDir \BraveSetup.exe" $timeouts
26
27
if (! $? ) {
27
28
Write-Error " Downloading Brave failed."
28
29
exit 1
@@ -50,10 +51,10 @@ if ($Firefox) {
50
51
$firefoxArch = (' win64' , ' win64-aarch64' )[$arm ]
51
52
52
53
Write-Output " Downloading Firefox..."
53
- & curl.exe - LSs " https://download.mozilla.org/?product=firefox-latest-ssl&os=$firefoxArch &lang=en-US" - o " $tempDir \firefox.exe"
54
+ & curl.exe - LSs " https://download.mozilla.org/?product=firefox-latest-ssl&os=$firefoxArch &lang=en-US" - o " $tempDir \firefox.exe" $timeouts
54
55
Write-Output " Installing Firefox..."
55
56
Start-Process - FilePath " $tempDir \firefox.exe" - WindowStyle Hidden - ArgumentList ' /S /ALLUSERS=1' - Wait
56
-
57
+
57
58
Remove-TempDirectory
58
59
exit
59
60
}
@@ -62,7 +63,7 @@ if ($Firefox) {
62
63
if ($Chrome ) {
63
64
Write-Output " Downloading Google Chrome..."
64
65
$chromeArch = (' 64' , ' _Arm64' )[$arm ]
65
- & curl.exe - LSs " https://dl.google.com/dl/chrome/install/googlechromestandaloneenterprise$chromeArch .msi" - o " $tempDir \chrome.msi"
66
+ & curl.exe - LSs " https://dl.google.com/dl/chrome/install/googlechromestandaloneenterprise$chromeArch .msi" - o " $tempDir \chrome.msi" $timeouts
66
67
Write-Output " Installing Google Chrome..."
67
68
Start-Process - FilePath " $tempDir \chrome.msi" - WindowStyle Hidden - ArgumentList ' /qn' - Wait
68
69
@@ -107,7 +108,7 @@ foreach ($a in $vcredists.GetEnumerator()) {
107
108
108
109
# curl is faster than Invoke-WebRequest
109
110
Write-Output " Downloading and installing Visual C++ Runtime $vcName ..."
110
- & curl.exe - LSs " $vcUrl " - o " $vcExePath "
111
+ & curl.exe - LSs " $vcUrl " - o " $vcExePath " $timeouts
111
112
112
113
if ($vcArgs -match " :" ) {
113
114
$msiDir = " $tempDir \vcredist-$vcName "
@@ -132,7 +133,7 @@ function Install7Zip {
132
133
$7zipArch = (' x64' , ' arm64' )[$arm ]
133
134
$download = $website + ((Invoke-WebRequest $website - UseBasicParsing).Links.href | Where-Object { $_ -like " a/7z*-$7zipArch .exe" })
134
135
Write-Output " Downloading 7-Zip..."
135
- & curl.exe - LSs $download - o " $tempDir \7zip.exe"
136
+ & curl.exe - LSs $download - o " $tempDir \7zip.exe" $timeouts
136
137
Write-Output " Installing 7-Zip..."
137
138
Start-Process - FilePath " $tempDir \7zip.exe" - WindowStyle Hidden - ArgumentList ' /S' - Wait
138
139
}
@@ -145,7 +146,7 @@ function InstallNanaZip {
145
146
$assets | ForEach-Object {
146
147
$filename = $_ -split ' /' | Select-Object - Last 1
147
148
Write-Output " Downloading '$filename '..."
148
- & curl.exe - LSs $_ - o " $path \$filename "
149
+ & curl.exe - LSs $_ - o " $path \$filename " $timeouts
149
150
}
150
151
151
152
Write-Output " Installing NanaZip..."
@@ -187,7 +188,7 @@ NanaZip is a fork of 7-Zip with an updated user interface and extra features.
187
188
}
188
189
189
190
# Legacy DirectX runtimes
190
- & curl.exe - LSs " https://download.microsoft.com/download/8/4/A/84A35BF1-DAFE-4AE8-82AF-AD2AE20B6B14/directx_Jun2010_redist.exe" - o " $tempDir \directx.exe"
191
+ & curl.exe - LSs " https://download.microsoft.com/download/8/4/A/84A35BF1-DAFE-4AE8-82AF-AD2AE20B6B14/directx_Jun2010_redist.exe" - o " $tempDir \directx.exe" $timeouts
191
192
Write-Output " Extracting legacy DirectX runtimes..."
192
193
Start-Process - FilePath " $tempDir \directx.exe" - WindowStyle Hidden - ArgumentList " /q /c /t:`" $tempDir \directx`" " - Wait
193
194
Write-Output " Installing legacy DirectX runtimes..."
0 commit comments