Compare commits

...

3 Commits
v1.17 ... v1.18

Author SHA1 Message Date
Pete Batard
ee0393cb74 Update version and copyright year 2021-01-30 02:55:42 +00:00
isos4all
a8abb94a16 Add Windows 10 20H2 19042.631 builds
* Microsoft updated 20H2 in December. Make sure we enable those downloads too.
* Closes #21
2021-01-30 02:53:59 +00:00
Pete Batard
15a48fe24f Fix script failure with PowerShell 7.x
* Won't help though, since Microsoft forcibly removed the ability to
  parse HTML in newer PowerShell, which we need...
* Also fix session variable not being set.
* Closes #19
2020-11-16 17:26:11 +00:00

View File

@@ -1,6 +1,6 @@
# #
# Fido v1.17 - Retail Windows ISO Downloader # Fido v1.18 - Retail Windows ISO Downloader
# Copyright © 2019-2020 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
@@ -63,7 +63,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 -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 +79,12 @@ $ko = 0x20000
$WindowsVersions = @( $WindowsVersions = @(
@( @(
@("Windows 10", "Windows10ISO"), @("Windows 10", "Windows10ISO"),
@(
"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)", "20H2 (Build 19042.508 - 2020.10)",
@("Windows 10 Home/Pro", 1807), @("Windows 10 Home/Pro", 1807),
@@ -582,10 +592,14 @@ $Continue.add_click({
$i = 0 $i = 0
$SelectedIndex = 0 $SelectedIndex = 0
try { try {
$r = Invoke-WebRequest -UserAgent $UserAgent -WebSession $Session $url $r = Invoke-WebRequest -UserAgent $UserAgent -SessionVariable "Session" $url
# Go through an XML conversion to keep all PowerShells happy... # Go through an XML conversion to keep all PowerShells happy...
if (-not $($r.AllElements | ? {$_.id -eq "product-languages"})) { if (-not $($r.AllElements | ? {$_.id -eq "product-languages"})) {
throw "Unexpected server response" if ($host.version -ge "7.0") {
throw "This PowerShell version can not parse HTML"
} else {
throw "Unexpected server response"
}
} }
$html = $($r.AllElements | ? {$_.id -eq "product-languages"}).InnerHTML $html = $($r.AllElements | ? {$_.id -eq "product-languages"}).InnerHTML
$html = $html.Replace("selected value", "value") $html = $html.Replace("selected value", "value")