mirror of
https://github.com/pbatard/Fido.git
synced 2025-09-16 14:18:02 +02:00
Remove DisableFirstRunCustomize related options
* No longer needed, since we are not invoking IE behind the scenes any more. * Also update "fake" Firefox version range.
This commit is contained in:
30
Fido.ps1
30
Fido.ps1
@@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Fido v1.18 - Retail Windows ISO Downloader
|
# Fido v1.19 - Retail Windows ISO Downloader
|
||||||
# Copyright © 2019-2021 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
|
||||||
#
|
#
|
||||||
@@ -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
|
||||||
|
|
||||||
@@ -447,14 +443,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
|
||||||
@@ -485,20 +478,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 }
|
||||||
@@ -742,7 +721,4 @@ $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
|
||||||
|
11
README.md
11
README.md
@@ -58,17 +58,12 @@ for all the architectures available for that specific combination of version + l
|
|||||||
Requirements
|
Requirements
|
||||||
------------
|
------------
|
||||||
|
|
||||||
PowerShell 3.0 or later is required. However the script will detect if you are using an older version and point you to
|
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
|
the relevant PowerShell 3.0 download page if needed (which should only ever occur if you are running a vanilla version
|
||||||
of Windows 7).
|
of Windows 7).
|
||||||
|
|
||||||
Also, because Internet Explorer is being invoked 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 this when running the script. If that is the case, then you should
|
PowerShell 7.
|
||||||
make sure that you manually launch IE at least once and complete the setup.
|
|
||||||
|
|
||||||
Note however that, if you are running the script elevated, you can work around the above annoyance by using the
|
|
||||||
`-DisableFirstRunCustomize` option which basically __temporarily__ creates a key of the same name in the registry __if__
|
|
||||||
it doesn't already exist, to bypass the first time setup error.
|
|
||||||
|
|
||||||
Additional Notes
|
Additional Notes
|
||||||
----------------
|
----------------
|
||||||
|
Reference in New Issue
Block a user