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
 Exception:
  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:

PUSHD %1
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
POPD
goto end

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

:end


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.

PUSHD %1
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
POPD
goto end

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

:end


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" ?>
<configuration>
                <RepositoryPath>\\<SERVER>\<SHARE></RepositoryPath>
<LogPath>C:\ThinInstaller\Logs</LogPath>
                <LanguageOverride></LanguageOverride>
                <BlockSize>4096</BlockSize>
                <AskBeforeClosing>NO</AskBeforeClosing>
                <DisplayLicenseNotice>NO</DisplayLicenseNotice>
                <IgnoreLocalLicense>YES</IgnoreLocalLicense>
                <IgnoreRMLicCRCSize>YES</IgnoreRMLicCRCSize>
                <DebugEnable>NO</DebugEnable>
                <ContentMode>Active</ContentMode>
</configuration>

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

Comments