mirror of
https://github.com/pbatard/Fido.git
synced 2025-09-16 14:18:02 +02:00
Compare commits
22 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
af17001505 | ||
![]() |
43adf47d5d | ||
![]() |
99f6f246b8 | ||
![]() |
36e9b4420c | ||
![]() |
6d630f83f2 | ||
![]() |
ee0393cb74 | ||
![]() |
a8abb94a16 | ||
![]() |
15a48fe24f | ||
![]() |
e0c1015ade | ||
![]() |
46c399ecd7 | ||
![]() |
445ca5c074 | ||
![]() |
037cd1ad9b | ||
![]() |
aa378cad13 | ||
![]() |
3c4fafa207 | ||
![]() |
a405ebf79c | ||
![]() |
b0599d7a94 | ||
![]() |
e4645bfabc | ||
![]() |
9769ff8a16 | ||
![]() |
d26c757f67 | ||
![]() |
1d5a4dc17b | ||
![]() |
cedf215a9d | ||
![]() |
dd73cef3b4 |
8
.whitesource
Normal file
8
.whitesource
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"checkRunSettings": {
|
||||
"vulnerableCheckRunConclusionLevel": "failure"
|
||||
},
|
||||
"issueSettings": {
|
||||
"minSeverityLevel": "LOW"
|
||||
}
|
||||
}
|
637
Fido.ps1
637
Fido.ps1
@@ -1,6 +1,6 @@
|
||||
#
|
||||
# Fido v1.09 - Retail Windows ISO Downloader
|
||||
# Copyright © 2019 Pete Batard <pete@akeo.ie>
|
||||
# Fido v1.20 - Retail Windows ISO Downloader
|
||||
# Copyright © 2019-2021 Pete Batard <pete@akeo.ie>
|
||||
# ConvertTo-ImageSource: Copyright © 2016 Chris Carter
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
@@ -30,16 +30,13 @@ param(
|
||||
[string]$Icon,
|
||||
# (Optional) Name of a pipe the download URL should be sent to.
|
||||
# If not provided, a browser window is opened instead.
|
||||
[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,
|
||||
# (Optional) Toggle expert mode (additional ISOs to choose).
|
||||
[switch]$Expert = $False
|
||||
[string]$PipeName
|
||||
)
|
||||
#endregion
|
||||
|
||||
try {
|
||||
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
||||
} catch {}
|
||||
Write-Host Please Wait...
|
||||
|
||||
#region Assembly Types
|
||||
@@ -62,114 +59,150 @@ $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
|
||||
# Hide the powershell window: https://stackoverflow.com/a/27992426/1069307
|
||||
[Gui.Utils]::ShowWindow(([System.Diagnostics.Process]::GetCurrentProcess() | Get-Process).MainWindowHandle, 0) | Out-Null
|
||||
#endregion
|
||||
|
||||
#region Data
|
||||
$zh = 0x10000
|
||||
$ko = 0x20000
|
||||
$WindowsVersions = @(
|
||||
@(
|
||||
@("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)",
|
||||
@("Windows 10 Home/Pro", 1214),
|
||||
@("Windows 10 Education", 1216),
|
||||
@("Windows 10 Home China ", ($zh + 1215))
|
||||
),
|
||||
@(
|
||||
"1809 R2 (Build 17763.107 - 2018.10)",
|
||||
@("Windows 10 Home/Pro", 1060),
|
||||
@("Windows 10 Education", 1056),
|
||||
@("Windows 10 Home China ", -1061)
|
||||
@("Windows 10 Home China ", ($zh + 1061))
|
||||
),
|
||||
@(
|
||||
"1809 R1 (Build 17763.1 - 2018.09)",
|
||||
@("Windows 10 Home/Pro", 1019),
|
||||
@("Windows 10 Education", 1021),
|
||||
@("Windows 10 Home China ", -1020)
|
||||
@("Windows 10 Home China ", ($zh + 1020))
|
||||
),
|
||||
@(
|
||||
"1803 (Build 17134.1 - 2018.04)",
|
||||
@("Windows 10 Home/Pro", 651),
|
||||
@("Windows 10 Education", 655),
|
||||
@("Windows 10 Enterprise Eval", -629)
|
||||
@("Windows 10 COEM 1803 Home China", -640),
|
||||
@("Windows 10 COEM 1803", -639),
|
||||
@("Windows 10 1803 Home China", -638),
|
||||
@("Windows 10 1803", 637),
|
||||
@("Windows 10 COEM 1803_1 Home China", -654),
|
||||
@("Windows 10 COEM 1803_1", -653),
|
||||
@("Windows 10 1803_1 Home China", -652)
|
||||
@("Windows 10 Home China", ($zh + 652))
|
||||
),
|
||||
@(
|
||||
"1709 (Build 16299.15 - 2017.09)",
|
||||
@("Windows 10 Education 1709", 488),
|
||||
@("Windows 10 COEM 1709 Home China", -487),
|
||||
@("Windows 10 COEM 1709", -486),
|
||||
@("Windows 10 1709 Home China", -485),
|
||||
@("Windows 10 1709", 484)
|
||||
@("Windows 10 Home/Pro", 484),
|
||||
@("Windows 10 Education", 488),
|
||||
@("Windows 10 Home China", ($zh + 485))
|
||||
),
|
||||
@(
|
||||
"1703 (Build 15063.0 - 2017.03)",
|
||||
@("Windows 10 1703 Education N", 424),
|
||||
@("Windows 10 1703 Education", 423),
|
||||
@("Windows 10 COEM 1703 Home China", -372),
|
||||
@("Windows 10 COEM 1703 Single Language", 371),
|
||||
@("Windows 10 COEM 1703 N", 370),
|
||||
@("Windows 10 COEM 1703", 369),
|
||||
@("Windows 10 1703 Home China (Redstone 2)", -364),
|
||||
@("Windows 10 1703 Single Language (Redstone 2)", -363),
|
||||
@("Windows 10 1703 N (Redstone 2)", 362),
|
||||
@("Windows 10 1703 (Redstone 2)", 361)
|
||||
"1703 [Redstone 2] (Build 15063.0 - 2017.03)",
|
||||
@("Windows 10 Home/Pro", 361),
|
||||
@("Windows 10 Home/Pro N", 362),
|
||||
@("Windows 10 Single Language", 363),
|
||||
@("Windows 10 Education", 423),
|
||||
@("Windows 10 Education N", 424),
|
||||
@("Windows 10 Home China", ($zh + 364))
|
||||
),
|
||||
@(
|
||||
"1607 (Build 14393.0 - 2017.07)",
|
||||
@("Windows 10 China Get Genuine (Redstone 1)", -247),
|
||||
@("Windows 10 Single Language (Redstone 1)", 246),
|
||||
@("Windows 10 N (Redstone 1)", 245),
|
||||
@("Windows 10 (Redstone 1)", 244),
|
||||
@("Windows 10 Education N (Redstone 1)", 243),
|
||||
@("Windows 10 Education (Redstone 1)", 242)
|
||||
"1607 [Redstone 1] (Build 14393.0 - 2016.07)",
|
||||
@("Windows 10 Home/Pro", 244),
|
||||
@("Windows 10 Home/Pro N", 245),
|
||||
@("Windows 10 Single Language", 246),
|
||||
@("Windows 10 Education", 242),
|
||||
@("Windows 10 Education N", 243),
|
||||
@("Windows 10 China Get Genuine", ($zh + 247))
|
||||
),
|
||||
@(
|
||||
"1511 R3 (Build 10586.164 - 2016.04)",
|
||||
@("Windows 10 China Get Genuine (Threshold 2, April 2016 Update)", -185),
|
||||
@("Windows 10 Single Language (Threshold 2, April 2016 Update)", 184),
|
||||
@("Windows 10 N (Threshold 2, April 2016 Update)", -183),
|
||||
@("Windows 10 KN (Threshold 2, April 2016 Update)", -182),
|
||||
@("Windows 10 Education N (Threshold 2, April 2016 Update)", 181),
|
||||
@("Windows 10 Education KN (Threshold 2, April 2016 Update)", -180),
|
||||
@("Windows 10 Education (Threshold 2, April 2016 Update)", 179),
|
||||
@("Windows 10 (Threshold 2, April 2016 Update)", 178)
|
||||
"1511 R3 [Threshold 2] (Build 10586.164 - 2016.04)",
|
||||
@("Windows 10 Home/Pro", 178),
|
||||
@("Windows 10 Home/Pro N", 183),
|
||||
@("Windows 10 Single Language", 184),
|
||||
@("Windows 10 Education", 179),
|
||||
@("Windows 10 Education N", 181),
|
||||
@("Windows 10 KN", ($ko + 182)),
|
||||
@("Windows 10 Education KN", ($ko + 180)),
|
||||
@("Windows 10 China Get Genuine", ($zh + 185))
|
||||
),
|
||||
@(
|
||||
"1511 R2 (Build 10586.104 - 2016.02)",
|
||||
@("Windows 10 Single Language (Threshold 2, February 2016 Update)", 116),
|
||||
@("Windows 10 N (Threshold 2, February 2016 Update)", 115),
|
||||
@("Windows 10 KN (Threshold 2, February 2016 Update)", -114),
|
||||
@("Windows 10 China Get Genuine (Threshold 2, February 2016 Update)", -113),
|
||||
@("Windows 10 Education N (Threshold 2, February 2016 Update)", 112),
|
||||
@("Windows 10 Education KN (Threshold 2, February 2016 Update)", -111),
|
||||
@("Windows 10 Education (Threshold 2, February 2016 Update)", 110),
|
||||
@("Windows 10 (Threshold 2, February 2016 Update)", 109)
|
||||
"1511 R2 [Threshold 2] (Build 10586.104 - 2016.02)",
|
||||
@("Windows 10 Home/Pro", 109),
|
||||
@("Windows 10 Home/Pro N", 115),
|
||||
@("Windows 10 Single Language", 116),
|
||||
@("Windows 10 Education", 110),
|
||||
@("Windows 10 Education N", 112),
|
||||
@("Windows 10 KN", ($ko + 114)),
|
||||
@("Windows 10 Education KN", ($ko + 111)),
|
||||
@("Windows 10 China Get Genuine", ($zh + 113))
|
||||
),
|
||||
@(
|
||||
"1511 R1 (Build 10586.0 - 2015.11)",
|
||||
@("Windows 10 Single Language (Threshold 2)", 106),
|
||||
@("Windows 10 N (Threshold 2)", 105),
|
||||
@("Windows 10 KN (Threshold 2)", -104),
|
||||
@("Windows 10 China Get Genuine (Threshold 2)", -103),
|
||||
@("Windows 10 Education N (Threshold 2)", 102),
|
||||
@("Windows 10 Education KN (Threshold 2)", -101),
|
||||
@("Windows 10 Education (Threshold 2)", 100),
|
||||
@("Windows 10 (Threshold 2)", 99)
|
||||
"1511 R1 [Threshold 2] (Build 10586.0 - 2015.11)",
|
||||
@("Windows 10 Home/Pro", 99),
|
||||
@("Windows 10 Home/Pro N", 105),
|
||||
@("Windows 10 Single Language", 106),
|
||||
@("Windows 10 Education", 100),
|
||||
@("Windows 10 Education N", 102),
|
||||
@("Windows 10 KN", ($ko + 104)),
|
||||
@("Windows 10 Education KN", ($ko + 101)),
|
||||
@("Windows 10 China Get Genuine", ($zh + 103))
|
||||
),
|
||||
@(
|
||||
"1507 (Build 10240.16384 - 2015.07)",
|
||||
@("Windows 10 Single Language (Threshold 1)", 82),
|
||||
@("Windows 10 N (Threshold 1)", 81),
|
||||
@("Windows 10 KN (Threshold 1)", -80),
|
||||
@("Windows 10 (Threshold 1)", 79),
|
||||
@("Windows 10 China Get Genuine (Threshold 1)", -78),
|
||||
@("Windows 10 Education N (Threshold 1)", 77),
|
||||
@("Windows 10 Education KN (Threshold 1)", -76),
|
||||
@("Windows 10 Education (Threshold 1)", 75)
|
||||
"1507 [Threshold 1] (Build 10240.16384 - 2015.07)",
|
||||
@("Windows 10 Home/Pro", 79),
|
||||
@("Windows 10 Home/Pro N", 81),
|
||||
@("Windows 10 Single Language", 82),
|
||||
@("Windows 10 Education", 75)
|
||||
@("Windows 10 Education N", 77),
|
||||
@("Windows 10 KN", ($ko + 80)),
|
||||
@("Windows 10 Education KN", ($ko + 76)),
|
||||
@("Windows 10 China Get Genuine", ($zh + 78))
|
||||
)
|
||||
),
|
||||
@(
|
||||
@@ -179,15 +212,56 @@ $WindowsVersions = @(
|
||||
@("Windows 8.1", 52),
|
||||
@("Windows 8.1 N", 55)
|
||||
@("Windows 8.1 Single Language", 48),
|
||||
@("Windows 8.1 Professional LE N", 71),
|
||||
@("Windows 8.1 Professional LE KN", -70),
|
||||
@("Windows 8.1 Professional LE K", -69),
|
||||
@("Windows 8.1 Professional LE", 68),
|
||||
@("Windows 8.1 KN", -62),
|
||||
@("Windows 8.1 K", -61)
|
||||
@("Windows 8.1 K", ($ko + 61)),
|
||||
@("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
|
||||
|
||||
#region Functions
|
||||
@@ -205,10 +279,10 @@ function Select-Language([string]$LangName)
|
||||
($SysLocale.StartsWith("da") -and $LangName -like "*Danish*") -or `
|
||||
($SysLocale.StartsWith("nl") -and $LangName -like "*Dutch*") -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("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("de") -and $LangName -like "*German*") -or `
|
||||
($SysLocale.StartsWith("el") -and $LangName -like "*Greek*") -or `
|
||||
@@ -329,6 +403,17 @@ function ConvertTo-ImageSource
|
||||
}
|
||||
}
|
||||
|
||||
function Throw-Error([object]$Req, [string]$Alt)
|
||||
{
|
||||
$Err = $(GetElementById -Request $r -Id "errorModalMessage").innerText
|
||||
if (-not $Err) {
|
||||
$Err = $Alt
|
||||
} else {
|
||||
$Err = [System.Text.Encoding]::UTF8.GetString([byte[]][char[]]$Err)
|
||||
}
|
||||
throw $Err
|
||||
}
|
||||
|
||||
# Translate a message string
|
||||
function Get-Translation([string]$Text)
|
||||
{
|
||||
@@ -366,15 +451,12 @@ function GetElementById([object]$Request, [string]$Id)
|
||||
|
||||
function Error([string]$ErrorMessage)
|
||||
{
|
||||
Write-Host $ErrorMessage
|
||||
Write-Host Error: $ErrorMessage
|
||||
$XMLForm.Title = $(Get-Translation("Error")) + ": " + $ErrorMessage
|
||||
Refresh-Control($XMLForm)
|
||||
$Continue.Content = Get-Translation("Close")
|
||||
Refresh-Control($Continue)
|
||||
$XMLGrid.Children[2 * $script:Stage + 1].IsEnabled = $True
|
||||
$UserInput = [System.Windows.MessageBox]::Show($XMLForm.Title, $(Get-Translation("Error")), "OK", "Error")
|
||||
$script:ExitCode = $Stage
|
||||
$script:Stage = -1
|
||||
$Continue.IsEnabled = $True
|
||||
$script:ExitCode = $script:Stage--
|
||||
}
|
||||
|
||||
function Get-RandomDate()
|
||||
@@ -412,14 +494,11 @@ $MaxStage = 4
|
||||
$SessionId = [guid]::NewGuid()
|
||||
$ExitCode = 100
|
||||
$Locale = "en-US"
|
||||
$DFRCKey = "HKLM:\Software\Policies\Microsoft\Internet Explorer\Main\"
|
||||
$DFRCName = "DisableFirstRunCustomize"
|
||||
$DFRCAdded = $False
|
||||
$RequestData = @{}
|
||||
$RequestData["GetLangs"] = @("a8f8f489-4c7f-463a-9ca6-5cff94d8d041", "getskuinformationbyproductedition" )
|
||||
$RequestData["GetLinks"] = @("cfa9e580-a81e-4a4b-a846-7b21bf4e2e5b", "GetProductDownloadLinksBySku" )
|
||||
# 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
|
||||
$UserAgent = "Mozilla/5.0 (X11; Linux i586; rv:$FirefoxVersion.0) Gecko/$FirefoxDate Firefox/$FirefoxVersion.0"
|
||||
#endregion
|
||||
@@ -450,20 +529,6 @@ if ($PSVersionTable.PSVersion.Major -lt 3) {
|
||||
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
|
||||
$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 }
|
||||
@@ -492,11 +557,7 @@ $WindowsVersion.DisplayMemberPath = "Version"
|
||||
|
||||
# Button Action
|
||||
$Continue.add_click({
|
||||
if ($script:Stage++ -lt 0) {
|
||||
Get-Process -Id $pid | Foreach-Object { $_.CloseMainWindow() | Out-Null }
|
||||
return
|
||||
}
|
||||
|
||||
$script:Stage++
|
||||
$XMLGrid.Children[2 * $Stage + 1].IsEnabled = $False
|
||||
$Continue.IsEnabled = $False
|
||||
$Back.IsEnabled = $False
|
||||
@@ -511,6 +572,7 @@ $Continue.add_click({
|
||||
# Check if the locale we want is available - Fall back to en-US otherwise
|
||||
try {
|
||||
$url = "https://www.microsoft.com/" + $QueryLocale + "/software-download/"
|
||||
Write-Host Querying $url
|
||||
Invoke-WebRequest -UseBasicParsing -MaximumRedirection 0 -UserAgent $UserAgent $url | Out-Null
|
||||
} catch {
|
||||
$script:QueryLocale = "en-US"
|
||||
@@ -535,8 +597,8 @@ $Continue.add_click({
|
||||
foreach ($Release in $WindowsVersions[$WindowsVersion.SelectedValue.Index][$WindowsRelease.SelectedValue.Index])
|
||||
{
|
||||
if ($Release -is [array]) {
|
||||
if ($Expert -or ($Release[1] -ge 0)) {
|
||||
$array += @(New-Object PsObject -Property @{ Edition = $Release[0]; Id = $Release[1] })
|
||||
if (($Release[1] -lt 0x10000) -or ($Locale.StartsWith("ko") -and ($Release[1] -band $ko)) -or ($Locale.StartsWith("zh") -and ($Release[1] -band $zh))) {
|
||||
$array += @(New-Object PsObject -Property @{ Edition = $Release[0]; Id = $($Release[1] -band 0xFFFF) })
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -546,50 +608,52 @@ $Continue.add_click({
|
||||
3 { # Product Edition selection => Request and populate Languages
|
||||
$XMLForm.Title = Get-Translation($English[12])
|
||||
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 = @()
|
||||
$i = 0
|
||||
$SelectedIndex = 0
|
||||
try {
|
||||
$r = Invoke-WebRequest -UserAgent $UserAgent -WebSession $Session $url
|
||||
# Go through an XML conversion to keep all PowerShells happy...
|
||||
if (-not $($r.AllElements | ? {$_.id -eq "product-languages"})) {
|
||||
throw "Unexpected server response"
|
||||
$i = 0;
|
||||
if ($WindowsVersion.SelectedValue.PageType -eq "WIN7") {
|
||||
foreach ($Entry in $Windows7Versions[$ProductEdition.SelectedValue.Id]) {
|
||||
if ($Entry[0] -ne "") {
|
||||
$array += @(New-Object PsObject -Property @{ DisplayLanguage = $Entry[0]; Language = $Entry[1]; Id = $i })
|
||||
}
|
||||
$i++
|
||||
}
|
||||
$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
|
||||
} else {
|
||||
$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++
|
||||
}
|
||||
$i++
|
||||
}
|
||||
}
|
||||
if ($array.Length -eq 0) {
|
||||
$ErrorMessage = $(GetElementById -Request $r -Id "errorModalMessage").innerText
|
||||
if ($ErrorMessage) {
|
||||
Write-Host "$(Get-Translation("Error")): ""$ErrorMessage"""
|
||||
if ($array.Length -eq 0) {
|
||||
Throw-Error -Req $r -Alt "Could not parse languages"
|
||||
}
|
||||
throw "Could not parse languages"
|
||||
} catch {
|
||||
Error($_.Exception.Message)
|
||||
break
|
||||
}
|
||||
} catch {
|
||||
Error($_.Exception.Message)
|
||||
return
|
||||
}
|
||||
$script:Language = Add-Entry $Stage "Language" $array "DisplayLanguage"
|
||||
$Language.SelectedIndex = $SelectedIndex
|
||||
@@ -597,70 +661,58 @@ $Continue.add_click({
|
||||
}
|
||||
|
||||
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 = @()
|
||||
try {
|
||||
$Is64 = [Environment]::Is64BitOperatingSystem
|
||||
$r = Invoke-WebRequest -UserAgent $UserAgent -WebSession $Session $url
|
||||
if (-not $($r.AllElements | ? {$_.id -eq "expiration-time"})) {
|
||||
$ErrorMessage = $(GetElementById -Request $r -Id "errorModalMessage").innerText
|
||||
if ($ErrorMessage) {
|
||||
Write-Host "$(Get-Translation("Error")): ""$ErrorMessage"""
|
||||
}
|
||||
throw Get-Translation($English[14])
|
||||
if ($WindowsVersion.SelectedValue.PageType -eq "WIN7") {
|
||||
foreach ($Version in $Windows7Versions[$ProductEdition.SelectedValue.Id][$Language.SelectedValue.Id][2]) {
|
||||
$array += @(New-Object PsObject -Property @{ Type = $Version[0]; Link = $Version[1] })
|
||||
}
|
||||
$html = $($r.AllElements | ? {$_.tagname -eq "input"}).outerHTML
|
||||
# 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(": I", ": ""I")
|
||||
$html = $html.Replace(" }", """ }")
|
||||
$html = "<inputs>" + $html + "</inputs>"
|
||||
$xml = [xml]$html
|
||||
foreach ($var in $xml.inputs.input) {
|
||||
$json = $var.value | ConvertFrom-Json;
|
||||
if ($json) {
|
||||
$Type = $json.DownloadType
|
||||
if ($Type -eq "IsoX64") {
|
||||
$Type = "x64"
|
||||
if ($Is64) {
|
||||
$SelectedIndex = $i
|
||||
}
|
||||
} elseif ($Type -eq "IsoX86") {
|
||||
$Type = "x86"
|
||||
if (-not $Is64) {
|
||||
} else {
|
||||
$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
|
||||
|
||||
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 = $Type; Link = $json.Uri })
|
||||
$i++
|
||||
}
|
||||
}
|
||||
if ($array.Length -eq 0) {
|
||||
$ErrorMessage = $(GetElementById -Request $r -Id "errorModalMessage").innerText
|
||||
if ($ErrorMessage) {
|
||||
Write-Host "$(Get-Translation("Error")): ""$ErrorMessage"""
|
||||
if ($array.Length -eq 0) {
|
||||
Throw-Error -Req $r -Alt "Could not retrieve ISO download links"
|
||||
}
|
||||
throw "Could not retreive ISO download links"
|
||||
} catch {
|
||||
Error($_.Exception.Message)
|
||||
break
|
||||
}
|
||||
} catch {
|
||||
Error($_.Exception.Message)
|
||||
return
|
||||
}
|
||||
|
||||
$script:Arch = Add-Entry $Stage "Architecture" $array "Type"
|
||||
@@ -697,7 +749,7 @@ $Continue.add_click({
|
||||
}
|
||||
$Continue.IsEnabled = $True
|
||||
if ($Stage -ge 0) {
|
||||
$Back.IsEnabled = $True;
|
||||
$Back.IsEnabled = $True
|
||||
}
|
||||
})
|
||||
|
||||
@@ -721,10 +773,12 @@ $Back.add_click({
|
||||
$Margin.Top -= $dh2
|
||||
$Back.Margin = $Margin
|
||||
$script:Stage = $Stage - 1
|
||||
$XMLForm.Title = $AppTitle
|
||||
if ($Stage -eq 0) {
|
||||
$Back.Content = Get-Translation("Close")
|
||||
} elseif ($Stage -eq 3) {
|
||||
} else {
|
||||
$Continue.Content = Get-Translation("Continue")
|
||||
Refresh-Control($Continue)
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -734,7 +788,158 @@ $XMLForm.Add_Loaded( { $XMLForm.Activate() } )
|
||||
$XMLForm.ShowDialog() | Out-Null
|
||||
|
||||
# Clean up & exit
|
||||
if ($DFRCAdded) {
|
||||
Remove-ItemProperty -Path $DFRCKey -Name $DFRCName
|
||||
}
|
||||
exit $ExitCode
|
||||
|
||||
# SIG # Begin signature block
|
||||
# MIIcQgYJKoZIhvcNAQcCoIIcMzCCHC8CAQExDzANBglghkgBZQMEAgEFADB5Bgor
|
||||
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
|
||||
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBGq2C5xqP9tvN9
|
||||
# 4PFRzj/VzRRF7efttyTaScJEztjIcqCCCy4wggVGMIIELqADAgECAhAkaSZj72wM
|
||||
# Cjsjz6MQw2SbMA0GCSqGSIb3DQEBCwUAMH0xCzAJBgNVBAYTAkdCMRswGQYDVQQI
|
||||
# ExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAOBgNVBAcTB1NhbGZvcmQxGjAYBgNVBAoT
|
||||
# EUNPTU9ETyBDQSBMaW1pdGVkMSMwIQYDVQQDExpDT01PRE8gUlNBIENvZGUgU2ln
|
||||
# bmluZyBDQTAeFw0xODAzMTYwMDAwMDBaFw0yMjAzMTYyMzU5NTlaMIGTMQswCQYD
|
||||
# VQQGEwJJRTERMA8GA1UEEQwIRjkyIEQ2NjcxFDASBgNVBAgMC0NvLiBEb25lZ2Fs
|
||||
# MRAwDgYDVQQHDAdNaWxmb3JkMRUwEwYDVQQJDAwyNCBHcmV5IFJvY2sxGDAWBgNV
|
||||
# BAoMD0FrZW8gQ29uc3VsdGluZzEYMBYGA1UEAwwPQWtlbyBDb25zdWx0aW5nMIIB
|
||||
# IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAucIiMwsQe8seN3s519ZbhFfX
|
||||
# XswzuieRtmXeB9nVlsU2s5UFZ3pdNSh9upBdHB08LC0zCiowvXxljlKrxVEP+sxZ
|
||||
# 54AGNqcGdPDyKFVugkFXOLmVo0YI2HQ1H6Sig7ML229vAeXoOqze0xZfBJ3L5Z0S
|
||||
# rs/Tr+X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/J1e2DBDqJPsVFUpCSaaDLfqBR+0hV4sTczRLDrE8k8cTGNzcNhH8
|
||||
# WzqLCEw0V40Tc5KZ1xghdxIYH3V7SJOIYTKopuN6G/hMnR+hABU578iPjhAQjbel
|
||||
# Z0EkBvJk8bwoMBGEf3OnB8S7xJRDsbgYLubnItXJ6z5pLcNJRbc=
|
||||
# SIG # End signature block
|
||||
|
69
README.md
69
README.md
@@ -7,26 +7,32 @@ Fido: Full ISO Download Script (for Windows retail ISOs)
|
||||
Description
|
||||
-----------
|
||||
|
||||
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.
|
||||
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
|
||||
ISO download links.
|
||||
|
||||
We decided to create this script because, while Microsoft does make retail ISO download links freely and publicly
|
||||
available on their website (at least for Windows 8 and Windows 10), it only does so after actively forcing users to
|
||||
jump through a lot of unwarranted hoops, that create an exceedingly counterproductive, if not downright unfriendly,
|
||||
consumer experience, which greatly detracts from what people really want (direct access to ISO downloads).
|
||||
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,
|
||||
that create an exceedingly counterproductive, if not downright unfriendly, consumer experience and that greatly detract
|
||||
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
|
||||
Microsoft's own Media Creation Tool (MCT), this is because it is only with an official retail ISO that one can assert
|
||||
with complete certainty whether its content has been altered in any way or not. Indeed, retail Microsoft's ISOs are the
|
||||
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))
|
||||
allowing you to be 100% certain that the image you are using is non corrupted and safe to use.
|
||||
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
|
||||
assert with absolute certainty that the OS content has not been altered. Indeed, because there only exists a single
|
||||
master for each of them, Microsoft retail ISOs are the only ones you can obtain an official SHA-1 for (from MSDN, if you
|
||||
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
|
||||
to validate beforehand if you care about security, does matches bit for bit the one that Microsoft officially released.
|
||||
This, in turn, offers assurance that the content __YOU__ are using to install your OS, which it is indeed critical to
|
||||
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)
|
||||
it is impossible to get the same kind of assurance from non-retail ISOs. Hence the need to provide users with a much
|
||||
easier and less restrictive way to access official retail ISOs...
|
||||
On the other hand, regardless of the manner in which Microsoft's Media Creation Tool produces its content, because no
|
||||
two MCT ISOs are ever the same (due to MCT always regenerating the ISO content on the fly) it is currently impossible to
|
||||
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
|
||||
-------
|
||||
@@ -36,7 +42,7 @@ License
|
||||
How it works
|
||||
------------
|
||||
|
||||
The script basically performs the same operation as one might perform when visiting either of the following ULRs (that
|
||||
The script basically performs the same operation as one might perform when visiting either of the following URLs (that
|
||||
is, provided that you have also changed your `User-Agent` browser string, since, when they detect that you are using a
|
||||
version of Windows that is the same as the one you are trying to download, the Microsoft web servers at these addresses
|
||||
redirect you __away__ from the pages that allow you to download retail ISOs):
|
||||
@@ -45,21 +51,26 @@ redirect you __away__ from the pages that allow you to download retail ISOs):
|
||||
* https://www.microsoft.com/software-download/Windows10ISO
|
||||
|
||||
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
|
||||
available for the for the version of Windows that was selected, and then the download links for the various architecture
|
||||
enabled for that version + language combination.
|
||||
to confirm that they are accessible, the script then queries the web API from the Microsoft servers to first request the
|
||||
language selection available for the version of Windows selected by the user, and then request the actual download links
|
||||
for all the architectures available for that specific combination of version + language.
|
||||
|
||||
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
|
||||
relevant PowerShell 3.0 download page if needed, which should only be the case if you are running a vanilla version of
|
||||
Windows 7.
|
||||
PowerShell 3.0 or later is required. However the script should detect if you are using an older version and point you to
|
||||
the relevant PowerShell 3.0 download page if needed (which should only ever occur if you are running a vanilla version
|
||||
of Windows 7).
|
||||
|
||||
Also, because Internet Explorer is being used behind the scenes, if you haven't gone through the first time setup for
|
||||
Internet Explorer, you may receive an error about it when running the script. If that is the case, then you need to
|
||||
make sure that you manually launch IE at least once and complete the setup.
|
||||
Note that the current version of the script does not need Internet Explorer to be installed and should also work with
|
||||
PowerShell 7.
|
||||
|
||||
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
|
||||
----------------
|
||||
|
||||
Because of its intended usage with Rufus, this script is not designed to cover every possible retail ISO downloads.
|
||||
Instead we mostly chose the ones that the general public is likely to request. For instance, we currently have no plan
|
||||
to add support for LTSB/LTSC Windows 10 ISOs downloads.
|
||||
|
||||
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.
|
||||
|
10
sign.sh
10
sign.sh
@@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
# This script creates the RSA-2048 signatures for our downloadable content
|
||||
# Creates an LZMA compressed Fido.ps1 (including decompressed size) and sign it
|
||||
|
||||
PRIVATE_KEY=/d/Secured/Akeo/Rufus/private.pem
|
||||
PUBLIC_KEY=/d/Secured/Akeo/Rufus/public.pem
|
||||
@@ -20,11 +20,17 @@ sign_file() {
|
||||
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
|
||||
echo
|
||||
# Confirm that the pass phrase is valid by trying to sign a dummy file
|
||||
openssl dgst -sha256 -sign $PRIVATE_KEY -passin pass:$PASSWORD $PUBLIC_KEY >/dev/null 2>&1 || { echo Invalid pass phrase; exit 1; }
|
||||
|
||||
find . -maxdepth 1 -name "*.ps1" | while read FILE; do sign_file; done
|
||||
lzma -kf Fido.ps1
|
||||
# The 'lzma' utility does not add the uncompressed size, so we must add it manually. And yes, this whole
|
||||
# gymkhana is what one must actually go through to insert a 64-bit little endian size into a binary file...
|
||||
printf "00: %016X" `stat -c "%s" Fido.ps1` | xxd -r | xxd -p -c1 | tac | xxd -p -r | dd of=Fido.ps1.lzma seek=5 bs=1 status=none conv=notrunc
|
||||
find . -maxdepth 1 -name "Fido.ps1.lzma" | while read FILE; do sign_file; done
|
||||
# Clear the PASSWORD variable just in case
|
||||
PASSWORD=`head -c 50 /dev/random | base64`
|
||||
|
Reference in New Issue
Block a user