@@ -19,23 +19,56 @@ Write-Host "Installing .NET Framework 4.6.1 Developer Pack silently..."
1919Start-Process - FilePath $DotNetInstallerPath - ArgumentList " /q" - Wait
2020Write-Host " .NET Framework 4.6.1 Developer Pack installation completed."
2121
22- # Fiddler installer (check for the latest version on the Telerik website)
23- $FiddlerInstallerUrl = " https://telerik-fiddler.s3.amazonaws.com/fiddler/FiddlerSetup.exe"
22+ # Fiddler installer (try multiple sources)
23+ $FiddlerInstallerUrls = @ (
24+ " https://api.getfiddler.com/fc/latest" ,
25+ " https://downloads.getfiddler.com/fiddler-classic/FiddlerSetup.5.0.20253.3311-latest.exe" ,
26+ " https://telerik-fiddler.s3.amazonaws.com/fiddler/FiddlerSetup.exe"
27+ )
2428$FiddlerInstallerPath = " $env: USERPROFILE \Downloads\FiddlerSetup.exe"
29+ $FiddlerDownloadSuccess = $false
2530
26- # Download Fiddler installer
27- Write-Host " Downloading Fiddler installer from $FiddlerInstallerUrl ..."
28- Invoke-WebRequest - Uri $FiddlerInstallerUrl - OutFile $FiddlerInstallerPath
31+ # Try downloading Fiddler installer from multiple sources
32+ foreach ($url in $FiddlerInstallerUrls ) {
33+ try {
34+ Write-Host " Attempting to download Fiddler installer from $url ..."
35+
36+ # Download to a temporary path first, then rename to consistent filename
37+ $tempPath = " $env: USERPROFILE \Downloads\FiddlerSetup_temp.exe"
38+ Invoke-WebRequest - Uri $url - OutFile $tempPath - ErrorAction Stop
39+
40+ if (Test-Path $tempPath ) {
41+ # Rename to consistent filename
42+ if (Test-Path $FiddlerInstallerPath ) {
43+ Remove-Item $FiddlerInstallerPath - Force
44+ }
45+ Move-Item $tempPath $FiddlerInstallerPath
46+
47+ Write-Host " Fiddler installer downloaded successfully from $url and renamed to $FiddlerInstallerPath ."
48+ $FiddlerDownloadSuccess = $true
49+ break
50+ }
51+ }
52+ catch {
53+ Write-Warning " Failed to download from $url `: $ ( $_.Exception.Message ) "
54+ # Clean up any partial downloads
55+ if (Test-Path $tempPath ) {
56+ Remove-Item $tempPath - Force - ErrorAction SilentlyContinue
57+ }
58+ if (Test-Path $FiddlerInstallerPath ) {
59+ Remove-Item $FiddlerInstallerPath - Force - ErrorAction SilentlyContinue
60+ }
61+ }
62+ }
2963
30- # Check if the download was successful
31- if (Test-Path $FiddlerInstallerPath ) {
32- Write-Host " Fiddler installer downloaded successfully to $FiddlerInstallerPath ."
33- } else {
34- Write-Host " Failed to download Fiddler installer."
64+ if (! $FiddlerDownloadSuccess ) {
65+ Write-Host " Failed to download Fiddler installer from any source."
3566 exit 1
3667}
3768
3869# Install Fiddler silently
3970Write-Host " Installing Fiddler silently..."
4071Start-Process - FilePath $FiddlerInstallerPath - ArgumentList " /S" - Wait
41- Write-Host " Fiddler installation completed."
72+ Write-Host " Fiddler installation completed."
73+
74+ Write-Host " ✅ All tools installed successfully"
0 commit comments