Changes Required to Use Thin Installer v1.2.0022 in "Portable" Scenario

Why is Thin Installer not installing these updates??

If you happen to use Thin Installer in your OS deployment process to install Lenovo drivers and utilities you may be experiencing issues getting certain packages to install.  If you check your Thin Installer log file you may see something like:
Severe 2017-03-04 , 07:19:57
 at Tvsu.Gur.GUR2.GetInstalledVersion(Boolean& showflag)
 Message: Error get installed version
  Message: Cannot start service winmgmt on computer '.'.
  Type: System.InvalidOperationException
     at System.ServiceProcess.ServiceController.Start(String[] args)
   at System.ServiceProcess.ServiceController.Start()
   at Tvsu.Util.Tools.RestartWMIService()
   at Tvsu.Util.VersionUtilities.GetVersionAndDateByFullPnPID(String pnpID, StringBuilder version, StringBuilder date)
   at Tvsu.Util.VersionUtilities.GetVersionAndDateByPnPID(String pnpID, StringBuilder version, StringBuilder date)
   at Tvsu.Gur.GUR2.GetInstalledVersion(Boolean& showflag)

So why does this happen?  Lenovo recently, as part of an effort to simplify and clean up our preloads, has moved to packaging hardware drivers as INF installs instead of using larger full setups.  As a result a new method to target hardware driver updates has been added which is dependent on data values in WMI.  Unfortunately the data values were not in a format that could be used programmatically to make comparisons.  To address this there is a new .DLL in the Thin Installer source files that adds a WMI Provider.  The purpose of this WMI Provider is to format the data values we need from WMI into something Thin Installer can use.  

The installer package for the current version of Thin Installer would register this .DLL with WMI so Thin Installer has access to the data values it needs in the correct format.  However, many users of Thin Installer are using it in a "portable" fashion by simply copying the Thin Installer source files to the target device without using the installer.  In this scenario, an additional step will be required to get the WMI Provider registered.

So how do we handle this?

In the Thin Installer source files there is a file named regpnp.cmd which is designed to be used in an "installed Thin Installer" scenario.  For the portable scenario we need to either edit or replace this file with the following:

if not exist "%windir%\Microsoft.NET\Framework\v4.0.30319" goto win7
"%windir%\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe" "Lenovo.PnPSignedDriverEx.dll" > %temp%\PNP.txt
goto end

"%windir%\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe" "Lenovo.PnPSignedDriverEx.dll" > %temp%\PNP.txt


This file will need to be executed before running Thin Installer on the target device.  Specify the folder that contains the Thin Installer source files on the target device when you call it.  If you prefer to remove Thin Installer from the target device when the deployment is complete you can also unregister the .DLL before removing the Thin Installer folder.  The following unregpnp.cmd file that can be used for this.

if not exist "%windir%\Microsoft.NET\Framework\v4.0.30319" goto win7
"%windir%\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe" /u "Lenovo.PnPSignedDriverEx.dll" > %temp%\UNREGPNP.txt
goto end

"%windir%\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe" /u "Lenovo.PnPSignedDriverEx.dll" > %temp%\UNREGPNP.txt


To demonstrate how this would be used, the following section will lay out the task sequence items and their details for an MDT scenario. The details and structure of the process could be used in other deployment solutions as well.

The MDT Task Sequence Example

In this example we are using the ThinInstaller.exe.configuration file to specify our repository and log file location.

<?xml version="1.0" encoding="utf-8" ?>

Task Sequence structure and order:

Task: ThinInstaller Copy to Local
Command: xcopy \\<SERVER>\<SHARE>\ThinInstaller_1.2.0022 C:\ThinInstaller /seiqvy

Task: ThinInstaller Register WMI
Command: C:\ThinInstaller\regpnp.cmd C:\ThinInstaller
Start in: C:\ThinInstaller

Task: ThinInstaller Execute
Command: C:\ThinInstaller\ThinInstaller.exe /CM -Search A -Action INSTALL -IncludeRebootPackages 3 -noreboot -noicon

For removal, if not needed after the deployment:

Task Sequence structure and order

Task: ThinInstaller Unregister WMI
Command: C:\ThinInstaller\unregpnp.cmd C:\ThinInstaller
Start in: C:\ThinInstaller

Task: ThinInstaller Remove Directory
Command: rd C:\ThinInstaller /s /q

If you run into any issues or have questions, please visit the Enterprise Client Management Forum and create a post.

by TLawson and Lenovo Think Deploy