locked
Installing the CM2012 R2 agent from SCCM 2007 as a program and including the CU4 patch in the installation RRS feed

  • Question

  • Hi

    I am working on installing the 2012 R2 agent from SCCM 2007 as a program and I want to have the CU4 patch included in the installation. It should work by just goin

    ccmsetup.exe smssitecode=XXX PATCH=.\CU4PATCH.msp

    But that is not working and the installation aborts.. It has to do with how I refer to the patch file I think. Is there a proper way of doing this? I can't find anything online.

    Thanks!


    Friday, April 24, 2015 10:24 AM

Answers

  • If the files are all in the same folder you need to remove the backslash behind %~dp0. For example %~dp0ccmsetup.exe

    My Blog: http://www.petervanderwoude.nl/
    Follow me on twitter: pvanderwoude

    • Proposed as answer by Joyce L Monday, April 27, 2015 8:18 AM
    • Marked as answer by Joyce L Wednesday, May 6, 2015 9:25 AM
    Friday, April 24, 2015 11:57 AM
  • A quick note about having to use %~dp0 here: You don't need to use it for running the exe because the current working directory is already the directory containing the exe; however, you do need to use it for the PATCH property because when using the PATCH property you must specify fully-qualified paths, relative paths are not valid and the Windows Installer will not look in the current directory. Thus, your line in the batch file should simply be (without the slash as pointed out by Peter because the %~dp0 variable already includes one):

    ccmsetup.exe smssitecode=xxx PATCH=%~dp0CU4Patch.msp

    More info at http://blog.configmgrftw.com/current-directory-in-configmgr-programs/ .

    Test this though. As written it *should* work but I have a suspicion it will fail because ccmsetup will run but will first uninstall the 2007 agent deleting the 2007 cache. This isn't an issue for ccmsetup because it always makes a copy of itself in c:\Windows\ccmsetup first and then installs itself as a service, starts that service and then exits right away. It should also copy any files needed by ccmsetup from the directory its run from (or at least it will download those from the nearest DP). But the msp file is not part of ccmsetup's normal files so it won't make a copy of it anywhere and will get deleted when the 2007 cache is deleted and thus won't be available when ccmsetup finally initiates client.msi.

    An easy work-around here (assuming my above suspicion is correct) is to simply add a new line to your batch file before the ccmsetup line to copy the msp to a temporary directory somewhere:

    copy /y CU4Patch.msp c:\Windows\Temp\

    ccmsetup.exe smssitecode=xxx PATCH=c:\Windows\Temp\CU4Patch.msp

    del /y CU4Patch.msp


    Jason | http://blog.configmgrftw.com | @jasonsandys

    • Proposed as answer by Joyce L Monday, April 27, 2015 8:18 AM
    • Marked as answer by Joyce L Wednesday, May 6, 2015 9:25 AM
    Friday, April 24, 2015 1:49 PM

All replies

  • Were should the client installation find the patch? You should specify the complete path to the CU. When it's all part of a package you're deploying you could think about using a batch file with the %~dp0 variable.

    My Blog: http://www.petervanderwoude.nl/
    Follow me on twitter: pvanderwoude

    Friday, April 24, 2015 11:02 AM
  • Yes its all a part of one package. So If I use a batch file I would do the following:

    1. Put just the InstallCM12Agent.bat file in the Command Line field in SCCM 2007

    2. Put the following command in the batch script:

    %~dp0\ccmsetup.exe smssitecode=xxx PATCH=%~dp0\CU4Patch.msp

    And that should do the trick?

    Friday, April 24, 2015 11:16 AM
  • If the files are all in the same folder you need to remove the backslash behind %~dp0. For example %~dp0ccmsetup.exe

    My Blog: http://www.petervanderwoude.nl/
    Follow me on twitter: pvanderwoude

    • Proposed as answer by Joyce L Monday, April 27, 2015 8:18 AM
    • Marked as answer by Joyce L Wednesday, May 6, 2015 9:25 AM
    Friday, April 24, 2015 11:57 AM
  • A quick note about having to use %~dp0 here: You don't need to use it for running the exe because the current working directory is already the directory containing the exe; however, you do need to use it for the PATCH property because when using the PATCH property you must specify fully-qualified paths, relative paths are not valid and the Windows Installer will not look in the current directory. Thus, your line in the batch file should simply be (without the slash as pointed out by Peter because the %~dp0 variable already includes one):

    ccmsetup.exe smssitecode=xxx PATCH=%~dp0CU4Patch.msp

    More info at http://blog.configmgrftw.com/current-directory-in-configmgr-programs/ .

    Test this though. As written it *should* work but I have a suspicion it will fail because ccmsetup will run but will first uninstall the 2007 agent deleting the 2007 cache. This isn't an issue for ccmsetup because it always makes a copy of itself in c:\Windows\ccmsetup first and then installs itself as a service, starts that service and then exits right away. It should also copy any files needed by ccmsetup from the directory its run from (or at least it will download those from the nearest DP). But the msp file is not part of ccmsetup's normal files so it won't make a copy of it anywhere and will get deleted when the 2007 cache is deleted and thus won't be available when ccmsetup finally initiates client.msi.

    An easy work-around here (assuming my above suspicion is correct) is to simply add a new line to your batch file before the ccmsetup line to copy the msp to a temporary directory somewhere:

    copy /y CU4Patch.msp c:\Windows\Temp\

    ccmsetup.exe smssitecode=xxx PATCH=c:\Windows\Temp\CU4Patch.msp

    del /y CU4Patch.msp


    Jason | http://blog.configmgrftw.com | @jasonsandys

    • Proposed as answer by Joyce L Monday, April 27, 2015 8:18 AM
    • Marked as answer by Joyce L Wednesday, May 6, 2015 9:25 AM
    Friday, April 24, 2015 1:49 PM