Ask a questionAsk a question
 

AnswerRUN_DEPENDANT_ALWAYS when creating a program does not work?

  • Saturday, October 24, 2009 7:18 PMAlvedon Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Has Code
    Hi,

    I'm trying to create a program with a dependent program and that dependent program should always run. I have no issues to set the dependent program but I can not manage to set the "Always run the dependent program" checkbox.

    I've tried using the RUN_DEPENDANT_ALWAYS as according to the SDK but the checkbox was never marked.

    I ended up extracting the program option value from another program that I've created and that worked, at least in the GUI the dependent program was correct and the checboxk was checked. The problem is that when I run the program, its dependent program does not run unless I go into the program properties and redo the dependent program in the GUI and save the changes.

    This leads me to believe that there is something that my code does not set right which makes it appear ok in the GUI but not when executed.

    I'm running this piece of code against ConfigMgr 2007 SP1 and I utilize the newest version of the SDK and the code is written in C#.

    Code that does not set the checkbox:
    newProgram["ProgramFlags"].IntegerValue =(int)ProgramFlags.AdminRights + (int)ProgramFlags.UserContext + (int)ProgramFlags.UseUncPath + (int)ProgramFlags.RunDependantAlways;
    
    Code that does set the checkbox but does not work when executing the program (integer value is extracted with WQL from a program that is configured excatly as I want it and that works):

    newProgram["ProgramFlags"].IntegerValue = 1097856;
    Anyone experience any issues with the RUN_DEPENDANT_ALWAYS? Anyone that could provide me with an example of the correct and working way to code this?

Answers

  • Sunday, October 25, 2009 4:23 PMAlvedon Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    I finally noticed that the issue was with the SDK material on MSDN.

    It says that the DependentProgram should be ";;ProgramName" if the program is in the same package but apperently that is not enough. One still has to specify "PackageID;;ProgramName" even if it is the same package.

    The RUN_DEPENDENT_ALWAYS does not work if used via ProgramFlags but works with the calculated value.

    • Marked As Answer byAlvedon Sunday, October 25, 2009 4:23 PM
    •  

All Replies

  • Sunday, October 25, 2009 4:23 PMAlvedon Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    I finally noticed that the issue was with the SDK material on MSDN.

    It says that the DependentProgram should be ";;ProgramName" if the program is in the same package but apperently that is not enough. One still has to specify "PackageID;;ProgramName" even if it is the same package.

    The RUN_DEPENDENT_ALWAYS does not work if used via ProgramFlags but works with the calculated value.

    • Marked As Answer byAlvedon Sunday, October 25, 2009 4:23 PM
    •