none
Problem with configuring multiple constrained properties in a queue property bag

    Question

  • Hello!

    Is there any predictable way to set multiple constrained properties in Queue Property Bag using powershell (or some other tool) when setting each of the properties alone violates constraints declared for these properties in GPD, but if they were set all at once, their values would be unconstrained?

    Let me provide an example.

    Our V4 printer driver has 2 installable options: OptionalTray3 and OptionalTray4.

    The values for OptionalTray3 are None, StandardCapacity and HighCapacity.

    The values for OptionalTray4 are None and StandardCapacity.

    These values are constrained so that if OptionalTray3 is None or HighCapacity, then OptionalTray4 can be only None. If OptionalTray3 is StandardCapacity, then OptionalTray4 can be only StandardCapacity.

    These constraints are declared in GPD with the following rules:

    *InvalidCombination: LIST(OptionalTray3.HighCapacity, OptionalTray4.StandardCapacity)
    *InvalidCombination: LIST(OptionalTray3.StandardCapacity, OptionalTray4.None)
    *InvalidCombination: LIST(OptionalTray3.None, OptionalTray4.StandardCapacity)

    Lets imagine that current values are:

    OptionalTray3 = StandardCapacity

    OptionalTray4 = StandardCapacity

    The problem is when we try to set these properties to HighCapacity and None (which is a valid combination) using powershell:

    Set-PrinterProperty "Printer1" "Config:OptionalTray3" "HighCapacity"
    
    Set-PrinterProperty "Printer1" "Config:OptionalTray4" "None"

    The result will be:

    OptionalTray3 = None

    OptionalTray4 = None

    Which is not correct.

    This happens because the first command changes nothing (HightCapacity is constrained with the current value of OptionalTray4), but the second command changes both OptionalTray4 and OptionalTray3 and sets them both to None.

    Of course in this example we could change the order of commands and get the correct result, but how can we know in advance which order will work?

    What are the rules that for some properties change to constrained value is ignored while for the others it is applied along with fixing other constrained properties? Can we tell this from the way we declare "InvalidCombination" rules in GPD?

    Or maybe there is a way to set multiple properties in queue property bag at once?

    Thank you.


    Wednesday, July 10, 2013 9:00 AM

Answers

  • Hi kondakovdmitry,

    The Windows Store apps Forums are for discussions about writing Windows Store apps, which cannot use PowerShell. I'm not sure what sort of app you are trying to write here, so you will need to figure out the proper forum yourself.

    --Rob

    Thursday, July 11, 2013 2:22 AM

All replies

  • Hi kondakovdmitry,

    The Windows Store apps Forums are for discussions about writing Windows Store apps, which cannot use PowerShell. I'm not sure what sort of app you are trying to write here, so you will need to figure out the proper forum yourself.

    --Rob

    Thursday, July 11, 2013 2:22 AM
  • Hi Rob,

    How can I move this thread to "Windows Desktop Development Forums -> Windows Hardware WDK and Driver Development" instead? I can't figure out how to do that...

    Dmitry.

    Thursday, July 11, 2013 6:17 AM
  • Ok, I reposted it there myself.

    Thank you.


    Thursday, July 11, 2013 1:22 PM