mirror of
https://github.com/pbatard/Fido.git
synced 2025-09-17 14:48:02 +02:00
Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
9552df66d5 | ||
![]() |
4bafb688da | ||
![]() |
ad79094c30 | ||
![]() |
8cf4a279ff | ||
![]() |
84f833b067 | ||
![]() |
c34a41fe3f | ||
![]() |
6593585ff3 | ||
![]() |
fac4c49262 | ||
![]() |
f8aacf0703 | ||
![]() |
24a7a04d78 | ||
![]() |
eefc2453c4 | ||
![]() |
ed1a6b31a6 | ||
![]() |
9beb231b78 | ||
![]() |
ce7cb583e5 |
3
.gitattributes
vendored
3
.gitattributes
vendored
@@ -1,3 +1,6 @@
|
|||||||
* text=auto
|
* text=auto
|
||||||
*.ps1 eol=crlf
|
*.ps1 eol=crlf
|
||||||
*.sh eol=lf
|
*.sh eol=lf
|
||||||
|
.gitattributes export-ignore
|
||||||
|
.gitignore export-ignore
|
||||||
|
sign.sh export-ignore
|
||||||
|
@@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"checkRunSettings": {
|
|
||||||
"vulnerableCheckRunConclusionLevel": "failure"
|
|
||||||
},
|
|
||||||
"issueSettings": {
|
|
||||||
"minSeverityLevel": "LOW"
|
|
||||||
}
|
|
||||||
}
|
|
140
Fido.ps1
140
Fido.ps1
@@ -1,6 +1,6 @@
|
|||||||
#
|
#
|
||||||
# Fido v1.31 - Feature ISO Downloader, for retail Windows images and UEFI Shell
|
# Fido v1.41 - Feature ISO Downloader, for retail Windows images and UEFI Shell
|
||||||
# Copyright © 2019-2022 Pete Batard <pete@akeo.ie>
|
# Copyright © 2019-2023 Pete Batard <pete@akeo.ie>
|
||||||
# Command line support: Copyright © 2021 flx5
|
# Command line support: Copyright © 2021 flx5
|
||||||
# ConvertTo-ImageSource: Copyright © 2016 Chris Carter
|
# ConvertTo-ImageSource: Copyright © 2016 Chris Carter
|
||||||
#
|
#
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
#region Parameters
|
#region Parameters
|
||||||
param(
|
param(
|
||||||
# (Optional) The title to display on the application window.
|
# (Optional) The title to display on the application window.
|
||||||
[string]$AppTitle = "Fido - Retail Windows ISO Downloader",
|
[string]$AppTitle = "Fido - Feature ISO Downloader",
|
||||||
# (Optional) '|' separated UI localization strings.
|
# (Optional) '|' separated UI localization strings.
|
||||||
[string]$LocData,
|
[string]$LocData,
|
||||||
# (Optional) Path to a file that should be used for the UI icon.
|
# (Optional) Path to a file that should be used for the UI icon.
|
||||||
@@ -45,7 +45,9 @@ param(
|
|||||||
# (Optional) Only display the download URL [Toggles commandline mode]
|
# (Optional) Only display the download URL [Toggles commandline mode]
|
||||||
[switch]$GetUrl = $False,
|
[switch]$GetUrl = $False,
|
||||||
# (Optional) Increase verbosity
|
# (Optional) Increase verbosity
|
||||||
[switch]$Verbose = $False
|
[switch]$Verbose = $False,
|
||||||
|
# (Optional) Disable the progress bar
|
||||||
|
[switch]$DisableProgress = $False
|
||||||
)
|
)
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -80,11 +82,12 @@ $code = @"
|
|||||||
|
|
||||||
if (!$Cmd) {
|
if (!$Cmd) {
|
||||||
Write-Host Please Wait...
|
Write-Host Please Wait...
|
||||||
|
$Drawing_Assembly = "System.Drawing"
|
||||||
|
# PowerShell 7 altered the name of the Drawing assembly...
|
||||||
if ($host.version -ge "7.0") {
|
if ($host.version -ge "7.0") {
|
||||||
Add-Type -WarningAction Ignore -IgnoreWarnings -MemberDefinition $code -Namespace Gui -UsingNamespace System.Runtime, System.IO, System.Text, System.Drawing, System.Globalization -ReferencedAssemblies System.Drawing.Common -Name Utils -ErrorAction Stop
|
$Drawing_Assembly += ".Common"
|
||||||
} else {
|
|
||||||
Add-Type -MemberDefinition $code -Namespace Gui -UsingNamespace System.IO, System.Text, System.Drawing, System.Globalization -ReferencedAssemblies System.Drawing -Name Utils -ErrorAction Stop
|
|
||||||
}
|
}
|
||||||
|
Add-Type -ErrorAction Stop -WarningAction Ignore -IgnoreWarnings -MemberDefinition $code -Namespace Gui -UsingNamespace System.Runtime, System.IO, System.Text, System.Drawing, System.Globalization -ReferencedAssemblies $Drawing_Assembly -Name Utils
|
||||||
Add-Type -AssemblyName PresentationFramework
|
Add-Type -AssemblyName PresentationFramework
|
||||||
# Hide the powershell window: https://stackoverflow.com/a/27992426/1069307
|
# Hide the powershell window: https://stackoverflow.com/a/27992426/1069307
|
||||||
[Gui.Utils]::ShowWindow(([System.Diagnostics.Process]::GetCurrentProcess() | Get-Process).MainWindowHandle, 0) | Out-Null
|
[Gui.Utils]::ShowWindow(([System.Diagnostics.Process]::GetCurrentProcess() | Get-Process).MainWindowHandle, 0) | Out-Null
|
||||||
@@ -97,6 +100,11 @@ $ko = 0x20000
|
|||||||
$WindowsVersions = @(
|
$WindowsVersions = @(
|
||||||
@(
|
@(
|
||||||
@("Windows 11", "windows11"),
|
@("Windows 11", "windows11"),
|
||||||
|
@(
|
||||||
|
"22H2 v1 (Build 22621.525 - 2022.10)",
|
||||||
|
@("Windows 11 Home/Pro/Edu", 2370),
|
||||||
|
@("Windows 11 Home China ", ($zh + 2371))
|
||||||
|
),
|
||||||
@(
|
@(
|
||||||
"21H2 v1 (Build 22000.318 - 2021.11)",
|
"21H2 v1 (Build 22000.318 - 2021.11)",
|
||||||
@("Windows 11 Home/Pro/Edu", 2093),
|
@("Windows 11 Home/Pro/Edu", 2093),
|
||||||
@@ -110,6 +118,11 @@ $WindowsVersions = @(
|
|||||||
),
|
),
|
||||||
@(
|
@(
|
||||||
@("Windows 10", "Windows10ISO"),
|
@("Windows 10", "Windows10ISO"),
|
||||||
|
@(
|
||||||
|
"22H2 (Build 19045.2006 - 2022.10)",
|
||||||
|
@("Windows 10 Home/Pro/Edu", 2377),
|
||||||
|
@("Windows 10 Home China ", ($zh + 2378))
|
||||||
|
),
|
||||||
@(
|
@(
|
||||||
"21H2 (Build 19044.1288 - 2021.11)",
|
"21H2 (Build 19044.1288 - 2021.11)",
|
||||||
@("Windows 10 Home/Pro/Edu", 2084),
|
@("Windows 10 Home/Pro/Edu", 2084),
|
||||||
@@ -273,6 +286,11 @@ $WindowsVersions = @(
|
|||||||
),
|
),
|
||||||
@(
|
@(
|
||||||
@("UEFI Shell 2.2", "UEFI_SHELL 2.2"),
|
@("UEFI Shell 2.2", "UEFI_SHELL 2.2"),
|
||||||
|
@(
|
||||||
|
"22H2 (edk2-stable202211)",
|
||||||
|
@("Release", 0),
|
||||||
|
@("Debug", 1)
|
||||||
|
),
|
||||||
@(
|
@(
|
||||||
"22H1 (edk2-stable202205)",
|
"22H1 (edk2-stable202205)",
|
||||||
@("Release", 0),
|
@("Release", 0),
|
||||||
@@ -481,7 +499,7 @@ function ConvertTo-ImageSource
|
|||||||
|
|
||||||
function Throw-Error([object]$Req, [string]$Alt)
|
function Throw-Error([object]$Req, [string]$Alt)
|
||||||
{
|
{
|
||||||
$Err = $(GetElementById -Request $r -Id "errorModalMessage").innerText
|
$Err = $(GetElementById -Request $Req -Id "errorModalMessage").innerText -replace "<[^>]+>" -replace "\s+", " "
|
||||||
if (-not $Err) {
|
if (-not $Err) {
|
||||||
$Err = $Alt
|
$Err = $Alt
|
||||||
} else {
|
} else {
|
||||||
@@ -584,7 +602,7 @@ $RequestData["GetLangs"] = @("a8f8f489-4c7f-463a-9ca6-5cff94d8d041", "getskuinfo
|
|||||||
# This GUID applies to visitors of the en-US download page. Other locales may get a different GUID.
|
# This GUID applies to visitors of the en-US download page. Other locales may get a different GUID.
|
||||||
$RequestData["GetLinks"] = @("6e2a1789-ef16-4f27-a296-74ef7ef5d96b", "GetProductDownloadLinksBySku" )
|
$RequestData["GetLinks"] = @("6e2a1789-ef16-4f27-a296-74ef7ef5d96b", "GetProductDownloadLinksBySku" )
|
||||||
# Create a semi-random Linux User-Agent string
|
# Create a semi-random Linux User-Agent string
|
||||||
$FirefoxVersion = Get-Random -Minimum 50 -Maximum 90
|
$FirefoxVersion = Get-Random -Minimum 90 -Maximum 110
|
||||||
$FirefoxDate = Get-RandomDate
|
$FirefoxDate = Get-RandomDate
|
||||||
$UserAgent = "Mozilla/5.0 (X11; Linux i586; rv:$FirefoxVersion.0) Gecko/$FirefoxDate Firefox/$FirefoxVersion.0"
|
$UserAgent = "Mozilla/5.0 (X11; Linux i586; rv:$FirefoxVersion.0) Gecko/$FirefoxDate Firefox/$FirefoxVersion.0"
|
||||||
$Verbosity = 2
|
$Verbosity = 2
|
||||||
@@ -599,7 +617,7 @@ if ($Cmd) {
|
|||||||
|
|
||||||
# Localization
|
# Localization
|
||||||
$EnglishMessages = "en-US|Version|Release|Edition|Language|Architecture|Download|Continue|Back|Close|Cancel|Error|Please wait...|" +
|
$EnglishMessages = "en-US|Version|Release|Edition|Language|Architecture|Download|Continue|Back|Close|Cancel|Error|Please wait...|" +
|
||||||
"Download using a browser|Temporarily banned by Microsoft for requesting too many downloads - Please try again later...|" +
|
"Download using a browser|Download of Windows ISOs is unavailable due to Microsoft having altered their website to prevent it.|" +
|
||||||
"PowerShell 3.0 or later is required to run this script.|Do you want to go online and download it?"
|
"PowerShell 3.0 or later is required to run this script.|Do you want to go online and download it?"
|
||||||
[string[]]$English = $EnglishMessages.Split('|')
|
[string[]]$English = $EnglishMessages.Split('|')
|
||||||
[string[]]$Localized = $null
|
[string[]]$Localized = $null
|
||||||
@@ -692,6 +710,17 @@ function Get-Windows-Languages([int]$SelectedVersion, [int]$SelectedEdition)
|
|||||||
} elseif ($WindowsVersions[$SelectedVersion][0][1].StartsWith("UEFI_SHELL")) {
|
} elseif ($WindowsVersions[$SelectedVersion][0][1].StartsWith("UEFI_SHELL")) {
|
||||||
$languages += @(New-Object PsObject -Property @{ DisplayLanguage = "English (US)"; Language = "en-us"; Id = 0 })
|
$languages += @(New-Object PsObject -Property @{ DisplayLanguage = "English (US)"; Language = "en-us"; Id = 0 })
|
||||||
} else {
|
} else {
|
||||||
|
# Microsoft download protection now requires the sessionId to be whitelisted through vlscppe.microsoft.com/tags
|
||||||
|
$url = "https://vlscppe.microsoft.com/tags?org_id=y6jn8c31&session_id=" + $SessionId
|
||||||
|
if ($Verbosity -ge 2) {
|
||||||
|
Write-Host Querying $url
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
Invoke-WebRequest -UseBasicParsing -MaximumRedirection 0 -UserAgent $UserAgent $url | Out-Null
|
||||||
|
} catch {
|
||||||
|
Error($_.Exception.Message)
|
||||||
|
return @()
|
||||||
|
}
|
||||||
$url = "https://www.microsoft.com/" + $QueryLocale + "/api/controls/contentinclude/html"
|
$url = "https://www.microsoft.com/" + $QueryLocale + "/api/controls/contentinclude/html"
|
||||||
$url += "?pageId=" + $RequestData["GetLangs"][0]
|
$url += "?pageId=" + $RequestData["GetLangs"][0]
|
||||||
$url += "&host=www.microsoft.com"
|
$url += "&host=www.microsoft.com"
|
||||||
@@ -706,11 +735,12 @@ function Get-Windows-Languages([int]$SelectedVersion, [int]$SelectedEdition)
|
|||||||
|
|
||||||
$script:SelectedIndex = 0
|
$script:SelectedIndex = 0
|
||||||
try {
|
try {
|
||||||
$r = Invoke-WebRequest -UseBasicParsing -UserAgent $UserAgent -SessionVariable "Session" $url
|
$r = Invoke-WebRequest -Method Post -UseBasicParsing -UserAgent $UserAgent -SessionVariable "Session" $url
|
||||||
if ($r -match "errorModalMessage") {
|
if ($r -match "errorModalMessage") {
|
||||||
Throw-Error -Req $r -Alt "Could not retrieve languages from server"
|
Throw-Error -Req $r -Alt "Could not retrieve languages from server"
|
||||||
}
|
}
|
||||||
$pattern = '(?s)<select id="product-languages">(.*)?</select>'
|
$r = $r -replace "`n" -replace "`r"
|
||||||
|
$pattern = '.*<select id="product-languages"[^>]+>(.*)</select>.*'
|
||||||
$html = [regex]::Match($r, $pattern).Groups[1].Value
|
$html = [regex]::Match($r, $pattern).Groups[1].Value
|
||||||
# Go through an XML conversion to keep all PowerShells happy...
|
# Go through an XML conversion to keep all PowerShells happy...
|
||||||
$html = $html.Replace("selected value", "value")
|
$html = $html.Replace("selected value", "value")
|
||||||
@@ -793,11 +823,28 @@ function Get-Windows-Download-Links([int]$SelectedVersion, [int]$SelectedRelease
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$Is64 = [Environment]::Is64BitOperatingSystem
|
$Is64 = [Environment]::Is64BitOperatingSystem
|
||||||
# Must add a referer for POST requests, else Microsoft's servers will deny them
|
# Must add a referer for this request, else Microsoft's servers will deny it
|
||||||
$ref = "https://www.microsoft.com/software-download/windows11"
|
$ref = "https://www.microsoft.com/software-download/windows11"
|
||||||
$r = Invoke-WebRequest -Method Post -Headers @{"Referer" = $ref} -UseBasicParsing -UserAgent $UserAgent -WebSession $Session $url
|
$wr = [System.Net.WebRequest]::Create($url)
|
||||||
|
# Windows 7 PowerShell doesn't support 'Invoke-WebRequest -Headers @{"Referer" = $ref}'
|
||||||
|
# (produces "The 'Referer' header must be modified using the appropriate property or method")
|
||||||
|
# so we use StreamReader() with GetResponseStream() and do this whole gymkhana instead...
|
||||||
|
$wr.Method = "POST"
|
||||||
|
$wr.Referer = $ref
|
||||||
|
$wr.UserAgent = $UserAgent
|
||||||
|
$wr.ContentLength = 0
|
||||||
|
$sr = New-Object System.IO.StreamReader($wr.GetResponse().GetResponseStream())
|
||||||
|
$r = $sr.ReadToEnd()
|
||||||
if ($r -match "errorModalMessage") {
|
if ($r -match "errorModalMessage") {
|
||||||
Throw-Error -Req $r -Alt "Could not retrieve architectures from server"
|
$regex = New-Object Text.RegularExpressions.Regex '<p id="errorModalMessage">(.+?)<\/p>'
|
||||||
|
$m = $regex.Match($r)
|
||||||
|
# Make the typical error message returned by Microsoft's servers more presentable
|
||||||
|
$Alt = $m.Groups[1] -replace "<[^>]+>" -replace "\s+", " "
|
||||||
|
$Alt += " " + $SessionId + "."
|
||||||
|
if (-not $Alt) {
|
||||||
|
$Alt = "Could not retrieve architectures from server"
|
||||||
|
}
|
||||||
|
Throw-Error -Req $r -Alt $Alt
|
||||||
}
|
}
|
||||||
$pattern = '(?s)(<input.*?></input>)'
|
$pattern = '(?s)(<input.*?></input>)'
|
||||||
ForEach-Object { [regex]::Matches($r, $pattern) } | ForEach-Object { $html += $_.Groups[1].value }
|
ForEach-Object { [regex]::Matches($r, $pattern) } | ForEach-Object { $html += $_.Groups[1].value }
|
||||||
@@ -845,6 +892,9 @@ function Process-Download-Link([string]$Url)
|
|||||||
$tmp_size = [uint64]::Parse($str_size)
|
$tmp_size = [uint64]::Parse($str_size)
|
||||||
$Size = Size-To-Human-Readable $tmp_size
|
$Size = Size-To-Human-Readable $tmp_size
|
||||||
Write-Host "Downloading '$File' ($Size)..."
|
Write-Host "Downloading '$File' ($Size)..."
|
||||||
|
if ($DisableProgress) {
|
||||||
|
$ProgressPreference = 'SilentlyContinue'
|
||||||
|
}
|
||||||
Invoke-WebRequest -UseBasicParsing -Uri $Url -OutFile $File
|
Invoke-WebRequest -UseBasicParsing -Uri $Url -OutFile $File
|
||||||
} else {
|
} else {
|
||||||
Write-Host Download Link: $Url
|
Write-Host Download Link: $Url
|
||||||
@@ -926,7 +976,7 @@ if ($Cmd) {
|
|||||||
if (!$Ed -and $Verbosity -ge 1) {
|
if (!$Ed -and $Verbosity -ge 1) {
|
||||||
Write-Host "No edition specified (-Ed). Defaulting to '$($edition.Edition)'."
|
Write-Host "No edition specified (-Ed). Defaulting to '$($edition.Edition)'."
|
||||||
}
|
}
|
||||||
$Selected += "," + $edition.Edition -replace "Windows [0-9\.]*", ""
|
$Selected += "," + $edition.Edition -replace "Windows [0-9\.]*"
|
||||||
$winEditionId = $edition.Id
|
$winEditionId = $edition.Id
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -946,6 +996,10 @@ if ($Cmd) {
|
|||||||
}
|
}
|
||||||
if ($Lang -eq "List") {
|
if ($Lang -eq "List") {
|
||||||
Write-Host "Please select a Language (-Lang) for ${Selected}:"
|
Write-Host "Please select a Language (-Lang) for ${Selected}:"
|
||||||
|
} elseif ($Lang) {
|
||||||
|
# Escape parentheses so that they aren't interpreted as regex
|
||||||
|
$Lang = $Lang.replace('(', '\(')
|
||||||
|
$Lang = $Lang.replace(')', '\)')
|
||||||
}
|
}
|
||||||
$i = 0
|
$i = 0
|
||||||
foreach ($language in $languages) {
|
foreach ($language in $languages) {
|
||||||
@@ -962,7 +1016,7 @@ if ($Cmd) {
|
|||||||
}
|
}
|
||||||
$i++
|
$i++
|
||||||
}
|
}
|
||||||
if ($winLanguageId -eq $null -or $winLanguageName -eq $null) {
|
if (!$winLanguageId -or !$winLanguageName) {
|
||||||
if ($Lang -ne "List") {
|
if ($Lang -ne "List") {
|
||||||
Write-Host "Invalid Windows language provided."
|
Write-Host "Invalid Windows language provided."
|
||||||
Write-Host "Use '-Lang List' for a list of available languages or remove the option to use system default."
|
Write-Host "Use '-Lang List' for a list of available languages or remove the option to use system default."
|
||||||
@@ -1020,7 +1074,7 @@ $XMLForm.Title = $AppTitle
|
|||||||
if ($Icon) {
|
if ($Icon) {
|
||||||
$XMLForm.Icon = $Icon
|
$XMLForm.Icon = $Icon
|
||||||
} else {
|
} else {
|
||||||
$XMLForm.Icon = [Gui.Utils]::ExtractIcon("shell32.dll", -41, $true) | ConvertTo-ImageSource
|
$XMLForm.Icon = [Gui.Utils]::ExtractIcon("imageres.dll", -5205, $true) | ConvertTo-ImageSource
|
||||||
}
|
}
|
||||||
if ($Locale.StartsWith("ar") -or $Locale.StartsWith("fa") -or $Locale.StartsWith("he")) {
|
if ($Locale.StartsWith("ar") -or $Locale.StartsWith("fa") -or $Locale.StartsWith("he")) {
|
||||||
$XMLForm.FlowDirection = "RightToLeft"
|
$XMLForm.FlowDirection = "RightToLeft"
|
||||||
@@ -1158,8 +1212,8 @@ exit $ExitCode
|
|||||||
# SIG # Begin signature block
|
# SIG # Begin signature block
|
||||||
# MIIkWAYJKoZIhvcNAQcCoIIkSTCCJEUCAQExDzANBglghkgBZQMEAgEFADB5Bgor
|
# MIIkWAYJKoZIhvcNAQcCoIIkSTCCJEUCAQExDzANBglghkgBZQMEAgEFADB5Bgor
|
||||||
# BgEEAYI3AgEEoGswaTA0Bg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WRzpR
|
# HvBvmWaM4Yv1/N1OdEHcgw2Zdxvy8P6g3bfNzv1SqMtf3Nn4TUv0RQZ5GJ9e8cfN
|
||||||
# Ivx+mqun1nYau9MT5bZG0oXb8U103KvHv0odFcLwhSJjvhj+73kxjPbxY3ays3mR
|
# W19bcP37k5QR4AIuG3ItzEAyHppFYGM2bQ+X0KtWmWGpFeRd6Zd/pauS1PD7f87q
|
||||||
# 64hcdC5EuagKt5hlBk+CveTvAW33MEuXSSFVgQ/PZVPt1iQ1WVZtPMY81BY=
|
# d7bG1jvjgyLAuxGxF/xSN/QizrOvWnV1Eya13mELBDNtg9UhUcxzmofj4Zw=
|
||||||
# SIG # End signature block
|
# SIG # End signature block
|
||||||
|
35
Fido.pssproj
35
Fido.pssproj
@@ -1,35 +0,0 @@
|
|||||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
||||||
<SchemaVersion>2.0</SchemaVersion>
|
|
||||||
<ProjectGuid>6CAFC0C6-A428-4d30-A9F9-700E829FEA51</ProjectGuid>
|
|
||||||
<OutputType>Exe</OutputType>
|
|
||||||
<RootNamespace>Fido</RootNamespace>
|
|
||||||
<AssemblyName>Fido</AssemblyName>
|
|
||||||
<Name>Frida</Name>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<OutputPath>bin\Debug\</OutputPath>
|
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<OutputPath>bin\Release\</OutputPath>
|
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup />
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="Fido.ps1" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
|
||||||
<Target Name="Build" />
|
|
||||||
<Import Project="$(MSBuildExtensionsPath)\PowerShell Tools for Visual Studio\PowerShellTools.targets" Condition="Exists('$(MSBuildExtensionsPath)\PowerShell Tools for Visual Studio\PowerShellTools.targets')" />
|
|
||||||
</Project>
|
|
25
Fido.sln
25
Fido.sln
@@ -1,25 +0,0 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
|
||||||
# Visual Studio 15
|
|
||||||
VisualStudioVersion = 15.0.28307.271
|
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
|
||||||
Project("{F5034706-568F-408A-B7B3-4D38C6DB8A32}") = "Fido", "Fido.pssproj", "{6CAFC0C6-A428-4D30-A9F9-700E829FEA51}"
|
|
||||||
EndProject
|
|
||||||
Global
|
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
|
||||||
Debug|Any CPU = Debug|Any CPU
|
|
||||||
Release|Any CPU = Release|Any CPU
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
|
||||||
{6CAFC0C6-A428-4D30-A9F9-700E829FEA51}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{6CAFC0C6-A428-4D30-A9F9-700E829FEA51}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{6CAFC0C6-A428-4D30-A9F9-700E829FEA51}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{6CAFC0C6-A428-4D30-A9F9-700E829FEA51}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
|
||||||
HideSolutionNode = FALSE
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
|
||||||
SolutionGuid = {AD54CEAE-0992-4213-BEDB-8F1CF98A9F22}
|
|
||||||
EndGlobalSection
|
|
||||||
EndGlobal
|
|
25
README.md
25
README.md
@@ -1,5 +1,5 @@
|
|||||||
Fido: A PowerShell download script for Windows ISOs and UEFI Shell
|
Fido: A PowerShell download script for Microsoft Windows and UEFI Shell ISOs
|
||||||
==================================================================
|
============================================================================
|
||||||
|
|
||||||
[](https://www.gnu.org/licenses/gpl-3.0.en.html)
|
[](https://www.gnu.org/licenses/gpl-3.0.en.html)
|
||||||
[](https://github.com/pbatard/Fido/releases)
|
[](https://github.com/pbatard/Fido/releases)
|
||||||
@@ -9,12 +9,12 @@ Description
|
|||||||
|
|
||||||
Fido is a PowerShell script that is primarily designed to be used in [Rufus](https://github.com/pbatard/rufus), but that
|
Fido is a PowerShell script that is primarily designed to be used in [Rufus](https://github.com/pbatard/rufus), but that
|
||||||
can also be used in standalone fashion, and whose purpose is to automate access to the official Microsoft Windows retail
|
can also be used in standalone fashion, and whose purpose is to automate access to the official Microsoft Windows retail
|
||||||
ISO download links as well as provide convenient access to bootable UEFI Shell images.
|
ISO download links as well as provide convenient access to [bootable UEFI Shell images](https://github.com/pbatard/UEFI-Shell).
|
||||||
|
|
||||||
This script exists because, while Microsoft does make retail ISO download links freely and publicly available (at least
|
This script exists because, while Microsoft does make retail ISO download links freely and publicly available (at least
|
||||||
for Windows 8 and Windows 10), it only does so after actively forcing users to jump through a lot of unwarranted hoops,
|
for Windows 8 through Windows 11), up until recent releases, most of these links were only available after forcing users
|
||||||
that create an exceedingly counterproductive, if not downright unfriendly, consumer experience and that greatly detract
|
to jump through a lot of unwarranted hoops that created an exceedingly counterproductive, if not downright unfriendly,
|
||||||
from what people really want (direct access to ISO downloads).
|
consumer experience, that greatly detracted from what people really want (direct access to ISO downloads).
|
||||||
|
|
||||||
As to the reason one might want to download Windows __retail__ ISOs, as opposed to the ISOs that are generated by
|
As to the reason one might want to download Windows __retail__ ISOs, as opposed to the ISOs that are generated by
|
||||||
Microsoft's own Media Creation Tool (MCT), this is because using official retail ISOs is currently the only way to
|
Microsoft's own Media Creation Tool (MCT), this is because using official retail ISOs is currently the only way to
|
||||||
@@ -42,16 +42,16 @@ License
|
|||||||
How it works
|
How it works
|
||||||
------------
|
------------
|
||||||
|
|
||||||
The script basically performs the same operation as one might perform when visiting either of the following URLs (that
|
The script basically performs the same operation as one might perform when visiting the following URL (that is, in the
|
||||||
is, provided that you have also changed your `User-Agent` browser string, since, when they detect that you are using a
|
case of Windows 10, provided that you have also changed your `User-Agent` browser string, since, the Microsoft web
|
||||||
version of Windows that is the same as the one you are trying to download, the Microsoft web servers at these addresses
|
servers detect that you are using a version of Windows that is the same as the one you are trying to download, they
|
||||||
redirect you __away__ from the pages that allow you to download retail ISOs):
|
may redirect you __away__ from the page that allows you to obtain a direct ISO download link):
|
||||||
|
|
||||||
https://www.microsoft.com/en-us/software-download
|
https://www.microsoft.com/en-us/software-download
|
||||||
|
|
||||||
After checking access to these URLs, to confirm that they are accessible, the script first queries the web API from the
|
After checking basic access to the Microsoft software downloads website the script first queries the web API from the
|
||||||
Microsoft servers, to request the language selection available for the version of Windows selected, and then requests
|
Microsoft servers, to request the language selection available for the version of Windows selected, and then requests
|
||||||
the actual download links for all the architectures available for that language + version.
|
the actual download links, for all the architectures available for that language + version.
|
||||||
|
|
||||||
Requirements
|
Requirements
|
||||||
------------
|
------------
|
||||||
@@ -87,6 +87,7 @@ The options are:
|
|||||||
architecture as the one from the current system.
|
architecture as the one from the current system.
|
||||||
- `GetUrl`: By default, the script attempts to automatically launch the download. But when using the `-GetUrl` switch,
|
- `GetUrl`: By default, the script attempts to automatically launch the download. But when using the `-GetUrl` switch,
|
||||||
the script only displays the download URL, which can then be piped into another command or into a file.
|
the script only displays the download URL, which can then be piped into another command or into a file.
|
||||||
|
- `DisableProgress`: Disable progress report. This may speed up downloads when using the command line.
|
||||||
|
|
||||||
Examples of a commandline download:
|
Examples of a commandline download:
|
||||||
|
|
||||||
|
2
sign.sh
2
sign.sh
@@ -21,7 +21,7 @@ sign_file() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Update the Authenticode signature
|
# Update the Authenticode signature
|
||||||
cmd.exe /c '"C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x64\signtool" sign /v /sha1 3dbc3a2a0e9ce8803b422cfdbc60acd33164965d /fd SHA256 /tr http://sha256timestamp.ws.symantec.com/sha256/timestamp /td SHA256 Fido.ps1'
|
MSYS2_ARG_CONV_EXCL='*' "C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x64\signtool" sign /v /sha1 3dbc3a2a0e9ce8803b422cfdbc60acd33164965d /fd SHA256 /tr http://sha256timestamp.ws.symantec.com/sha256/timestamp /td SHA256 Fido.ps1
|
||||||
read -s -p "Enter pass phrase for `realpath $PRIVATE_KEY`: " PASSWORD
|
read -s -p "Enter pass phrase for `realpath $PRIVATE_KEY`: " PASSWORD
|
||||||
echo
|
echo
|
||||||
# Confirm that the pass phrase is valid by trying to sign a dummy file
|
# Confirm that the pass phrase is valid by trying to sign a dummy file
|
||||||
|
Reference in New Issue
Block a user