Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URLs in IntelWirelessDriverPack.json Offline Catalog file and Get-IntelWirelessDriverPack functions are outdated #101

Closed
christiandekker opened this issue Dec 27, 2023 · 13 comments
Assignees

Comments

@christiandekker
Copy link

Describe the bug
In the OSD PowerShell module, the Catalogs\IntelWirelessDriverPack.json file contains broken links for all DriverUrls. When trying to update the Offline Catalog using the -UpdateModuleCatalog parameter of the Get-IntelWirelessDriverPack cmdlet, the cmdlet reverts to the offline version of the cmdlet, because the $DriverUrl variable in the function contains a broken link (https://www.intel.com/content/www/us/en/support/articles/000017246/network-and-i-o/wireless-networking.html) .

To Reproduce
The issue described above causes a failure when OSDCloud is trying to download drivers for WinPE during execution of the Edit-OSDCloudWinPE cmdlet when the parameter -CloudDriver is used.

Expected behavior
The (latest) Intel Wireless Drivers should be downloaded.

Screenshots

PS C:\Users\ChristianDekkerLemon> Get-IntelWirelessDriverPack -Online -Verbose
VERBOSE: Test-WebConnection OK:
https://www.intel.com/content/www/us/en/support/articles/000017246/network-and-i-o/wireless-networking.html
VERBOSE: HEAD with 0-byte payload
VERBOSE: Test-WebConnection FAIL:
https://www.intel.com/content/www/us/en/support/articles/000017246/network-and-i-o/wireless-networking.html
VERBOSE: Catalog is running Offline

Information:

  • OSD PowerShell Module Version: 23.12.13.1
@skyblaster
Copy link
Contributor

Also, I highly recommend the latest driver (23.10.0.8) as it fixes WPA3 in the 9560 chipset.
Shoutout to #69

@gwblok
Copy link
Collaborator

gwblok commented Jan 2, 2024

So Intel's site changed and it now blocks using Invoke-WebRequest to pull back information. I've completely changed the process for getting Intel WiFi Drivers, while it's working in dev, I haven't done any formal testing. Hopefully next week I'll get around to it.

Changes are posted in GitHub, and will be active the next time the module is released.
You can look at the updated offline catalog here: https://github.com/OSDeploy/OSD/blob/master/Catalogs/IntelWirelessDriverPack.json

@gwblok
Copy link
Collaborator

gwblok commented Jan 11, 2024

This should be resolved, if @skyblaster and @christiandekker could confirm, that would be great.

@skyblaster
Copy link
Contributor

I haven't actually used Wi-Fi in OSD for quite some time, so I'll defer to @christiandekker
I can tell you however that there is an even newer driver (23.20.0.4) as of two days ago.

@christiandekker
Copy link
Author

christiandekker commented Jan 11, 2024

Hi @gwblok,

I'm getting an error, because of an empty variable $GitHubFolder in Get-IntelWirelessDriverPack.ps1:

Get-Content : Cannot find path 'C:\OSD\Catalogs\IntelWirelessDriverPack.json' because it does not exist. At C:\Users\ChristianDekkerLemon\OneDrive - Lemontree B.V\Documenten\WindowsPowerShell\Modules\OSD\24.1.3.1\Public\Functions\Catalogs\Intel\Get-IntelWirelessDriverPack.ps1:73 char:29

I think line 71 needs to be uncommented and line 72 commented :)

@gwblok
Copy link
Collaborator

gwblok commented Jan 11, 2024

thank @christiandekker
That was my bad, I had changed a line to test on my test machine, and forgot to comment it out and put the original line back in.
I've updated github, so it should be resolved next module update, or if you manually edit that file.

@christiandekker
Copy link
Author

@gwblok

Update:
After uncommenting line 71 and commenting line 72 it's still not working, because IntelWirelessDriverPack.json still seems outdated :
Intel Wireless Driver Pack [23.10.0] https://downloadmirror.intel.com/794468/WiFi-23.10.0-Driver64-Win10-Win11.zip WARNING: Unable to connect to https://downloadmirror.intel.com/794468/WiFi-23.10.0-Driver64-Win10-Win11.zip

Running Get-IntelWirelessDriverPack -UpdateModuleCatalog doesn't seem to update the IntelWirelessDriverPack.json catalog file

@gwblok
Copy link
Collaborator

gwblok commented Jan 11, 2024

I wonder why it didn't work for you...
I just edit that file quick, then ran the command

image

Note, I updated the JSON catalog on GitHub as well.

@christiandekker
Copy link
Author

christiandekker commented Jan 11, 2024

My bad. It just seems like the file https://downloadmirror.intel.com/812774/WiFi-23.20.0-Driver64-Win10-Win11.zip does not exist. File https://downloadmirror.intel.com/812774/WiFi-23.20.0-Driver64-Win10-Win11.exe does exist.

software-configurations.json contains just the .exe filename, but I'm assuming the .zip files were there in your testing, since the rename from .exe to .zip seems to be deliberate ($WiFiZipURL = $WiFiURL.replace(".exe",".zip"))?
Apparently Intel doesn't provide a ZIP anymore on this URL?

The correct URL for the ZIP file is https://downloadmirror.intel.com/812775/WiFi-23.20.0-Driver64-Win10-Win11.zip in this case, the difference being 812774 vs 812775 in the URL. Wondering if there's any logic to the numbering here.

@gwblok
Copy link
Collaborator

gwblok commented Jan 12, 2024

oh man, last release the URLs were identical for the .exe & the .zip
for rest of the process to work without extra changes, we needed to download a zip file. I was really hoping that Intel kept their URLs the same (exe & zip).

I will have to add some extra error handling into the function to double check the .zip URL.
Otherwise I'll have to see if there is a way to extract the exe without installing.

If you have any ideas, let me know. This is a back burner item for me at the moment. Appreciate your testing.

@christiandekker
Copy link
Author

I've created some sample code that might be an idea to help determine the correct URL.
Basically it will test multiple URLs:

  • The original URL
  • The original URL with the catalog number increased by 1

I'm just not sure how to handle the situation where no valid URL can be found without rewriting bigger parts of the function.
I think this should be a terminating event for the function, but I can't assess the impact this might have in other parts of the OSD module

`

$WiFiZipURL = $WiFiURL.replace('.exe', '.zip')

# Retrieve the Catalog number from the Download URL
$WiFiZipURLCatalogNumber = ([int]($WiFiZipURL.Split('/') | Select-Object -Last 1 -Skip 1))

# Generate array of multiple URLs to try
# - Original $WiFiZipURL
# - Original $WiFiZipURL with the catalog number increased by 1
$WiFiZipURLs = @(
    $WiFiZipURL,
    ($WiFiZipURL -replace $WiFiZipURLCatalogNumber, ($WiFiZipURLCatalogNumber + 1))
)

# Test if one of the $WiFiZipURLs exists
$WiFiZipURLExists = $false
foreach ($WiFiZipURL in $WiFiZipURLs)
{
    try
    {
        $WiFiZipURLWebRequest = Invoke-WebRequest -Uri $WiFiZipURL -Method Head -ErrorAction Stop
        if($WiFiZipURLWebRequest.StatusCode -eq 200)
        {
            $WiFiZipURLExists = $true
            break
        }
    }
    catch
    {
        # Tested URL does not exist
    }
}

if($WiFiZipURLExists -eq $false)
{
    Write-Error -Message ('Unable to retrieve a valid Intel Wireless Driver Pack Download URL')
    Exit
}

`

@gwblok
Copy link
Collaborator

gwblok commented Jan 17, 2024

Thanks for the code, I've incorporated it for now and I've updated the catalog, so at least the offline catalog has the correct URL for now. If you want to use these updates, you'll just want to overwrite these two files in your module.

Really appreciate your help on this.

Now I just need to find time to test it out when building a WinRM boot media.

@gwblok gwblok self-assigned this Jan 23, 2024
@gwblok
Copy link
Collaborator

gwblok commented Feb 15, 2024

I haven't had time to test this, but if anyone has issues, please re-open

@gwblok gwblok closed this as completed Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants