flcdrg / au-packages

David's Chocolatey Automatic Packages
MIT License
18 stars 52 forks source link

[lenovo-thinkvantage-system-update] More reliable version detection for Lenovo-System-Update #158

Closed SebastianK90 closed 8 months ago

SebastianK90 commented 8 months ago

Hello,

I have a suggestion for improving the update.ps1 Perhaps you can better recognize the version in the long term with the following changes?

$response = Invoke-WebRequest -Uri "https://support.lenovo.com/us/en/downloads/ds012808-lenovo-system-update-for-windows-10-7-32-bit-64-bit-desktop-notebook-workstation" -UseBasicParsing
$pattern = '(?<="Name":"Lenovo\ System\ Update")[\S\s]*,"Version":"(?<Version>[\d\.]+)'
$version = [regex]::Match($response.Content, $pattern).groups['Version'].value

Thanks!

flcdrg commented 8 months ago

I might add that as a fallback. I'd prefer to stick with the "official" data feed, but it's weird even Lenovo seem to have stopped using it (in that the feed hasn't been updated to point to the newer version, and using Fiddler I can see even the new version is still querying the same feed)

flcdrg commented 8 months ago

Thanks for your help!