mirror of
https://github.com/pbatard/Fido.git
synced 2025-09-16 22:28:02 +02:00
Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
af17001505 | ||
![]() |
43adf47d5d | ||
![]() |
99f6f246b8 | ||
![]() |
36e9b4420c | ||
![]() |
6d630f83f2 | ||
![]() |
ee0393cb74 | ||
![]() |
a8abb94a16 | ||
![]() |
15a48fe24f | ||
![]() |
e0c1015ade | ||
![]() |
46c399ecd7 | ||
![]() |
445ca5c074 | ||
![]() |
037cd1ad9b | ||
![]() |
aa378cad13 | ||
![]() |
3c4fafa207 | ||
![]() |
a405ebf79c | ||
![]() |
b0599d7a94 |
8
.whitesource
Normal file
8
.whitesource
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"checkRunSettings": {
|
||||||
|
"vulnerableCheckRunConclusionLevel": "failure"
|
||||||
|
},
|
||||||
|
"issueSettings": {
|
||||||
|
"minSeverityLevel": "LOW"
|
||||||
|
}
|
||||||
|
}
|
463
Fido.ps1
463
Fido.ps1
@@ -1,6 +1,6 @@
|
|||||||
#
|
#
|
||||||
# Fido v1.11 - Retail Windows ISO Downloader
|
# Fido v1.20 - Retail Windows ISO Downloader
|
||||||
# Copyright © 2019 Pete Batard <pete@akeo.ie>
|
# Copyright © 2019-2021 Pete Batard <pete@akeo.ie>
|
||||||
# ConvertTo-ImageSource: Copyright © 2016 Chris Carter
|
# ConvertTo-ImageSource: Copyright © 2016 Chris Carter
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
@@ -30,11 +30,7 @@ param(
|
|||||||
[string]$Icon,
|
[string]$Icon,
|
||||||
# (Optional) Name of a pipe the download URL should be sent to.
|
# (Optional) Name of a pipe the download URL should be sent to.
|
||||||
# If not provided, a browser window is opened instead.
|
# If not provided, a browser window is opened instead.
|
||||||
[string]$PipeName,
|
[string]$PipeName
|
||||||
# (Optional) Disable IE First Run Customize so that Invoke-WebRequest
|
|
||||||
# doesn't throw an exception if the user has never launched IE.
|
|
||||||
# Note that this requires the script to run elevated.
|
|
||||||
[switch]$DisableFirstRunCustomize
|
|
||||||
)
|
)
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -63,7 +59,11 @@ $code = @"
|
|||||||
}
|
}
|
||||||
"@
|
"@
|
||||||
|
|
||||||
Add-Type -MemberDefinition $code -Namespace Gui -UsingNamespace "System.IO", "System.Text", "System.Drawing", "System.Globalization" -ReferencedAssemblies System.Drawing -Name Utils -ErrorAction Stop
|
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
|
||||||
|
} 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 -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
|
||||||
@@ -75,6 +75,42 @@ $ko = 0x20000
|
|||||||
$WindowsVersions = @(
|
$WindowsVersions = @(
|
||||||
@(
|
@(
|
||||||
@("Windows 10", "Windows10ISO"),
|
@("Windows 10", "Windows10ISO"),
|
||||||
|
@(
|
||||||
|
"21H1 (Build 19043.985 - 2021.05)",
|
||||||
|
@("Windows 10 Home/Pro", 2033),
|
||||||
|
@("Windows 10 Education", 2032),
|
||||||
|
@("Windows 10 Home China ", ($zh + 2034))
|
||||||
|
),
|
||||||
|
@(
|
||||||
|
"20H2 (Build 19042.631 - 2020.12)",
|
||||||
|
@("Windows 10 Home/Pro", 1882),
|
||||||
|
@("Windows 10 Education", 1884),
|
||||||
|
@("Windows 10 Home China ", ($zh + 1883))
|
||||||
|
),
|
||||||
|
@(
|
||||||
|
"20H2 (Build 19042.508 - 2020.10)",
|
||||||
|
@("Windows 10 Home/Pro", 1807),
|
||||||
|
@("Windows 10 Education", 1805),
|
||||||
|
@("Windows 10 Home China ", ($zh + 1806))
|
||||||
|
),
|
||||||
|
@(
|
||||||
|
"20H1 (Build 19041.264 - 2020.05)",
|
||||||
|
@("Windows 10 Home/Pro", 1626),
|
||||||
|
@("Windows 10 Education", 1625),
|
||||||
|
@("Windows 10 Home China ", ($zh + 1627))
|
||||||
|
),
|
||||||
|
@(
|
||||||
|
"19H2 (Build 18363.418 - 2019.11)",
|
||||||
|
@("Windows 10 Home/Pro", 1429),
|
||||||
|
@("Windows 10 Education", 1431),
|
||||||
|
@("Windows 10 Home China ", ($zh + 1430))
|
||||||
|
),
|
||||||
|
@(
|
||||||
|
"19H1 (Build 18362.356 - 2019.09)",
|
||||||
|
@("Windows 10 Home/Pro", 1384),
|
||||||
|
@("Windows 10 Education", 1386),
|
||||||
|
@("Windows 10 Home China ", ($zh + 1385))
|
||||||
|
),
|
||||||
@(
|
@(
|
||||||
"19H1 (Build 18362.30 - 2019.05)",
|
"19H1 (Build 18362.30 - 2019.05)",
|
||||||
@("Windows 10 Home/Pro", 1214),
|
@("Windows 10 Home/Pro", 1214),
|
||||||
@@ -179,8 +215,53 @@ $WindowsVersions = @(
|
|||||||
@("Windows 8.1 K", ($ko + 61)),
|
@("Windows 8.1 K", ($ko + 61)),
|
||||||
@("Windows 8.1 KN", ($ko + 62))
|
@("Windows 8.1 KN", ($ko + 62))
|
||||||
)
|
)
|
||||||
|
),
|
||||||
|
@(
|
||||||
|
@("Windows 7", "WIN7"),
|
||||||
|
@(
|
||||||
|
"with SP1 (build 7601)",
|
||||||
|
@("Windows 7 Ultimate", 0),
|
||||||
|
@("Windows 7 Professional", 1),
|
||||||
|
@("Windows 7 Home Premium", 2)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
$Windows7Versions = @(
|
||||||
|
# 0: Windows 7 Ultimate
|
||||||
|
@(
|
||||||
|
# Need a dummy to prevent PS from coalescing single array entries
|
||||||
|
@(""),
|
||||||
|
@("English (US)", "en-us",
|
||||||
|
@(
|
||||||
|
@("x64", "https://download.microsoft.com/download/5/1/9/5195A765-3A41-4A72-87D8-200D897CBE21/7601.24214.180801-1700.win7sp1_ldr_escrow_CLIENT_ULTIMATE_x64FRE_en-us.iso"),
|
||||||
|
@("x86", "https://download.microsoft.com/download/1/E/6/1E6B4803-DD2A-49DF-8468-69C0E6E36218/7601.24214.180801-1700.win7sp1_ldr_escrow_CLIENT_ULTIMATE_x86FRE_en-us.iso")
|
||||||
|
)
|
||||||
|
)
|
||||||
|
),
|
||||||
|
# 1: Windows 7 Profesional
|
||||||
|
@(
|
||||||
|
@(""),
|
||||||
|
@("English (US)", "en-us",
|
||||||
|
@(
|
||||||
|
@("x64", "https://download.microsoft.com/download/0/6/3/06365375-C346-4D65-87C7-EE41F55F736B/7601.24214.180801-1700.win7sp1_ldr_escrow_CLIENT_PROFESSIONAL_x64FRE_en-us.iso"),
|
||||||
|
@("x86", "https://download.microsoft.com/download/C/0/6/C067D0CD-3785-4727-898E-60DC3120BB14/7601.24214.180801-1700.win7sp1_ldr_escrow_CLIENT_PROFESSIONAL_x86FRE_en-us.iso")
|
||||||
|
)
|
||||||
|
)
|
||||||
|
),
|
||||||
|
# 2: Windows 7 Home Premium
|
||||||
|
@(
|
||||||
|
@(""),
|
||||||
|
@("English (US)", "en-us",
|
||||||
|
@(
|
||||||
|
@("x64", "https://download.microsoft.com/download/E/A/8/EA804D86-C3DF-4719-9966-6A66C9306598/7601.24214.180801-1700.win7sp1_ldr_escrow_CLIENT_HOMEPREMIUM_x64FRE_en-us.iso"),
|
||||||
|
@("x86", "https://download.microsoft.com/download/E/D/A/EDA6B508-7663-4E30-86F9-949932F443D0/7601.24214.180801-1700.win7sp1_ldr_escrow_CLIENT_HOMEPREMIUM_x86FRE_en-us.iso")
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
)
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Functions
|
#region Functions
|
||||||
@@ -198,10 +279,10 @@ function Select-Language([string]$LangName)
|
|||||||
($SysLocale.StartsWith("da") -and $LangName -like "*Danish*") -or `
|
($SysLocale.StartsWith("da") -and $LangName -like "*Danish*") -or `
|
||||||
($SysLocale.StartsWith("nl") -and $LangName -like "*Dutch*") -or `
|
($SysLocale.StartsWith("nl") -and $LangName -like "*Dutch*") -or `
|
||||||
($SysLocale -eq "en-US" -and $LangName -eq "English") -or `
|
($SysLocale -eq "en-US" -and $LangName -eq "English") -or `
|
||||||
($SysLocale.StartsWith("en") -and $LangName -like "*English*" -and $LangName -like "*inter*") -or `
|
($SysLocale.StartsWith("en") -and $LangName -like "*English*" -and ($LangName -like "*inter*" -or $LangName -like "*ingdom*")) -or `
|
||||||
($SysLocale.StartsWith("et") -and $LangName -like "*Eston*") -or `
|
($SysLocale.StartsWith("et") -and $LangName -like "*Eston*") -or `
|
||||||
($SysLocale.StartsWith("fi") -and $LangName -like "*Finn*") -or `
|
($SysLocale.StartsWith("fi") -and $LangName -like "*Finn*") -or `
|
||||||
($SysLocale -eq "fr-CA" -and $LangName -like "*French*" -and $LangName -like "*Canad*") -or `
|
($SysLocale -eq "fr-CA" -and $LangName -like "*French*" -and $LangName -like "*Canad*") -or `
|
||||||
($SysLocale.StartsWith("fr") -and $LangName -eq "French") -or `
|
($SysLocale.StartsWith("fr") -and $LangName -eq "French") -or `
|
||||||
($SysLocale.StartsWith("de") -and $LangName -like "*German*") -or `
|
($SysLocale.StartsWith("de") -and $LangName -like "*German*") -or `
|
||||||
($SysLocale.StartsWith("el") -and $LangName -like "*Greek*") -or `
|
($SysLocale.StartsWith("el") -and $LangName -like "*Greek*") -or `
|
||||||
@@ -373,12 +454,9 @@ function Error([string]$ErrorMessage)
|
|||||||
Write-Host Error: $ErrorMessage
|
Write-Host Error: $ErrorMessage
|
||||||
$XMLForm.Title = $(Get-Translation("Error")) + ": " + $ErrorMessage
|
$XMLForm.Title = $(Get-Translation("Error")) + ": " + $ErrorMessage
|
||||||
Refresh-Control($XMLForm)
|
Refresh-Control($XMLForm)
|
||||||
$Continue.Content = Get-Translation("Close")
|
$XMLGrid.Children[2 * $script:Stage + 1].IsEnabled = $True
|
||||||
Refresh-Control($Continue)
|
|
||||||
$UserInput = [System.Windows.MessageBox]::Show($XMLForm.Title, $(Get-Translation("Error")), "OK", "Error")
|
$UserInput = [System.Windows.MessageBox]::Show($XMLForm.Title, $(Get-Translation("Error")), "OK", "Error")
|
||||||
$script:ExitCode = $Stage
|
$script:ExitCode = $script:Stage--
|
||||||
$script:Stage = -1
|
|
||||||
$Continue.IsEnabled = $True
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-RandomDate()
|
function Get-RandomDate()
|
||||||
@@ -416,14 +494,11 @@ $MaxStage = 4
|
|||||||
$SessionId = [guid]::NewGuid()
|
$SessionId = [guid]::NewGuid()
|
||||||
$ExitCode = 100
|
$ExitCode = 100
|
||||||
$Locale = "en-US"
|
$Locale = "en-US"
|
||||||
$DFRCKey = "HKLM:\Software\Policies\Microsoft\Internet Explorer\Main\"
|
|
||||||
$DFRCName = "DisableFirstRunCustomize"
|
|
||||||
$DFRCAdded = $False
|
|
||||||
$RequestData = @{}
|
$RequestData = @{}
|
||||||
$RequestData["GetLangs"] = @("a8f8f489-4c7f-463a-9ca6-5cff94d8d041", "getskuinformationbyproductedition" )
|
$RequestData["GetLangs"] = @("a8f8f489-4c7f-463a-9ca6-5cff94d8d041", "getskuinformationbyproductedition" )
|
||||||
$RequestData["GetLinks"] = @("cfa9e580-a81e-4a4b-a846-7b21bf4e2e5b", "GetProductDownloadLinksBySku" )
|
$RequestData["GetLinks"] = @("cfa9e580-a81e-4a4b-a846-7b21bf4e2e5b", "GetProductDownloadLinksBySku" )
|
||||||
# Create a semi-random Linux User-Agent string
|
# Create a semi-random Linux User-Agent string
|
||||||
$FirefoxVersion = Get-Random -Minimum 30 -Maximum 60
|
$FirefoxVersion = Get-Random -Minimum 50 -Maximum 90
|
||||||
$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"
|
||||||
#endregion
|
#endregion
|
||||||
@@ -454,20 +529,6 @@ if ($PSVersionTable.PSVersion.Major -lt 3) {
|
|||||||
exit 102
|
exit 102
|
||||||
}
|
}
|
||||||
|
|
||||||
# If asked, disable IE's first run customize prompt as it interferes with Invoke-WebRequest
|
|
||||||
if ($DisableFirstRunCustomize) {
|
|
||||||
try {
|
|
||||||
# Only create the key if it doesn't already exist
|
|
||||||
Get-ItemProperty -Path $DFRCKey -Name $DFRCName
|
|
||||||
} catch {
|
|
||||||
if (-not (Test-Path $DFRCKey)) {
|
|
||||||
New-Item -Path $DFRCKey -Force | Out-Null
|
|
||||||
}
|
|
||||||
Set-ItemProperty -Path $DFRCKey -Name $DFRCName -Value 1
|
|
||||||
$DFRCAdded = $True
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Form creation
|
# Form creation
|
||||||
$XMLForm = [Windows.Markup.XamlReader]::Load((New-Object System.Xml.XmlNodeReader $XAML))
|
$XMLForm = [Windows.Markup.XamlReader]::Load((New-Object System.Xml.XmlNodeReader $XAML))
|
||||||
$XAML.SelectNodes("//*[@Name]") | ForEach-Object { Set-Variable -Name ($_.Name) -Value $XMLForm.FindName($_.Name) -Scope Script }
|
$XAML.SelectNodes("//*[@Name]") | ForEach-Object { Set-Variable -Name ($_.Name) -Value $XMLForm.FindName($_.Name) -Scope Script }
|
||||||
@@ -496,11 +557,7 @@ $WindowsVersion.DisplayMemberPath = "Version"
|
|||||||
|
|
||||||
# Button Action
|
# Button Action
|
||||||
$Continue.add_click({
|
$Continue.add_click({
|
||||||
if ($script:Stage++ -lt 0) {
|
$script:Stage++
|
||||||
Get-Process -Id $pid | Foreach-Object { $_.CloseMainWindow() | Out-Null }
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
$XMLGrid.Children[2 * $Stage + 1].IsEnabled = $False
|
$XMLGrid.Children[2 * $Stage + 1].IsEnabled = $False
|
||||||
$Continue.IsEnabled = $False
|
$Continue.IsEnabled = $False
|
||||||
$Back.IsEnabled = $False
|
$Back.IsEnabled = $False
|
||||||
@@ -551,46 +608,52 @@ $Continue.add_click({
|
|||||||
3 { # Product Edition selection => Request and populate Languages
|
3 { # Product Edition selection => Request and populate Languages
|
||||||
$XMLForm.Title = Get-Translation($English[12])
|
$XMLForm.Title = Get-Translation($English[12])
|
||||||
Refresh-Control($XMLForm)
|
Refresh-Control($XMLForm)
|
||||||
$url = "https://www.microsoft.com/" + $QueryLocale + "/api/controls/contentinclude/html"
|
|
||||||
$url += "?pageId=" + $RequestData["GetLangs"][0]
|
|
||||||
$url += "&host=www.microsoft.com"
|
|
||||||
$url += "&segments=software-download," + $WindowsVersion.SelectedValue.PageType
|
|
||||||
$url += "&query=&action=" + $RequestData["GetLangs"][1]
|
|
||||||
$url += "&sessionId=" + $SessionId
|
|
||||||
$url += "&productEditionId=" + [Math]::Abs($ProductEdition.SelectedValue.Id)
|
|
||||||
$url += "&sdVersion=2"
|
|
||||||
Write-Host Querying $url
|
|
||||||
|
|
||||||
$array = @()
|
$array = @()
|
||||||
$i = 0
|
$i = 0;
|
||||||
$SelectedIndex = 0
|
if ($WindowsVersion.SelectedValue.PageType -eq "WIN7") {
|
||||||
try {
|
foreach ($Entry in $Windows7Versions[$ProductEdition.SelectedValue.Id]) {
|
||||||
$r = Invoke-WebRequest -UserAgent $UserAgent -WebSession $Session $url
|
if ($Entry[0] -ne "") {
|
||||||
# Go through an XML conversion to keep all PowerShells happy...
|
$array += @(New-Object PsObject -Property @{ DisplayLanguage = $Entry[0]; Language = $Entry[1]; Id = $i })
|
||||||
if (-not $($r.AllElements | ? {$_.id -eq "product-languages"})) {
|
|
||||||
throw "Unexpected server response"
|
|
||||||
}
|
|
||||||
$html = $($r.AllElements | ? {$_.id -eq "product-languages"}).InnerHTML
|
|
||||||
$html = $html.Replace("selected value", "value")
|
|
||||||
$html = $html.Replace("&", "&")
|
|
||||||
$html = "<options>" + $html + "</options>"
|
|
||||||
$xml = [xml]$html
|
|
||||||
foreach ($var in $xml.options.option) {
|
|
||||||
$json = $var.value | ConvertFrom-Json;
|
|
||||||
if ($json) {
|
|
||||||
$array += @(New-Object PsObject -Property @{ DisplayLanguage = $var.InnerText; Language = $json.language; Id = $json.id })
|
|
||||||
if (Select-Language($json.language)) {
|
|
||||||
$SelectedIndex = $i
|
|
||||||
}
|
|
||||||
$i++
|
|
||||||
}
|
}
|
||||||
|
$i++
|
||||||
}
|
}
|
||||||
if ($array.Length -eq 0) {
|
} else {
|
||||||
Throw-Error -Req $r -Alt "Could not parse languages"
|
$url = "https://www.microsoft.com/" + $QueryLocale + "/api/controls/contentinclude/html"
|
||||||
|
$url += "?pageId=" + $RequestData["GetLangs"][0]
|
||||||
|
$url += "&host=www.microsoft.com"
|
||||||
|
$url += "&segments=software-download," + $WindowsVersion.SelectedValue.PageType
|
||||||
|
$url += "&query=&action=" + $RequestData["GetLangs"][1]
|
||||||
|
$url += "&sessionId=" + $SessionId
|
||||||
|
$url += "&productEditionId=" + [Math]::Abs($ProductEdition.SelectedValue.Id)
|
||||||
|
$url += "&sdVersion=2"
|
||||||
|
Write-Host Querying $url
|
||||||
|
|
||||||
|
$SelectedIndex = 0
|
||||||
|
try {
|
||||||
|
$r = Invoke-WebRequest -UseBasicParsing -UserAgent $UserAgent -SessionVariable "Session" $url
|
||||||
|
$pattern = '(?s)<select id="product-languages">(.*)?</select>'
|
||||||
|
$html = [regex]::Match($r, $pattern).Groups[1].Value
|
||||||
|
# Go through an XML conversion to keep all PowerShells happy...
|
||||||
|
$html = $html.Replace("selected value", "value")
|
||||||
|
$html = "<options>" + $html + "</options>"
|
||||||
|
$xml = [xml]$html
|
||||||
|
foreach ($var in $xml.options.option) {
|
||||||
|
$json = $var.value | ConvertFrom-Json;
|
||||||
|
if ($json) {
|
||||||
|
$array += @(New-Object PsObject -Property @{ DisplayLanguage = $var.InnerText; Language = $json.language; Id = $json.id })
|
||||||
|
if (Select-Language($json.language)) {
|
||||||
|
$SelectedIndex = $i
|
||||||
|
}
|
||||||
|
$i++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($array.Length -eq 0) {
|
||||||
|
Throw-Error -Req $r -Alt "Could not parse languages"
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
Error($_.Exception.Message)
|
||||||
|
break
|
||||||
}
|
}
|
||||||
} catch {
|
|
||||||
Error($_.Exception.Message)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
$script:Language = Add-Entry $Stage "Language" $array "DisplayLanguage"
|
$script:Language = Add-Entry $Stage "Language" $array "DisplayLanguage"
|
||||||
$Language.SelectedIndex = $SelectedIndex
|
$Language.SelectedIndex = $SelectedIndex
|
||||||
@@ -598,53 +661,58 @@ $Continue.add_click({
|
|||||||
}
|
}
|
||||||
|
|
||||||
4 { # Language selection => Request and populate Arch download links
|
4 { # Language selection => Request and populate Arch download links
|
||||||
$XMLForm.Title = Get-Translation($English[12])
|
|
||||||
Refresh-Control($XMLForm)
|
|
||||||
$url = "https://www.microsoft.com/" + $QueryLocale + "/api/controls/contentinclude/html"
|
|
||||||
$url += "?pageId=" + $RequestData["GetLinks"][0]
|
|
||||||
$url += "&host=www.microsoft.com"
|
|
||||||
$url += "&segments=software-download," + $WindowsVersion.SelectedValue.PageType
|
|
||||||
$url += "&query=&action=" + $RequestData["GetLinks"][1]
|
|
||||||
$url += "&sessionId=" + $SessionId
|
|
||||||
$url += "&skuId=" + $Language.SelectedValue.Id
|
|
||||||
$url += "&language=" + $Language.SelectedValue.Language
|
|
||||||
$url += "&sdVersion=2"
|
|
||||||
Write-Host Querying $url
|
|
||||||
|
|
||||||
$i = 0
|
|
||||||
$SelectedIndex = 0
|
|
||||||
$array = @()
|
$array = @()
|
||||||
try {
|
if ($WindowsVersion.SelectedValue.PageType -eq "WIN7") {
|
||||||
$Is64 = [Environment]::Is64BitOperatingSystem
|
foreach ($Version in $Windows7Versions[$ProductEdition.SelectedValue.Id][$Language.SelectedValue.Id][2]) {
|
||||||
$r = Invoke-WebRequest -UserAgent $UserAgent -WebSession $Session $url
|
$array += @(New-Object PsObject -Property @{ Type = $Version[0]; Link = $Version[1] })
|
||||||
if (-not $($r.AllElements | ? {$_.id -eq "expiration-time"})) {
|
|
||||||
Throw-Error -Req $r -Alt Get-Translation($English[14])
|
|
||||||
}
|
}
|
||||||
$html = $($r.AllElements | ? {$_.tagname -eq "input"}).outerHTML
|
} else {
|
||||||
# Need to fix the HTML and JSON data so that it is well-formed
|
$XMLForm.Title = Get-Translation($English[12])
|
||||||
$html = $html.Replace("class=product-download-hidden", "")
|
Refresh-Control($XMLForm)
|
||||||
$html = $html.Replace("type=hidden", "")
|
$url = "https://www.microsoft.com/" + $QueryLocale + "/api/controls/contentinclude/html"
|
||||||
$html = $html.Replace(">", "/>")
|
$url += "?pageId=" + $RequestData["GetLinks"][0]
|
||||||
$html = $html.Replace("IsoX86", """x86""")
|
$url += "&host=www.microsoft.com"
|
||||||
$html = $html.Replace("IsoX64", """x64""")
|
$url += "&segments=software-download," + $WindowsVersion.SelectedValue.PageType
|
||||||
$html = "<inputs>" + $html + "</inputs>"
|
$url += "&query=&action=" + $RequestData["GetLinks"][1]
|
||||||
$xml = [xml]$html
|
$url += "&sessionId=" + $SessionId
|
||||||
foreach ($var in $xml.inputs.input) {
|
$url += "&skuId=" + $Language.SelectedValue.Id
|
||||||
$json = $var.value | ConvertFrom-Json;
|
$url += "&language=" + $Language.SelectedValue.Language
|
||||||
if ($json) {
|
$url += "&sdVersion=2"
|
||||||
if (($Is64 -and $json.DownloadType -eq "x64") -or (-not $Is64 -and $json.DownloadType -eq "x86")) {
|
Write-Host Querying $url
|
||||||
$SelectedIndex = $i
|
|
||||||
|
$i = 0
|
||||||
|
$SelectedIndex = 0
|
||||||
|
|
||||||
|
try {
|
||||||
|
$Is64 = [Environment]::Is64BitOperatingSystem
|
||||||
|
$r = Invoke-WebRequest -UseBasicParsing -UserAgent $UserAgent -WebSession $Session $url
|
||||||
|
$pattern = '(?s)(<input.*?/>)'
|
||||||
|
ForEach-Object { [regex]::Matches($r, $pattern) } | ForEach-Object { $html += $_.Groups[1].value }
|
||||||
|
# Need to fix the HTML and JSON data so that it is well-formed
|
||||||
|
$html = $html.Replace("class=product-download-hidden", "")
|
||||||
|
$html = $html.Replace("type=hidden", "")
|
||||||
|
$html = $html.Replace(" ", " ")
|
||||||
|
$html = $html.Replace("IsoX86", ""x86"")
|
||||||
|
$html = $html.Replace("IsoX64", ""x64"")
|
||||||
|
$html = "<inputs>" + $html + "</inputs>"
|
||||||
|
$xml = [xml]$html
|
||||||
|
foreach ($var in $xml.inputs.input) {
|
||||||
|
$json = $var.value | ConvertFrom-Json;
|
||||||
|
if ($json) {
|
||||||
|
if (($Is64 -and $json.DownloadType -eq "x64") -or (-not $Is64 -and $json.DownloadType -eq "x86")) {
|
||||||
|
$SelectedIndex = $i
|
||||||
|
}
|
||||||
|
$array += @(New-Object PsObject -Property @{ Type = $json.DownloadType; Link = $json.Uri })
|
||||||
|
$i++
|
||||||
}
|
}
|
||||||
$array += @(New-Object PsObject -Property @{ Type = $json.DownloadType; Link = $json.Uri })
|
|
||||||
$i++
|
|
||||||
}
|
}
|
||||||
|
if ($array.Length -eq 0) {
|
||||||
|
Throw-Error -Req $r -Alt "Could not retrieve ISO download links"
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
Error($_.Exception.Message)
|
||||||
|
break
|
||||||
}
|
}
|
||||||
if ($array.Length -eq 0) {
|
|
||||||
Throw-Error -Req $r -Alt "Could not retreive ISO download links"
|
|
||||||
}
|
|
||||||
} catch {
|
|
||||||
Error($_.Exception.Message)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$script:Arch = Add-Entry $Stage "Architecture" $array "Type"
|
$script:Arch = Add-Entry $Stage "Architecture" $array "Type"
|
||||||
@@ -681,7 +749,7 @@ $Continue.add_click({
|
|||||||
}
|
}
|
||||||
$Continue.IsEnabled = $True
|
$Continue.IsEnabled = $True
|
||||||
if ($Stage -ge 0) {
|
if ($Stage -ge 0) {
|
||||||
$Back.IsEnabled = $True;
|
$Back.IsEnabled = $True
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -705,10 +773,12 @@ $Back.add_click({
|
|||||||
$Margin.Top -= $dh2
|
$Margin.Top -= $dh2
|
||||||
$Back.Margin = $Margin
|
$Back.Margin = $Margin
|
||||||
$script:Stage = $Stage - 1
|
$script:Stage = $Stage - 1
|
||||||
|
$XMLForm.Title = $AppTitle
|
||||||
if ($Stage -eq 0) {
|
if ($Stage -eq 0) {
|
||||||
$Back.Content = Get-Translation("Close")
|
$Back.Content = Get-Translation("Close")
|
||||||
} elseif ($Stage -eq 3) {
|
} else {
|
||||||
$Continue.Content = Get-Translation("Continue")
|
$Continue.Content = Get-Translation("Continue")
|
||||||
|
Refresh-Control($Continue)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -718,7 +788,158 @@ $XMLForm.Add_Loaded( { $XMLForm.Activate() } )
|
|||||||
$XMLForm.ShowDialog() | Out-Null
|
$XMLForm.ShowDialog() | Out-Null
|
||||||
|
|
||||||
# Clean up & exit
|
# Clean up & exit
|
||||||
if ($DFRCAdded) {
|
|
||||||
Remove-ItemProperty -Path $DFRCKey -Name $DFRCName
|
|
||||||
}
|
|
||||||
exit $ExitCode
|
exit $ExitCode
|
||||||
|
|
||||||
|
# SIG # Begin signature block
|
||||||
|
# MIIcQgYJKoZIhvcNAQcCoIIcMzCCHC8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
|
||||||
|
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
|
||||||
|
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBGq2C5xqP9tvN9
|
||||||
|
# 4PFRzj/VzRRF7efttyTaScJEztjIcqCCCy4wggVGMIIELqADAgECAhAkaSZj72wM
|
||||||
|
# Cjsjz6MQw2SbMA0GCSqGSIb3DQEBCwUAMH0xCzAJBgNVBAYTAkdCMRswGQYDVQQI
|
||||||
|
# ExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAOBgNVBAcTB1NhbGZvcmQxGjAYBgNVBAoT
|
||||||
|
# EUNPTU9ETyBDQSBMaW1pdGVkMSMwIQYDVQQDExpDT01PRE8gUlNBIENvZGUgU2ln
|
||||||
|
# bmluZyBDQTAeFw0xODAzMTYwMDAwMDBaFw0yMjAzMTYyMzU5NTlaMIGTMQswCQYD
|
||||||
|
# VQQGEwJJRTERMA8GA1UEEQwIRjkyIEQ2NjcxFDASBgNVBAgMC0NvLiBEb25lZ2Fs
|
||||||
|
# MRAwDgYDVQQHDAdNaWxmb3JkMRUwEwYDVQQJDAwyNCBHcmV5IFJvY2sxGDAWBgNV
|
||||||
|
# BAoMD0FrZW8gQ29uc3VsdGluZzEYMBYGA1UEAwwPQWtlbyBDb25zdWx0aW5nMIIB
|
||||||
|
# IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAucIiMwsQe8seN3s519ZbhFfX
|
||||||
|
# XswzuieRtmXe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IBAQA3dG72Ftdt3/AXoxMDovsxatdFghcKHjl01+8x
|
||||||
|
# 6iguabtan9Lqz2yulzj4px2KCUV64VPhRytaS15YHZDJH7Q9BlTvcgNpSujs3fkQ
|
||||||
|
# KdSmHs+MrNMetpAT6WH185J1z/3rRLc/LpESc6tipocAkA7uPualGIkBJNFEwqiT
|
||||||
|
# aTjR3h3zGZs2aEJJ2X8DgBEg9zgZNUzr6zsprHyCODAtmO89owAywKQbu/ZczsVE
|
||||||
|
# mPJKgJ511BZlyTLW5elvB17QX95vqoit0ZGhbMTHKtJxojyUZZC7Y+cV6E6/HbQA
|
||||||
|
# tvcFWa5BzljDyRC70uFeEPV8t6ine6ytd98BWaF13IB8jqYQMIIF4DCCA8igAwIB
|
||||||
|
# AgIQLnyHzA6TSlL+lP0ct800rzANBgkqhkiG9w0BAQwFADCBhTELMAkGA1UEBhMC
|
||||||
|
# R0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9y
|
||||||
|
# ZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBS
|
||||||
|
# U0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTMwNTA5MDAwMDAwWhcNMjgw
|
||||||
|
# NTA4MjM1OTU5WjB9MQswCQYDVQQGEwJHQjEbMBkGA1UECBMSR3JlYXRlciBNYW5j
|
||||||
|
# aGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRowGAYDVQQKExFDT01PRE8gQ0EgTGlt
|
||||||
|
# aXRlZDEjMCEGA1UEAxMaQ09NT0RPIFJTQSBDb2RlIFNpZ25pbmcgQ0EwggEiMA0G
|
||||||
|
# CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCmmJBjd5E0f4rR3elnMRHrzB79MR2z
|
||||||
|
# uWJXP5O8W+OfHiQyESdrvFGRp8+eniWzX4GoGA8dHiAwDvthe4YJs+P9omidH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1NiBUaW1lU3RhbXBpbmcgQ0EC
|
||||||
|
# EHvU5a+6zAc/oQEjBCJBTRIwCwYJYIZIAWUDBAIBoIGkMBoGCSqGSIb3DQEJAzEN
|
||||||
|
# BgsqhkiG9w0BCRABBDAcBgkqhkiG9w0BCQUxDxcNMjEwNjEwMTAzODU5WjAvBgkq
|
||||||
|
# hkiG9w0BCQQxIgQgmkzzCEFINNxyi0VgUg+Xe7gn6JtaRlUItfaDirYqplswNwYL
|
||||||
|
# KoZIhvcNAQkQAi8xKDAmMCQwIgQgxHTOdgB9AjlODaXk3nwUxoD54oIBPP72U+9d
|
||||||
|
# tx/fYfgwCwYJKoZIhvcNAQEBBIIBACpaTpSIzaaiV6meU/x2sTikIngCFWQsY+Pf
|
||||||
|
# DwhgEX7h36q5O92NtHjrUgGILvPSjtZ27Mpxbm84HCwPUn+VJcDBh4MbD8GDV+X4
|
||||||
|
# dKx/77zLUiuWlhub1Jz2wDRd+ac0GV1get6dBCAKVomtGqbg5he0p0WvgSosmhXi
|
||||||
|
# dVr7i59KIaP/J1e2DBDqJPsVFUpCSaaDLfqBR+0hV4sTczRLDrE8k8cTGNzcNhH8
|
||||||
|
# WzqLCEw0V40Tc5KZ1xghdxIYH3V7SJOIYTKopuN6G/hMnR+hABU578iPjhAQjbel
|
||||||
|
# Z0EkBvJk8bwoMBGEf3OnB8S7xJRDsbgYLubnItXJ6z5pLcNJRbc=
|
||||||
|
# SIG # End signature block
|
||||||
|
67
README.md
67
README.md
@@ -7,26 +7,32 @@ Fido: Full ISO Download Script (for Windows retail ISOs)
|
|||||||
Description
|
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 that automates access to the official Windows retail ISO download links.
|
can also be used in standalone fashion, and whose purpose is to automate access to the official Microsoft Windows retail
|
||||||
|
ISO download links.
|
||||||
|
|
||||||
We decided to create this script because, while Microsoft does make retail ISO download links freely and publicly
|
This script exists because, while Microsoft does make retail ISO download links freely and publicly available (at least
|
||||||
available on their website (at least for Windows 8 and Windows 10), it only does so after actively forcing users to
|
for Windows 8 and Windows 10), it only does so after actively forcing users to jump through a lot of unwarranted hoops,
|
||||||
jump through a lot of unwarranted hoops, that create an exceedingly counterproductive, if not downright unfriendly,
|
that create an exceedingly counterproductive, if not downright unfriendly, consumer experience and that greatly detract
|
||||||
consumer experience, which greatly detracts from what people really want (direct access to ISO downloads).
|
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 can be 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 it is only with an official retail ISO that one can assert
|
Microsoft's own Media Creation Tool (MCT), this is because using official retail ISOs is currently the only way to
|
||||||
with complete certainty whether its content has been altered in any way or not. Indeed, retail Microsoft's ISOs are the
|
assert with absolute certainty that the OS content has not been altered. Indeed, because there only exists a single
|
||||||
only ones you will be able to obtain an official SHA-1 for (from sites [such as this one](https://msdn.rg-adguard.net/public.php))
|
master for each of them, Microsoft retail ISOs are the only ones you can obtain an official SHA-1 for (from MSDN, if you
|
||||||
allowing you to be 100% certain that the image you are using is non corrupted and safe to use.
|
have access to it, or from sites [such as this one](https://msdn.rg-adguard.net/public.php)) allowing you to be 100%
|
||||||
|
sure that the image you are using has not been corrupted and is safe to use.
|
||||||
|
|
||||||
This, in turn, offers assurance that the content __YOU__ are using to install your OS, and which it is indeed critical
|
This, in turn, offers assurance that the content __YOU__ are using to install your OS, which it is indeed critical to
|
||||||
to validate beforehand if you care about security, does matches bit for bit the one that Microsoft officially released.
|
validate beforehand if you have the slightest concern about security, does match, bit for bit, the one that Microsoft
|
||||||
|
released.
|
||||||
|
|
||||||
On the other hand, because no two MCT ISOs are the same (due to MCT always regenerating the ISO content on the fly)
|
On the other hand, regardless of the manner in which Microsoft's Media Creation Tool produces its content, because no
|
||||||
it is impossible to get the same kind of assurance from non-retail ISOs. Hence the need to provide users with a much
|
two MCT ISOs are ever the same (due to MCT always regenerating the ISO content on the fly) it is currently impossible to
|
||||||
easier and less restrictive way to access official retail ISOs...
|
validate with absolute certainty whether any ISO that was generated by the MCT is safe to use. Especially, unlike what
|
||||||
|
is the case for retail ISOs, it is impossible to tell whether an MCT ISO may have been corrupted after generation.
|
||||||
|
|
||||||
|
Hence the need to provide users with a much easier and less restrictive way to access official retail ISOs...
|
||||||
|
|
||||||
License
|
License
|
||||||
-------
|
-------
|
||||||
@@ -45,31 +51,26 @@ redirect you __away__ from the pages that allow you to download retail ISOs):
|
|||||||
* https://www.microsoft.com/software-download/Windows10ISO
|
* https://www.microsoft.com/software-download/Windows10ISO
|
||||||
|
|
||||||
After visiting those with a full browser (Internet Explorer, running through the `Invoke-WebRequest` PowerShell Cmdlet),
|
After visiting those with a full browser (Internet Explorer, running through the `Invoke-WebRequest` PowerShell Cmdlet),
|
||||||
to confirm that they are accessible queries web APIs on the Microsoft servers to first request the language selection
|
to confirm that they are accessible, the script then queries the web API from the Microsoft servers to first request the
|
||||||
available for the for the version of Windows that was selected, and then the download links for the various architecture
|
language selection available for the version of Windows selected by the user, and then request the actual download links
|
||||||
enabled for that version + language combination.
|
for all the architectures available for that specific combination of version + language.
|
||||||
|
|
||||||
Requirements
|
Requirements
|
||||||
------------
|
------------
|
||||||
|
|
||||||
PowerShell 3.0 or later is required. But the script does detect if you are using an older version and points you to the
|
PowerShell 3.0 or later is required. However the script should detect if you are using an older version and point you to
|
||||||
relevant PowerShell 3.0 download page if needed, which should only be the case if you are running a vanilla version of
|
the relevant PowerShell 3.0 download page if needed (which should only ever occur if you are running a vanilla version
|
||||||
Windows 7.
|
of Windows 7).
|
||||||
|
|
||||||
Also, because Internet Explorer is being used behind the scenes, if you haven't gone through the first time setup for
|
Note that the current version of the script does not need Internet Explorer to be installed and should also work with
|
||||||
Internet Explorer, you may receive an error about it when running the script. If that is the case, then you need to
|
PowerShell 7.
|
||||||
make sure that you manually launch IE at least once and complete the setup.
|
|
||||||
|
|
||||||
Note that, if running this script elevated, this annoyance can be avoided by using the `-DisableFirstRunCustomize`
|
|
||||||
option (which basically __temporarily__ creates the key of the same name in the registry __if__ it doesn't already
|
|
||||||
exist, to bypass that behaviour).
|
|
||||||
|
|
||||||
Additional Notes
|
Additional Notes
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
Because of it's intended usage with Rufus, this script is not designed to cover all possible retail ISO downloads, but
|
Because of its intended usage with Rufus, this script is not designed to cover every possible retail ISO downloads.
|
||||||
mostly those that the general public are likely to use. For instance, we currently have no plan to add support for
|
Instead we mostly chose the ones that the general public is likely to request. For instance, we currently have no plan
|
||||||
LTSB/LTSC Windows 10 ISOs downloads.
|
to add support for LTSB/LTSC Windows 10 ISOs downloads.
|
||||||
|
|
||||||
If you are interested in such downloads, you are kindly invited to visit the relevant download pages from Microsoft
|
If you are interested in such downloads, then you are kindly invited to visit the relevant download pages from Microsoft
|
||||||
such as [this one](https://www.microsoft.com/evalcenter/evaluate-windows-10-enterprise) for LTSC versions.
|
such as [this one](https://www.microsoft.com/evalcenter/evaluate-windows-10-enterprise) for LTSC versions.
|
||||||
|
2
sign.sh
2
sign.sh
@@ -20,6 +20,8 @@ sign_file() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Update the Authenticode signature
|
||||||
|
cmd.exe /c '"C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool" sign /v /sha1 9ce9a71ccab3b38a74781b975f1c228222cf7d3b /fd SHA256 /tr http://sha256timestamp.ws.symantec.com/sha256/timestamp 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