Automatically Populate the PATCH Property for the ConfigMgr 2007 Client Installation

29 Aug 2010 Update – I must apologize to all of you who attempted to use this as originally posted.  I wrote this script around two years ago and was posting it now because another MCS consultant needed.  Unfortunately, while I was trying to remember how I did this, I left out an important detail.  In my original implementation, I had used an MDT custom variable to hold the client installation properties.  The script then changed that variable and this custom variable was placed in the Installation Properties field of the Setup Windows and ConfigMgr step. Luckily, an astute reader, Chris Nackers of Catapult Systems Inc., noticed this and contacted me.  He had created his own fix.  While discussing this via email with Chris, I realized that I should have just made the script set the SMSClientInstallProperties task sequence variable directly (which is what I thought I had done when write the post).  So I updated the script to do just that and have updated the attachment with the latest version.  Be sure that you are using at least version 1.0.2 of the script for this to work as described below. Chris was kind enough to test the updated script for me.  Chris has also created a great visual “how to” post on his blog for using this script.  Thanks again Chris!

 

Update 2013-06-12: The newest version of this script can be found here.

 

During a System Center Configuration Manager 2007 Operating System Deployment task sequence a step called Setup Windows and ConfigMgr stages the ConfigMgr client for installation.  The task sequence editor for this step provides a field called Installation Properties that allows you to specify Configuration Manager Client Installation Properties.  The client installation properties can also be specified using the SMSClientInstallProperties task sequence variable.

Client hotfixes are stored in subfolders of the i386\hotfix folder in the client installation folder similar to the picture below.

image

When client hotfixes must be installed during the client installation, the PATCH property should be used.  The PATCH property must contain a semicolon-separated list of the paths to the hotfix MSP files.  Unfortunately, these paths must be specified as fully qualified paths like this example from KB977203:

PATCH="%_SMSTSMDataPath%\OSD\<Package_ID>\i386\hotfix\KB977203\SCCM2007AC-SP1-KB977203-x86.msp"

They cannot be relative paths.  This means hard coding the client files package ID (and of course the rest of the path) into the property.  Therefore, the property must be updated any time a new hotfix is added or removed.  To prevent having to do this maintenance, I created a script called SCCMClientHotfixPath.wsf that will create the PATCH property on the fly during the task sequence.

This script must be used with an MDT-integrated OSD task sequence.  When you use this script, do not place the text of the client properties in the Installation Properties field of the Setup Windows and ConfigMgr step.  You must instead use the SMSClientInstallProperties variable (either using a Set Task Sequence Variable step or CustomSettings.ini) somewhere before Setup Windows and ConfigMgr step.  When you do this, specify the client properties required except the PATCH property.  The script will add this property to the SMSClientInstallProperties variable for you.

Copy SCCMClientHotfixPath.wsf and ZTIUtility.vbs (included with MDT in the Scripts folder) to the root of the client files package (i.e. in the same folder as ccmsetup.exe).  Then add a Run Command Line step just before the Setup Windows and ConfigMgr step (but after the place where the SMSClientInstallProperties variable is set).  Add a reference to the client files package to this step.  The command line for this step should be:

cscript.exe SCCMClientHotfixPath.wsf

When this script runs it does the following tasks:

  • If it is running in an online (not from media) task sequence, it will copy the hotfix folder to %DeployRoot% so that its location is fixed.
  • It will examine all subfolders of the hotfix folder, enumerate all the MSP files, and construct the PATCH=… string using the absolute file paths.  If there are no MSP files found, it will exit.
  • If MSP files were found, it will add the PATCH string to SMSClientInstallProperties variable.

The only drawback to using this technique is that when using download and execute, the client files package will be downloaded an extra time.  My custom preferred this to having to manually maintain the PATCH property in their task sequences.

 

Disclaimer: The information on this site is provided "AS IS" with no warranties, confers no rights, and is not supported by the authors or Microsoft Corporation. Use of included script samples are subject to the terms specified in the Terms of Use .

This post was contributed by Michael Murgolo, a Senior Consultant with Microsoft Services - U.S. East Region.

SCCMClientHotfixPath.zip