SCCM 2012 – Optimizing Dell CCTK OSD Actions into WinPE

We wanted all of our CCTK actions to happen before the disk gets partitioned. To do this, everything needs wrapped into WinPE. This involves some customization of our various scripts, cctk package folder structures, and boot images. On the plus side, the actions all run much quicker since there’s no need to download a full CCTK package on every step.

The Parts

  1. Folder Structure and CCTK Files
  2. Supporting Files
  3. Modifying the Supporting Files
  4. Making the WinPE Changes
  5. Making the TS Changes

Folder Structure and CCTK Files

  1. On your site server, create the following folder structure:
     * C:\Program Files\Microsoft Configuration Manager\OSD\Extras\CCTK32
     * C:\Program Files\Microsoft Configuration Manager\OSD\Extras\CCTK32\HAPI
     * C:\Program Files\Microsoft Configuration Manager\OSD\Extras\CCTK64
     * C:\Program Files\Microsoft Configuration Manager\OSD\Extras\CCTK64\HAPI
     * C:\Program Files\Microsoft Configuration Manager\OSD\Extras\CCTKShared
  2. Place the CCTK executable and HAPI drivers in their respective locations from the previous step.

Supporting Files

  1. Using the instructions in the following blog post, create the following files and place them in .\CCTKShared.
  2. SCCM 2012 – Generic Multi-Platform Dell CCTK BIOS Settings
    1. Dell-CustomSettings.cctk
    2. CCTK-Generic.cmd
    3. Show-CCTKErrors.vbs
  3. Using the instructions in the following blog post, create the following file and place it in .\CCTKShared.
    SCCM 2012 – Testing for Dell TPM Activation in a Task Sequence

    1. Check-TPMActivation.vbs

Modifying the Supporting Files

Some of the script files need modified since we will no longer be using the cctk.cmd wrapper to select the appropriate cctk executable for the running architecture. Instead, we will only include the 32-bit cctk on the 32-bit WinPE, and vice-versa.

CCTK-Generic.cmd

In this file, make the following changes.

  1. Remove lines 16 through 29 since we don’t need to select architecture.
  2. Replace all instances of “%CCTKPath%\”  with “%~dp0”. See this example:
    %CCTKPath%\cctk.exe --tpmactivation=activate !ARG1! !ARG2!
    --should turn into--
    %~dp0cctk.exe --tpmactivation=activate !ARG1! !ARG2!
    
  3. Before every instance of Show-CCTKErrors.vbs, add “%~dp0”. For example:
    cscript.exe //nologo Show-CCTKErrors.vbs %errorlevel%
    --should turn into--
    cscript.exe //nologo %~dp0Show-CCTKErrors.vbs %errorlevel%
    

check-tpmactivation.vbs

In this file, make the following changes:

  1. Replace all instances of ‘cctk.cmd’ with ‘cctk.exe’.
  2. Delete line 23 (strPath) and replace it with the following code:
    strPath = Wscript.ScriptFullName
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFile = objFSO.GetFile(strPath)
    strPath = objFSO.GetParentFolderName(objFile)

HAPIInstall.cmd

Replace this entire file with the following code:

@echo off
%~dp0hapi\hapint.exe -i -k C-C-T-K -p "hapint.exe"

Making the WinPE Changes

  1. Open the following file from your site server in a decent editor: “C:\Program Files\Microsoft Configuration Manager\bin\x64\osdinjection.xml”.
  2. Find the section for i386\SCCM, and add the following lines of code:
    <File name="hapint.exe">
            <LocaleNeeded>false</LocaleNeeded>
            <Source>extra\CCTK32\HAPI</Source>
            <Destination>windows\system32\HAPI</Destination>
    	  </File>
    	  <File name="dcmdev32.exe">
            <LocaleNeeded>false</LocaleNeeded>
            <Source>extra\CCTK32\HAPI</Source>
            <Destination>windows\system32\HAPI</Destination>
    	  </File>
    	  <File name="dchipm32.dll">
            <LocaleNeeded>false</LocaleNeeded>
            <Source>extra\CCTK32\HAPI</Source>
            <Destination>windows\system32\HAPI</Destination>
    	  </File>
    	  <File name="dchcfg32.exe">
            <LocaleNeeded>false</LocaleNeeded>
            <Source>extra\CCTK32\HAPI</Source>
            <Destination>windows\system32\HAPI</Destination>
    	  </File>
    	  <File name="dchbas32.dll">
            <LocaleNeeded>false</LocaleNeeded>
            <Source>extra\CCTK32\HAPI</Source>
            <Destination>windows\system32\HAPI</Destination>
    	  </File>
    	  <File name="dchapi32.dll">
            <LocaleNeeded>false</LocaleNeeded>
            <Source>extra\CCTK32\HAPI</Source>
            <Destination>windows\system32\HAPI</Destination>
    	  </File>
    	  <File name="dcdbas32.sys">
            <LocaleNeeded>false</LocaleNeeded>
            <Source>extra\CCTK32\HAPI</Source>
            <Destination>windows\system32\HAPI</Destination>
    	  </File>
    	  <File name="dcdbas32.inf">
            <LocaleNeeded>false</LocaleNeeded>
            <Source>extra\CCTK32\HAPI</Source>
            <Destination>windows\system32\HAPI</Destination>
    	  </File>
    	  <File name="dcdbas32.cat">
            <LocaleNeeded>false</LocaleNeeded>
            <Source>extra\CCTK32\HAPI</Source>
            <Destination>windows\system32\HAPI</Destination>
    	  </File>
    	  <File name="pci.ids">
            <LocaleNeeded>false</LocaleNeeded>
            <Source>extra\CCTK32</Source>
            <Destination>windows\system32</Destination>
    	  </File>
    	  <File name="CCTK.exe">
            <LocaleNeeded>false</LocaleNeeded>
            <Source>extra\CCTK32</Source>
            <Destination>windows\system32</Destination>
    	  </File>
    	  <File name="mxml1.dll">
            <LocaleNeeded>false</LocaleNeeded>
            <Source>extra\CCTK32</Source>
            <Destination>windows\system32</Destination>
    	  </File>
    	  <File name="show-cctkerrors.vbs">
            <LocaleNeeded>false</LocaleNeeded>
            <Source>extra\CCTKShared</Source>
            <Destination>windows\system32</Destination>
    	  </File>
    	  <File name="dell-customsettings.cctk">
            <LocaleNeeded>false</LocaleNeeded>
            <Source>extra\CCTKShared</Source>
            <Destination>windows\system32</Destination>
    	  </File>
    	  <File name="HAPIInstall.cmd">
            <LocaleNeeded>false</LocaleNeeded>
            <Source>extra\CCTKShared</Source>
            <Destination>windows\system32</Destination>
    	  </File>
    	  <File name="check-tpmactivation.vbs">
            <LocaleNeeded>false</LocaleNeeded>
            <Source>extra\CCTKShared</Source>
            <Destination>windows\system32</Destination>
    	  </File>
    	  <File name="CCTK-Generic.cmd">
            <LocaleNeeded>false</LocaleNeeded>
            <Source>extra\CCTKShared</Source>
            <Destination>windows\system32</Destination>
    	  </File>
  3. Find the section for x64\SCCM, and add the following lines of code:
    <File name="hapint.exe">
            <LocaleNeeded>false</LocaleNeeded>
            <Source>extra\CCTK64\HAPI</Source>
            <Destination>windows\system32\HAPI</Destination>
    	  </File>
    	  <File name="dcmdev32.exe">
            <LocaleNeeded>false</LocaleNeeded>
            <Source>extra\CCTK64\HAPI</Source>
            <Destination>windows\system32\HAPI</Destination>
    	  </File>
    	  <File name="dchipm32.dll">
            <LocaleNeeded>false</LocaleNeeded>
            <Source>extra\CCTK64\HAPI</Source>
            <Destination>windows\system32\HAPI</Destination>
    	  </File>
    	  <File name="dchcfg32.exe">
            <LocaleNeeded>false</LocaleNeeded>
            <Source>extra\CCTK64\HAPI</Source>
            <Destination>windows\system32\HAPI</Destination>
    	  </File>
    	  <File name="dchbas32.dll">
            <LocaleNeeded>false</LocaleNeeded>
            <Source>extra\CCTK64\HAPI</Source>
            <Destination>windows\system32\HAPI</Destination>
    	  </File>
    	  <File name="dchapi32.dll">
            <LocaleNeeded>false</LocaleNeeded>
            <Source>extra\CCTK64\HAPI</Source>
            <Destination>windows\system32\HAPI</Destination>
    	  </File>
    	  <File name="dcdbas32.sys">
            <LocaleNeeded>false</LocaleNeeded>
            <Source>extra\CCTK64\HAPI</Source>
            <Destination>windows\system32\HAPI</Destination>
    	  </File>
    	  <File name="dcdbas32.inf">
            <LocaleNeeded>false</LocaleNeeded>
            <Source>extra\CCTK64\HAPI</Source>
            <Destination>windows\system32\HAPI</Destination>
    	  </File>
    	  <File name="dcdbas32.cat">
            <LocaleNeeded>false</LocaleNeeded>
            <Source>extra\CCTK64\HAPI</Source>
            <Destination>windows\system32\HAPI</Destination>
    	  </File>
    	  <File name="pci.ids">
            <LocaleNeeded>false</LocaleNeeded>
            <Source>extra\CCTK64</Source>
            <Destination>windows\system32</Destination>
    	  </File>
    	  <File name="CCTK.exe">
            <LocaleNeeded>false</LocaleNeeded>
            <Source>extra\CCTK64</Source>
            <Destination>windows\system32</Destination>
    	  </File>
    	  <File name="mxml1.dll">
            <LocaleNeeded>false</LocaleNeeded>
            <Source>extra\CCTK64</Source>
            <Destination>windows\system32</Destination>
    	  </File>
    	  <File name="show-cctkerrors.vbs">
            <LocaleNeeded>false</LocaleNeeded>
            <Source>extra\CCTKShared</Source>
            <Destination>windows\system32</Destination>
    	  </File>
    	  <File name="dell-customsettings.cctk">
            <LocaleNeeded>false</LocaleNeeded>
            <Source>extra\CCTKShared</Source>
            <Destination>windows\system32</Destination>
    	  </File>
    	  <File name="HAPIInstall.cmd">
            <LocaleNeeded>false</LocaleNeeded>
            <Source>extra\CCTKShared</Source>
            <Destination>windows\system32</Destination>
    	  </File>
    	  <File name="check-tpmactivation.vbs">
            <LocaleNeeded>false</LocaleNeeded>
            <Source>extra\CCTKShared</Source>
            <Destination>windows\system32</Destination>
    	  </File>
    	  <File name="CCTK-Generic.cmd">
            <LocaleNeeded>false</LocaleNeeded>
            <Source>extra\CCTKShared</Source>
            <Destination>windows\system32</Destination>
    	  </File>
  4. Update the distribution points of your boot image. If this fails, double-check that all the files added to osdinjection.xml actually exist.

Making the TS Changes

Now that all the leg-work is done; let’s use it!

  1. Open your task sequence, and create the following actions.
    1. Name: Install Dell HAPI Drivers
      Command: X:\Windows\System32\HAPIInstall.cmd
      Package: None
    2. Name: Check TPM Activation
      Command: X:\Windows\System32\Check-TPMActivation.vbs warnonly
      Package: None
    3. Name: Set Default Dell BIOS Settings
      Command: X:\Windows\System32\CCTK-Generic.cmd
      Package: None
    4. Name: Reboot (HD)
    5. Name: Check TPM Activation (force)
      Command: X:\Windows\System32\Check-TPMActivation.vbs
      Package: None

You should now be in business!

Advertisements

8 thoughts on “SCCM 2012 – Optimizing Dell CCTK OSD Actions into WinPE

  1. Pingback: Table of Contents | windowsmasher

  2. Thanks for the guides. I keep getting error code 136 when trying to execute CCTK-Generic.cmd

    From your list this means (136) = “Usage error.”

    If I hit F8 and navigate to X:\Windows\System32 and then run CCTK-Generic.cmd from there it seems to work fine. Any ideas?

    Thanks

    • I’ve tried adding this to my TS instead and it fails with TS error code 0x00000088

      X:\Windows\System32\cctk -i Latitude-E6330.cctk

      If I hit F8 and run the command manually it works fine

  3. Had a thought on the way to work. What if I put the full path to the cctk file in the command. I added a Run Command Line step in my TS with the following command:

    X:\Windows\System32\cctk.exe -i “X:\Windows\System32\Latitude-E7240.cctk”

    This went through without any issues. So I’m guessing inside the CCTK-Generic.cmd it is having issues finding the .cctk file? I will do some more testing today and see what I come up with

  4. I found this to work in my environment. Seemed to have to put the full pathing in:

    @ECHO OFF
    REM Parse Arguments
    SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION

    SET ARGV=.%*
    CALL :PARSE_ARGV
    IF ERRORLEVEL 1 (
    ECHO Cannot parse arguments
    ENDLOCAL
    EXIT /B 1
    )

    REM —START MAIN LOOP—
    ECHO == Seting BIOS Settings ==

    :RunCCTK
    ECHO –Enabling TPM
    X:\Windows\System32\cctk.exe –tpm=on !ARG1! !ARG2!
    cscript.exe //nologo X:\Windows\System32\Show-CCTKErrors.vbs %errorlevel%
    IF errorlevel 157 GOTO END

    ECHO –Enabling other features
    X:\Windows\System32\cctk.exe -i X:\Windows\System32\Latitude-E6330.cctk !ARG1! !ARG2!
    cscript.exe //nologo X:\Windows\System32\Show-CCTKErrors.vbs %errorlevel%
    GOTO END

  5. Pingback: Fix Dcdbas32.inf Errors - Windows XP, Vista, 7 & 8

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s