Git Product home page Git Product logo

drivertool's People

Contributors

trondr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

drivertool's Issues

Ignore incorrect sha256 checksum for xml files downloaded from Lenovo web site.

It seems Lenovo do not provide correct SHA256 code for all downloaded update infos. Example:

|DriverTool |2019-01-16 21:03:00,143|ERROR|System.Exception: Failed to download all package infos due to the following 1 error messages:
Destination file ('C:\Temp\DriverToolCache\n20pb05w_2_.xml') hash does not match source file ('https://download.lenovo.com/pccbbs/mobiles/n20pb05w_2_.xml') hash. Additionally the file is not trusted (not signed or signature has been invalidated.)

The SHA256 checksum for n20pb05w_2_.xml do not correspond to the checksum in: https://download.lenovo.com/catalog/20L6_WIN10.xml

It has also been seen that the checksum for txt files and exe files is also sometimes incorrect. For exe files this has been worked around by checking if the exe file is signed. If the exe file is signed the incorrect checksum is ignored. For txt files a warning is displayed before continuing.

Now also xml files with update info shows infrequent incorrect checksum. Suggest solution is to ignore checksum for xml files, same as for txt files.

Failed to initialize configuration file watcher

The following command:

DriverTool.exe CreateDriverPackage /destinationFolder="c:\temp\DriverPackages" /packagePublisher="MyCompany" /baseOnLocallyInstalledUpdates="False"

...results in the following error message causing logging to fail.

log4net:ERROR Failed to initialize configuration file watcher for file [E:\Dev\github.trondr\DriverTool\src\app\DriverTool\App.config]
System.ArgumentException: The directory name E:\Dev\github.trondr\DriverTool\src\app\DriverTool is invalid.
at System.IO.FileSystemWatcher.set_Path(String value)
at log4net.Config.XmlConfigurator.ConfigureAndWatchHandler..ctor(ILoggerRepository repository, FileInfo configFile)
at log4net.Config.XmlConfigurator.InternalConfigureAndWatch(ILoggerRepository repository, FileInfo configFile)

Missing update sp96016 on HP G6 - DriverTool does not seem to include sp96016

<sdp:SoftwareDistributionPackage xmlns:bar="http://schemas.microsoft.com/wsus/2005/04/CorporatePublishing/BaseApplicabilityRules.xsd" xmlns:bt="http://schemas.microsoft.com/wsus/2005/04/CorporatePublishing/BaseTypes.xsd" xmlns:cmd="http://schemas.microsoft.com/wsus/2005/04/CorporatePublishing/Installers/CommandLineInstallation.xsd" xmlns:lar="http://schemas.microsoft.com/wsus/2005/04/CorporatePublishing/LogicalApplicabilityRules.xsd" xmlns:msi="http://schemas.microsoft.com/wsus/2005/04/CorporatePublishing/Installers/MsiInstallation.xsd" xmlns:msiar="http://schemas.microsoft.com/wsus/2005/04/CorporatePublishing/MsiApplicabilityRules.xsd" xmlns:msp="http://schemas.microsoft.com/wsus/2005/04/CorporatePublishing/Installers/MspInstallation.xsd" xmlns:uei="http://schemas.microsoft.com/wsus/2005/04/CorporatePublishing/Installers/UpdateExeInstallation.xsd" xmlns:usp="http://schemas.microsoft.com/wsus/2005/04/CorporatePublishing/UpdateServicesPackage.xsd" xmlns:drv="http://schemas.microsoft.com/wsus/2005/04/CorporatePublishing/Installers/WindowsDriver.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SchemaVersion="1.2" xmlns:sdp="http://schemas.microsoft.com/wsus/2005/04/CorporatePublishing/SoftwareDistributionPackage.xsd">
<sdp:Properties PackageID="00004850-0000-0000-5350-000000096016" CreationDate="2019-08-26T23:30:19" VendorName="HP Business Clients">
sdp:MoreInfoUrlhttp://www.hp.com/support</sdp:MoreInfoUrl>
sdp:SupportUrlhttps://www.hp.com/support</sdp:SupportUrl>
sdp:ProductNameSoftware</sdp:ProductName>
</sdp:Properties>
sdp:LocalizedProperties
sdp:Languageen</sdp:Language>
sdp:TitleHP Hotkey Support - UWP [7.0.13.0.A1]</sdp:Title>
sdp:Description[7.0.13.0.A1] The HP HotKey Support (HPHKS) software provides the support for handling the Hotkeys and bezel or cap-sense buttons (fixed notebook buttons that provide quick access to a particular function when pressed) for HP's business notebooks.</sdp:Description>
</sdp:LocalizedProperties>
<sdp:UpdateSpecificData MsrcSeverity="Important" UpdateClassification="Updates">
sdp:KBArticleIDsp96016</sdp:KBArticleID>
</sdp:UpdateSpecificData>
sdp:IsInstallable
lar:And
<bar:WmiQuery Namespace="Root\cimv2" WqlQuery="select * from Win32_ComputerSystem where (Manufacturer='Hewlett-Packard' and not (Model like '%Proliant%')) or (Manufacturer='HP') " />
lar:Or
lar:And
<bar:Processor Architecture="9" />
<bar:WindowsVersion Comparison="EqualTo" MajorVersion="10" MinorVersion="0" />
<bar:RegSz Key="HKEY_LOCAL_MACHINE" Subkey="Software\Microsoft\Windows NT\CurrentVersion" Value="ReleaseId" Comparison="EqualTo" Data="1903" />
</lar:And>
lar:And
<bar:Processor Architecture="9" />
<bar:WindowsVersion Comparison="EqualTo" MajorVersion="10" MinorVersion="0" />
<bar:RegSz Key="HKEY_LOCAL_MACHINE" Subkey="Software\Microsoft\Windows NT\CurrentVersion" Value="ReleaseId" Comparison="EqualTo" Data="1803" />
</lar:And>
lar:And
<bar:Processor Architecture="9" />
<bar:WindowsVersion Comparison="EqualTo" MajorVersion="10" MinorVersion="0" />
<bar:RegSz Key="HKEY_LOCAL_MACHINE" Subkey="Software\Microsoft\Windows NT\CurrentVersion" Value="ReleaseId" Comparison="EqualTo" Data="1809" />
</lar:And>
</lar:Or>
</lar:And>
</sdp:IsInstallable>
<sdp:InstallableItem ID="00004850-0000-0001-5350-000000096016">
sdp:ApplicabilityRules
sdp:IsInstalled
lar:And
<bar:WmiQuery Namespace="Root\cimv2" WqlQuery="select * from Win32_BaseBoard where Product LIKE '%8524%' or Product LIKE '%853d%' or Product LIKE '%8549%' or Product LIKE '%854a%' or Product LIKE '%856d%' or Product LIKE '%856e%' or Product LIKE '%860c%' or Product LIKE '%860f%' or Product LIKE '%8655%'" />
<bar:WmiQuery Namespace="Root\cimv2" WqlQuery="select * from Win32_PnpEntity where DeviceID LIKE '%ACPI\HPQ8002%'" />
lar:Or
lar:And
<bar:Processor Architecture="9" />
<bar:WindowsVersion Comparison="EqualTo" MajorVersion="10" MinorVersion="0" />
<bar:RegSz Key="HKEY_LOCAL_MACHINE" Subkey="Software\Microsoft\Windows NT\CurrentVersion" Value="ReleaseId" Comparison="EqualTo" Data="1803" />
<bar:FileVersion Csidl="37" Path="drivers\HpqKbFiltr.sys" Comparison="GreaterThanOrEqualTo" Version="11.0.7.1" />
</lar:And>
lar:And
<bar:Processor Architecture="9" />
<bar:WindowsVersion Comparison="EqualTo" MajorVersion="10" MinorVersion="0" />
<bar:RegSz Key="HKEY_LOCAL_MACHINE" Subkey="Software\Microsoft\Windows NT\CurrentVersion" Value="ReleaseId" Comparison="EqualTo" Data="1809" />
<bar:FileVersion Csidl="37" Path="drivers\HpqKbFiltr.sys" Comparison="GreaterThanOrEqualTo" Version="11.0.7.1" />
</lar:And>
lar:And
<bar:Processor Architecture="9" />
<bar:WindowsVersion Comparison="EqualTo" MajorVersion="10" MinorVersion="0" />
<bar:RegSz Key="HKEY_LOCAL_MACHINE" Subkey="Software\Microsoft\Windows NT\CurrentVersion" Value="ReleaseId" Comparison="EqualTo" Data="1903" />
<bar:FileVersion Csidl="37" Path="drivers\HpqKbFiltr.sys" Comparison="GreaterThanOrEqualTo" Version="11.0.7.1" />
</lar:And>
</lar:Or>
</lar:And>
</sdp:IsInstalled>
sdp:IsInstallable
lar:And
<bar:WindowsVersion Comparison="GreaterThanOrEqualTo" MajorVersion="4" />
<bar:WmiQuery Namespace="Root\cimv2" WqlQuery="select * from Win32_BaseBoard where Product LIKE '%8524%' or Product LIKE '%853d%' or Product LIKE '%8549%' or Product LIKE '%854a%' or Product LIKE '%856d%' or Product LIKE '%856e%' or Product LIKE '%860c%' or Product LIKE '%860f%' or Product LIKE '%8655%'" />
<bar:WmiQuery Namespace="Root\cimv2" WqlQuery="select * from Win32_PnpEntity where DeviceID LIKE '%ACPI\HPQ8002%'" />
</lar:And>
</sdp:IsInstallable>
</sdp:ApplicabilityRules>
<sdp:InstallProperties CanRequestUserInput="false" Impact="Normal" RequiresNetworkConnectivity="false" RebootBehavior="AlwaysRequiresReboot" />
<cmd:CommandLineInstallerData Program="sp96016.exe" Arguments="-s -e cmd.exe -a /c Setup.exe" DefaultResult="Failed" RebootByDefault="false">
<cmd:ReturnCode Code="1631" Result="Failed" Reboot="false" />
<cmd:ReturnCode Code="1604" Result="Failed" Reboot="false" />
<cmd:ReturnCode Code="1619" Result="Failed" Reboot="false" />
<cmd:ReturnCode Code="1641" Result="Succeeded" Reboot="false" />
<cmd:ReturnCode Code="0" Result="Succeeded" Reboot="true" />
<cmd:ReturnCode Code="1601" Result="Failed" Reboot="false" />
<cmd:ReturnCode Code="1624" Result="Failed" Reboot="false" />
<cmd:ReturnCode Code="1633" Result="Failed" Reboot="false" />
<cmd:ReturnCode Code="259" Result="Failed" Reboot="false" />
<cmd:ReturnCode Code="1620" Result="Failed" Reboot="false" />
<cmd:ReturnCode Code="1622" Result="Failed" Reboot="false" />
<cmd:ReturnCode Code="3010" Result="Succeeded" Reboot="true" />
<cmd:ReturnCode Code="1639" Result="Failed" Reboot="false" />
<cmd:ReturnCode Code="1612" Result="Failed" Reboot="false" />
<cmd:ReturnCode Code="87" Result="Failed" Reboot="false" />
<cmd:ReturnCode Code="1621" Result="Failed" Reboot="false" />
<cmd:ReturnCode Code="1603" Result="Failed" Reboot="false" />
<cmd:ReturnCode Code="1623" Result="Failed" Reboot="false" />
<cmd:ReturnCode Code="1632" Result="Failed" Reboot="false" />
<cmd:ReturnCode Code="13" Result="Failed" Reboot="false" />
<cmd:ReturnCode Code="1613" Result="Failed" Reboot="false" />
</cmd:CommandLineInstallerData>
<sdp:OriginFile Digest="p1y8pW/+xdTPndibxlh7eh7EBDM=" FileName="sp96016.exe" Size="8788160" Modified="2019-06-14T10:25:02" OriginUri="https://ftp.hp.com/pub/softpaq/sp96001-96500/sp96016.exe" />
</sdp:InstallableItem>
</sdp:SoftwareDistributionPackage>

Lenovo: Update extracted from nz3gs05w.exe fails

Some lenovo upates use the orginal update exe when installing even if an extract command line is provided. Solution would in this specific case be to make sure nz3gs05w.exe is copied to the update folder instead of extracting the update.

DriverTool.exe missing from package.

The Script\DriverTool folder of a package is missing DriverTool.exe when using the PowerShell module to create the package.

Reproduced with:
$models = @("10RS")
$models | Foreach-Object{ Write-Host "Getting driver updates for model $"; Get-DtDriverUpdates -Manufacturer Lenovo -ModelCode "$" -OperatingSystem "WIN10X64" -OsBuild "21H2" -ExcludeDriverUpdates @("BIOS","Firmware") -Verbose } | Invoke-DtDownloadDriverUpdates

Workaround: Copy DriverTool.exe and DriverTool.exe.config manually from powershell module. Example:
copy "C:\Program Files\WindowsPowerShell\Modules\DriverTool.PowerCLI\1.0.22023\internal\tools\DriverTool\DriverTool.exe" "C:\temp\DU\10RS\2021-11-12-1.0\Script\DriverTool\DriverTool.exe"
copy "C:\Program Files\WindowsPowerShell\Modules\DriverTool.PowerCLI\1.0.22023\internal\tools\DriverTool\DriverTool.exe.config" "C:\temp\DU\10RS\2021-11-12-1.0\Script\DriverTool\DriverTool.exe.config"

Issue with long paths due to long category names - Lenovo Driver Updates

Consider truncating category names to reduce the total path length and reduce risk of long path issues when extracting driver updates.

Example from 10RS_WIN10X64.xml
Motherboard Devices core chipset onboard video PCIe switches
Graphics Processing Units and Server AI Accelerators

[...]

<package>
    <location>https://download.lenovo.com/pccbbs/thinkcentre_drivers/u2chp38us14_2_.xml</location>
    <category>Motherboard Devices core chipset onboard video PCIe switches</category>
    <oslangs></oslangs>
    <checksum type="sha256">8f1fad73936ddeb125f1478c2a683db8965ae32c82e2ee696d60c34a6b4a3f14</checksum>
  </package>
  <package>
    <location>https://download.lenovo.com/pccbbs/desktop/k2vd149us14_2_.xml</location>
    <category>Graphics Processing Units and Server AI Accelerators</category>
    <oslangs></oslangs>
    <checksum type="sha256">abda26c88982ac2c7a3d456ef87e5e959c12989f234aabdd85b0c1a32fec3015</checksum>
  </package>

[...]

Failed to load html document sp99398.html - invalid html

DriverTool stops when trying to load "more info" html for update sp99398.

Error message: Failed to load html document 'Path "C:\Temp\DriverToolCache\sp99398.html"'. Invalid html.

Taking a look at the 00004850-0000-0000-5350-000000099398.sdp found in the HpCatalogForSms.latest the "more info" source is:

https://ftp.hp.com/pub/softpaq/sp99001-99500/sp99398.html

When trying to download this html document manually from the web site, the error code "404 Not found" is returned. It seems the root cause is that the html document do not exist on the web server and cause an invalid html to be created in the cache?

Incorrect meta data in Lenovo X1 Yoga 4th update catalog cause DriverTool to crash

The catalog incorrectly reference the readme file instead of the update xml:

image

This cause DriverTool to crash.

To workaround this (until Lenovo fixes the issue) it should be possible to use a cached version of the xml that can manually be corrected.

Suggestion:
After downloading the update catalog to the cache and the error occurs:

  1. Correct the error in the file: %DriverToolCache%\20QG_win10.xml
  2. Create an empty file with the same name as the original but with a ".usecachedversion" extension: %DriverToolCache%\20QG_win10.xml.usecachedversion
    This should indicate to DriverTool to not re-download the update catalog but use allready existing file which has been corrected.

Sccm package is not extracted.

Seems that issue is caused by paths longer than 256 characters. Will try to do the extract to a folder with shorter path.

Implement PowerShell CmdLets creating driver update task sequence from a list of model codes.

Implement PowerShell CmdLets creating task sequence with driver update packages from a list of model codes.

Proposed workflow:

@("20QW","20QF") | Foreach-Object{ Write-Host "Getting driver updates for model $"; Get-DtDriverUpdates -Manufacturer Lenovo -ModelCode "$" -OperatingSystem "win10" -OsBuild "21H2" -Verbose } | Invoke-DtDownloadDriverUpdates

#Move packages manually to server in the same folder structure (Z:\Packages\DriverUpdates\21H2) and run to create driver update packages:
$packageDefintionSms = Get-ChildItem -Path "Z:\Packages\DriverUpdates\21H2" -Filter "PackageDefinition.sms" -Recurse | ForEach-Object {$_.FullName}
$packageDefintionSms | New-DtCmPackageFromDriverUpdatePackageDefinitionSms

#Create task sequence in Sccm:
$packageDefintionSms = Get-ChildItem -Path "Z:\Packages\DriverUpdates\21H2" -Filter "PackageDefinition.sms" -Recurse | ForEach-Object {$_.FullName}
New-DtCmTaskSequenceFromDriverUpdatePackageDefinitionSms -Path $packageDefintionSms -Name "Test CM Drivers 21H2" -Description "Test CM Drivers 21H2" -ProgramNameStage1 "INSTALL-STAGE1" -ProgramNameStage2="INSTALL-STAGE2"

DriverTool could as an improvement provide a user interface automating download and packaging of CM Device Drivers.

DriverTool could as an improvement provide a user interface automating download and packaging of CM Device Drivers. This step can be done separate from download and packaging of Driver Updates and will not require the actual model to be present and online upfront. This will simplify the procedure of preparing a new model for OSD to the following.

  1. Download and create CM Device Driver package for one or more specified PC models
  2. Import CM Device Drivers package into SCCM.
  3. Add the driver package to the task sequence (Windows PE phase).
  4. Install the PC model using the task sequence.
  5. Log in locally or remotely and create Driver Updates package (following DriverTool procedure). Alternatively run vendor update utility in silent mode to update the drivers directly from the vendor web site. A silent mode update directly from vendor web site works well for HP and Dell but Lenovo does not provide a silent mode for BIOS and firmware updates.

Add support for manual download of Sccm Package

If Lenovo changes the design of the sccm package download page there is a high risk of DriverTool failing to find the Sccm Package.

For this reason it should be possible to workaround this issue by manually downloading the sccm package and providing it to DriverTool for further processing.

Proposal: Add command line switches. Example: /DoNotDownloadSccmPackage="True" /SccmPackageInstaller="tp_x1carbon_mt20qd-20qe-x1yoga_mt20qf-20qg_w1064_1809_201910.exe" /SccmPackageReadme="tp_x1carbon_mt20qd-20qe-x1yoga_mt20qf-20qg_w1064_1809_201910.txt"

Both files should be manually downloaded to the DriverToolCache (Example: C:\Temp\DriverToolCache)

Bug in manufacturer wmi query in PackageDefinition.sms

When creating package defintion sms the manufacturer wmi query should use "like" instead of "="

select BaseBoardManufacturer from MS_SystemInformation where BaseBoardManufacturer = 'Lenovo%'

should be changed to

select BaseBoardManufacturer from MS_SystemInformation where BaseBoardManufacturer like 'Lenovo%'

Delegate all 32 bit bound operations to a separate 32 bit process

Currently DriverTool.exe is running in 32bit during CreatePackage phase and is converted to 64 bit when run in Install phase due to 3 party components (Lenovo) requiring 32 bit during create package phase.

A hack was implemented in sdpeval to workaround the 32 bit limitation but as a permanent fix it is required that DriverTool is run in 64 bit in all phases. Any required 32 bit bound operations should therefore be delegated to a separate 32 bit process using remoting.

DriverTool PowerShell module (DriverToolPowerCli)

Create a DriverTool PowerShell module to expose DriverTool functionality as PowerShell CmdLets. This should improve user experience (intellisence and documentation) and enable more advanced task automation.

Proposal:

Module Name: DriverToolPowerCli
Command Prefix: Dt
Example: Get-DtDriverUpdate -Vendor "Lenovo" -Model "20EQ" -Os "Win10" -OsBuild "20H2"

Log warning message is incorrect

The log message is a function definition instead of a string message:

|CreateDriverPackage |2019-10-27 11:19:40,086|WARN |DriverTool.Web+verifyDownloadBase@126-2

Change default output folder from ...drivers-<releasedate> to <relasedate>-1.0\Install

If the drivers or updates must be installed in phases with a restart between each install phase it would be natural to make a copy of the original package and make necessary adjustments to the original and new package.

Each install phase should be a separate package but located in the same folder as the original package. The output folder should therefore be changed from "...%modelcode%-Drivers%release date%" to "%modelcode%%releasedate%-1.0\Script". Example:

...\20QGS2AA00\2019-10-21-1.0\DISM <- Package that inserts the Sccm Drivers into the OS in the Windows PE Phase
...\20QGS2AA00\2019-10-21-1.0\Script-Graphics <- Package that only installs graphics drivers
...\20QGS2AA00\2019-10-21-1.0\Script <- Orginal "Install" package without the Sccm drivers and graphic drivers.

The Install.xml and PackageDefinition*.sms must manually be updated to reflect the change in each copied and modified package.

WMI query for Lenovo model code is not consistent across devices.

On ThinkPad model code is stored in BaseBoardProduct property:

select BaseBoardProduct from MS_SystemInformation where (BaseBoardProduct like '20UB%')

On ThinkCenter model code is stored in SystemProductName property:

select BaseBoardProduct from MS_SystemInformation where (SystemProductName like '10AB%')

Proposal: Find a wmi query that is consistent accross all devices.

Object reference not set to an instance of an object.

|DriverTool.CommandProviders+createDriverPackage |2019-01-16 22:02:15,702|ERROR|'createDriverPackage(("MyCompany":System.String,,,,,"c:\temp\DriverPackages":System.String,false:System.Boolean))' failed due to: Object reference not set to an instance of an object.
|DriverTool |2019-01-16 22:02:15,718|ERROR|System.NullReferenceException: Object reference not set to an instance of an object.
at DriverTool.Logging.genericLogger[a,b,c](LogLevel logLevel, FSharpFunc2 func, a input) in E:\Dev\github.trondr\DriverTool\src\app\DriverTool\Logging.fs:line 193 at DriverTool.CommandProviders.createDriverPackage[a](String packagePublisher, String manufacturer, String systemFamily, String modelCodeString, String operatingSystemString, String destinationFolder, Boolean baseOnLocallyInstalledUpdates) in E:\Dev\github.trondr\DriverTool\src\app\DriverTool\CommandProviders.fs:line 50 at DriverTool.Commands.CommandDefinitions.CreateDriverPackage(String destinationFolder, String packagePublisher, String manufacturer, String systemFamily, String modelCode, String operatingSystemCode, Boolean baseOnLocallyInstalledUpdates) in E:\Dev\github.trondr\DriverTool\src\app\DriverTool\CommandDefinitions.fs:line 51 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at NCmdLiner.CmdLineryProvider.Run(List1 commandRules, String[] args)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.