Compare commits

...

8 Commits
v1.29 ... v1.35

Author SHA1 Message Date
Pete Batard
f8aacf0703 Add Windows 11 22H2 v1 builds
* "How many Microsoft engineers does it take to release the ISO of a light bulb?"
* This addresses #45 by restoring a working Windows 11 22H2 download, though it
  remains to be seen if the ISO for 22H2 v0 will be accessible ever again...
2022-10-01 13:59:42 +01:00
Pete Batard
24a7a04d78 Update README 2022-09-23 17:36:21 +01:00
Pete Batard
eefc2453c4 Fix handling of parentheses for -Lang option
* Closes #29
2022-09-23 17:02:36 +01:00
Pete Batard
ed1a6b31a6 Fix Add-Type warnings being treated as errors on PS < 7.0
* Closes pbatard/rufus#2030
2022-09-23 16:47:44 +01:00
Pete Batard
9beb231b78 Fix Windows 7 "Referer header" error
* Closes #44
* Also fix incorrect build number for Windows 11 22H2
2022-09-21 16:59:01 +01:00
Pete Batard
ce7cb583e5 Add Windows 11 22H2 builds 2022-09-20 22:57:29 +01:00
William Bulin
0287fe274e Fixed Windows 10/11 ISO downloads
* Closes #41
* Closes #42
2022-08-13 15:08:20 +01:00
Pete Batard
129e5d6f5c Disable Windows ISO downloads
* Per #41 Microsoft appear to have altered their website to make it hostile to our script.
* Considering that trying to troubleshoot this is likely to take a long while, and that I
  sure could use some help with it, add a notice about this whole mess...
2022-08-12 14:02:34 +01:00
2 changed files with 77 additions and 45 deletions

View File

@@ -1,5 +1,5 @@
#
# Fido v1.29 - Feature ISO Downloader, for retail Windows images and UEFI Shell
# Fido v1.35 - Feature ISO Downloader, for retail Windows images and UEFI Shell
# Copyright © 2019-2022 Pete Batard <pete@akeo.ie>
# Command line support: Copyright © 2021 flx5
# ConvertTo-ImageSource: Copyright © 2016 Chris Carter
@@ -80,11 +80,12 @@ $code = @"
if (!$Cmd) {
Write-Host Please Wait...
$Drawing_Assembly = "System.Drawing"
# PowerShell 7 altered the name of the Drawing assembly...
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
$Drawing_Assembly += ".Common"
}
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
# Hide the powershell window: https://stackoverflow.com/a/27992426/1069307
[Gui.Utils]::ShowWindow(([System.Diagnostics.Process]::GetCurrentProcess() | Get-Process).MainWindowHandle, 0) | Out-Null
@@ -97,6 +98,16 @@ $ko = 0x20000
$WindowsVersions = @(
@(
@("Windows 11", "windows11"),
@(
"22H2 v1 (Build 22621.525 - 2022.10)",
@("Windows 11 Home/Pro/Edu", 2370),
@("Windows 11 Home China ", ($zh + 2371))
),
@(
"22H2 (Build 22621.382 - 2022.09)",
@("Windows 11 Home/Pro/Edu", 2360),
@("Windows 11 Home China ", ($zh + 2361))
),
@(
"21H2 v1 (Build 22000.318 - 2021.11)",
@("Windows 11 Home/Pro/Edu", 2093),
@@ -110,6 +121,12 @@ $WindowsVersions = @(
),
@(
@("Windows 10", "Windows10ISO"),
# Not yet enabled by Microsoft...
# @(
# "22H2 (Build 1904?.???? - 2022.10)",
# @("Windows 10 Home/Pro/Edu", 2377),
# @("Windows 10 Home China ", ($zh + 2378))
# ),
@(
"21H2 (Build 19044.1288 - 2021.11)",
@("Windows 10 Home/Pro/Edu", 2084),
@@ -582,7 +599,7 @@ $RequestData = @{}
# This GUID applies to all visitors, regardless of their locale
$RequestData["GetLangs"] = @("a8f8f489-4c7f-463a-9ca6-5cff94d8d041", "getskuinformationbyproductedition" )
# This GUID applies to visitors of the en-US download page. Other locales may get a different GUID.
$RequestData["GetLinks"] = @("a224afab-2097-4dfa-a2ba-463eb191a285", "GetProductDownloadLinksBySku" )
$RequestData["GetLinks"] = @("6e2a1789-ef16-4f27-a296-74ef7ef5d96b", "GetProductDownloadLinksBySku" )
# Create a semi-random Linux User-Agent string
$FirefoxVersion = Get-Random -Minimum 50 -Maximum 90
$FirefoxDate = Get-RandomDate
@@ -793,7 +810,18 @@ function Get-Windows-Download-Links([int]$SelectedVersion, [int]$SelectedRelease
try {
$Is64 = [Environment]::Is64BitOperatingSystem
$r = Invoke-WebRequest -Method Post -UseBasicParsing -UserAgent $UserAgent -WebSession $Session $url
# Must add a referer for POST requests, else Microsoft's servers will deny them
$ref = "https://www.microsoft.com/software-download/windows11"
$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") {
Throw-Error -Req $r -Alt "Could not retrieve architectures from server"
}
@@ -944,6 +972,10 @@ if ($Cmd) {
}
if ($Lang -eq "List") {
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
foreach ($language in $languages) {
@@ -960,7 +992,7 @@ if ($Cmd) {
}
$i++
}
if ($winLanguageId -eq $null -or $winLanguageName -eq $null) {
if (!$winLanguageId -or !$winLanguageName) {
if ($Lang -ne "List") {
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."
@@ -1156,8 +1188,8 @@ exit $ExitCode
# SIG # Begin signature block
# MIIkWQYJKoZIhvcNAQcCo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Q0QCnU+CU8tW3GnAu28whQHk/X
# 5Fs4jRIaxmBSrDspa3yGsrlqjUpmsF6tA5UEQi+fA5JmvVq6CpiUaXf9JGLQgfGz
# zt8XVyLcXJEXMS1lA54z8R8XiJzrT9bOoHZxwSlRZswDAosfe3PAWbS9sKnatYCX
# LgWGsxXn040/9cei5szi4Z4ltGUYI7gdNTYafRS/mCRbgfITpfzlpAzk07II
# SIG # End signature block

View File

@@ -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
============================================================================
[![Licence](https://img.shields.io/badge/license-GPLv3-blue.svg?style=flat-square)](https://www.gnu.org/licenses/gpl-3.0.en.html)
[![Github stats](https://img.shields.io/github/downloads/pbatard/Fido/total.svg?style=flat-square)](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
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
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).
for Windows 8 through Windows 11), up until recent releases, most of these links were only available after forcing users
to jump through a lot of unwarranted hoops that created an exceedingly counterproductive, if not downright unfriendly,
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
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
------------
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):
The script basically performs the same operation as one might perform when visiting the following URL (that is, in the
case of Windows 10, provided that you have also changed your `User-Agent` browser string, since, the Microsoft web
servers detect that you are using a version of Windows that is the same as the one you are trying to download, they
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
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
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
------------