OSDeploy / OSD

OSD Shared Functions
MIT License
130 stars 54 forks source link

Unable to download driver from Microsoft Update Catalog #127

Closed ankushsvc closed 3 months ago

ankushsvc commented 3 months ago

Describe the bug OSDCloud unable to download firmware updates and drivers from MS Update catalog.

To Reproduce Steps to reproduce the behavior: Image a device using OSDCloud with -firmware switch

Expected behavior It should download driver successfully

Screenshots

image
ankushsvc commented 3 months ago

2024-03-22-011807-Deploy-OSDCloud.log

AkosBakos commented 3 months ago

I think your issue ist either coz of this: 1

My workaround for this, are the following lines: Register-PSRepository -Default -Verbose Set-PSRepository -Name PSGallery -InstallationPolicy Trusted -Verbose Install-Module -Name MSCatalog -Force -Verbose -SkipPublisherCheck -AllowClobber -Repository PSGallery

Or if you use in the beginning iex (irm functions.osdcloud.com) Then you can use these one: osdcloud-TrustPSGallery -Verbose osdcloud-InstallPowerShellModule -Name 'MSCatalog'

ankushsvc commented 3 months ago

@AkosBakos I have tried your suggestion and OSDCloud is able to download firmware updates but still failing to download drivers from MS Catalog. 2024-03-22-043812-Deploy-OSDCloud.log

gwblok commented 3 months ago

@ankushsvc On your test computer, can you run

Save-MsUpCatDriver -DestinationDirectory c:\drivers\test

Is that working? I'm unable to reproduce the issue, so at this time, there isn't much I can do.

image image

gwblok commented 3 months ago

Couple of extra thoughts for ya @ankushsvc , If you're looking for a guaranteed way to apply drivers during WinPE stage, extract the driverpack into one of the 2 folders it checks on the USB drive. image

OSDCloud will then DISM that driver pack into the machine during WinPE.

If you want it to update the BIOS from WU during the process, you can also check the box to have it download Windows Update drivers during Setup Complete phase. It will reach out to WU and update any drivers (including BIOS) it finds.

AkosBakos commented 3 months ago

Maybe it's a Dell specific issue, even some settings doesn't correct in the BIOS? On my test Surface and Lenovo devices, the peocess is working.

ankushsvc commented 3 months ago

@gwblok Save-MsUpCatDriver does work in full windows but fails with terminating error in Windows PE. I won't able to download Windows Update drivers during Setup Complete phase as device won't be able to connect to network after restart. Issue is resolved now with help of my colleague. He made below changes in Invoke-CatalogRequest function and it works now in WinPE. Added a null check for ct100_catalogBody_updateMatches before invoking the MsUpCatResponse class. `if ($null -eq $NoResults) { $ErrorText = $HtmlDoc.GetElementbyId("errorPageDisplayedError") if ($ErrorText) { throw "The catalog.update.microsoft.com site has encountered an error. Please try again later." } else { if($HtmlDoc.GetElementbyId("ctl00_catalogBody_updateMatches") -eq $null){ return $null } else {

            }
        }
    } else {
        throw "$($NoResults.InnerText)$($Uri.Split("q=")[-1])"
    }`

Thanks @gwblok @AkosBakos

gwblok commented 3 months ago

I've made the change in GitHub https://github.com/OSDeploy/OSD/blob/master/Private/MSCatalog/Invoke-CatalogRequest.ps1

Added change to Release Notes 23.3.22

Changes go into effect the next module push.

NOTE, I haven't tested the changes yet, might be next week before I get around to testing.

gwblok commented 3 months ago

I believe this is all working as expected now. Closing Issue