Skip to content

Commit 238c0e2

Browse files
U/sgriffin/depends (#210)
* fix dependency * update json reference * get latest fiddler for build
1 parent 40067e7 commit 238c0e2

File tree

2 files changed

+45
-12
lines changed

2 files changed

+45
-12
lines changed

MAPIInspector/Source/MAPIInspector.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
<HintPath>$(FiddlerPath)\Fiddler.exe</HintPath>
7979
<Private>False</Private>
8080
</Reference>
81-
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
81+
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
8282
<SpecificVersion>False</SpecificVersion>
8383
<HintPath>$(FiddlerPath)\Newtonsoft.Json.dll</HintPath>
8484
<Private>False</Private>

scripts/machine-setup.ps1

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,56 @@ Write-Host "Installing .NET Framework 4.6.1 Developer Pack silently..."
1919
Start-Process -FilePath $DotNetInstallerPath -ArgumentList "/q" -Wait
2020
Write-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
3970
Write-Host "Installing Fiddler silently..."
4071
Start-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

Comments
 (0)