Ask a questionAsk a question
 

AnswerPackageFlags / ProgramFlags Assistance

  • Wednesday, October 28, 2009 4:47 AMkiwidj Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi,

    I just need to know how to set the Program flags for a program that I'm creating.

    the SDK explains the available Hex and bit values for the properties but I'm not sure how to specify them in code (vbscript), the programs I've looked at the properties for aren't giving anything away, can someone please explain this to me?


    I thought the number could be concatenated together but this doesn't look like it would work given the available values below..

        Sub ModifyProgram(connection, existingpackageID, existingProgramNameToModify, programFlags, durationtoRun)  
    
              	Dim program
    
    	     ' Load the specific program to change (programname is a key value and must be unique).
    	     Set program = connection.Get("SMS_Program.PackageID='" & existingPackageID & "'" & ",ProgramName='" & existingProgramNameToModify & "'")
    	     program.ProgramFlags = ??????
    program.Description = "Application Installation" program.Duration = durationtoRun ' Save the program with the modified properties. program.Put_ ' Output program name. wscript.echo "Modified program: " & program.ProgramName & " for package " & existingpackageID End Sub
    ProgramFlags
    Data type: UInt32

     

    Access type: Read/Write

     

    Qualifiers: [bits, ResID(914), ResDLL("SMS_RSTT.dll") ]

     

    Flags identifying the installation characteristics of the program. Possible values are listed below. The default values are EVERYUSER, USEUNCPATH, USERCONTEXT, and UNATTENDED

     

    noteNote
    When using SMS_Program programmatically, ensure that no conflicting values are selected. For example, NOUSERLOGGEDIN and USERCONTEXT should not be used together.

     

     

    Possible values are:

     

     

    Hex (Bit)Description

    0x00000001 (0)

    AUTHORIZED_DYNAMIC_INSTALL. The program is authorized for dynamic install.

    0x00000002 (1)

    USECUSTOMPROGRESSMSG. The task sequence shows a custom progress user interface message.

    0x00000010 (4)

    DEFAULT_PROGRAM. This is a default program

    0x00000020 (5)

    DISABLEMOMALERTONRUNNING. Disables MOM alerts while the program runs.

    0x00000040 (6)

    MOMALERTONFAIL. Generates MOM alert if the program fails.

    0x00000080 (7)

    RUN_DEPENDANT_ALWAYS. If set, this program's immediate dependent should always be run.

    0x00000100 (8)

    WINDOWS_CE. Indicates a device program. If set, the program is not offered to desktop clients.

    0x00000200 (9)

    This value is not used.

    0x00000400 (10)

    COUNTDOWN. The countdown dialog is not displayed.

    0x00000800 (11)

    FORCERERUN. This value is not used.

    0x00001000 (12)

    DISABLED. The program is disabled.

    0x00002000 (13)

    UNATTENDED. The program requires no user interaction.

    0x00004000 (14)

    USERCONTEXT. The program can run only when a user is logged on.

    0x00008000 (15)

    ADMINRIGHTS. The program must be run as the local Administrator account.

    0x00010000 (16)

    EVERYUSER. The program must be run by every user for whom it is valid. Valid only for mandatory jobs.

    0x00020000 (17)

    NOUSERLOGGEDIN. The program is run only when no user is logged on.

    0x00040000 (18)

    OKTOQUIT. The program will restart the computer.

    0x00080000 (19)

    OKTOREBOOT. Configuration Manager restarts the computer when the program has finished running successfully.

    0x00100000 (20)

    USEUNCPATH. Use a UNC path (no drive letter) to access the distribution point.

    0x00200000 (21)

    PERSISTCONNECTION. Persists the connection to the drive specified in the DriveLetter property. The USEUNCPATH bit flag must not be set.

    0x00400000 (22)

    RUNMINIMIZED. Run the program as a minimized window.

    0x00800000 (23)

    RUNMAXIMIZED. Run the program as a maximized window.

    0x01000000 (24)

    HIDEWINDOW. Hide the program window.

    0x02000000 (25)

    OKTOLOGOFF. Logoff user when program completes successfully.

    0x04000000 (26)

    RUNACCOUNT. This value is not used.

    0x08000000 (27)

    ANY_PLATFORM. Override check for platform support.

    0x10000000 (28)

    STILL_RUNNING. This value is not used.

    0x20000000 (29)

    SUPPORT_UNINSTALL. Run uninstall from the registry key when the advertisement expires.

    0x40000000 (30)

    The platform is not supported.

    0x80000000 (31)

    SHOW_IN_ARP. This value is not used.

Answers

  • Wednesday, October 28, 2009 2:27 PMJason SandysMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Don't concatenate them, add them together. Notice that everything is a multiple of 2 and if you convert these to binary, no two values haves ones in the same place. This can also be seen just by adding any of the above numbers, you will always get different results no matter which values you choose.
    Jason | http://myitforum.com/cs2/blogs/jsandys | http://blogs.catapultsystems.com/jsandys/default.aspx | Twitter @JasonSandys
    • Marked As Answer bykiwidj Tuesday, November 03, 2009 10:39 PM
    •  

All Replies

  • Wednesday, October 28, 2009 2:27 PMJason SandysMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Don't concatenate them, add them together. Notice that everything is a multiple of 2 and if you convert these to binary, no two values haves ones in the same place. This can also be seen just by adding any of the above numbers, you will always get different results no matter which values you choose.
    Jason | http://myitforum.com/cs2/blogs/jsandys | http://blogs.catapultsystems.com/jsandys/default.aspx | Twitter @JasonSandys
    • Marked As Answer bykiwidj Tuesday, November 03, 2009 10:39 PM
    •  
  • Tuesday, November 03, 2009 10:43 PMkiwidj Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Thanks Jason!