none
Attempting to create a Global Condition that will return a list of installed applications to use for an application requirement. RRS feed

  • Question

  • I am attempting to create a Global Condition that will return a list of installed applications based on ProductCode. I am trying to install “Mastercam 2020 for SolidWorks” but only if a version of SolidWorks is installed. I have Mastercam 2020 and SolidWorks 2019 sp3 deployed to a test computer. I can’t figure out how to deploy Mastercam 2020 for SolidWorks using the following Global Condition/Requirement.

    I currently have the Global Condition setup as follows. It’s a PowerShell script with a single line of code:

    Get-WmiObject -Namespace root\ccm\CIModels -Class CCM_MSIProduct | Select-Object -ExpandProperty ProductCode | Sort-Object


    I then add the condition as a requirement to an application deployment type.


    The ProductCodes for this example that I am checking are as follows:

    • {768F3B65-1695-47B7-9002-B11400CB111D} SolidWorks 2016 sp4
    • {BB965FD0-077F-4CA4-BFD1-39FFEFF15770} SolidWorks 2017 sp3
    • {837A0B0D-F508-4088-8B05-606477DEB905} SolidWorks 2018 sp5
    • {F261BF5C-81C4-4E81-9ED6-D7EBFA2A9A5B} SolidWorks 2019 sp3

    If I then check the deployment status, I am getting a “Requirements Not Met” error.


    As can be seen, the product code {F261BF5C-81C4-4E81-9ED6-D7EBFA2A9A5B} is missing. This should allow the requirements to pass as the Operator is set to “One of”.

    I can verify this by changing the requirement by adding a “z” to the end of the ProductCode for Solidworks 2019; “{F261BF5C-81C4-4E81-9ED6-D7EBFA2A9A5B}z”



    Other items:

    If I try to set up a Global Condition with a Setting Type of WQL query, the deployment status returns a “Type Mismatch” error.

    I want to have all installed applications returned from the Global Condition. I know how to check for a specific application installed, but I don’t want to have a Global Condition for each application.

    Tuesday, September 10, 2019 11:09 AM

All replies

  • > As can be seen, the product code {F261BF5C-81C4-4E81-9ED6-D7EBFA2A9A5B} is missing. This should allow the requirements to pass as the Operator is set to “One of”.

    If I'm following correctly, then no. If none of the values exist then the requirements are not met. "One of" the values must be present on the system for the requirement to pass. If you don't want any of the values to exists, you need to use "none of" as the operator.

    You can use the Deployment Monitoring tool (part of the toolkit and in the tools folder on the site server) to check the evaluation status and results of requirements on a per deployment basis.


    Jason | https://home.configmgrftw.com | @jasonsandys

    Tuesday, September 10, 2019 1:32 PM
  • If I'm following correctly, then no. If none of the values exist then the requirements are not met. "One of" the values must be present on the system for the requirement to pass. If you don't want any of the values to exists, you need to use "none of" as the operator.

    I'm testing for 4 product codes. One of them is found {F261BF5C-81C4-4E81-9ED6-D7EBFA2A9A5B} (SolidWorks 2019 sp3), which if why it doesn't show up in the Deployment Status. That specific entry seems to pass. The other 3 product codes still show up in the Deployment Status and fails correctly since I don't have those versions of the app installed. But since the requirement I am testing has the Operator set to "One of" I would expect the entire requirement to pass.

    I'll see if I can get access to the Deployment Monitoring tool.

    Tuesday, September 10, 2019 2:22 PM
  • I'm still not following totally. You've added a 'z' (in the screenshots above) to the end of the only product code that is found and so it doesn't actually match (and the others aren't found) so it's failing the requirement just as it should.

    What happens without the 'z' added to the product code in the requirement rule?


    Jason | https://home.configmgrftw.com | @jasonsandys

    Tuesday, September 10, 2019 3:20 PM
  • With the requirement set up as:

    Category: Custom
    Condition: Installed Application v2
    Rule type: Value
    Operator: One of
    Value: 
    {768F3B65-1695-47B7-9002-B11400CB111D}
    {BB965FD0-077F-4CA4-BFD1-39FFEFF15770}
    {837A0B0D-F508-4088-8B05-606477DEB905}
    {F261BF5C-81C4-4E81-9ED6-D7EBFA2A9A5B}

    What then gets returned according to the Deployment Status window of 'Requirements not met' is:

    {768F3B65-1695-47B7-9002-B11400CB111D} Shows in the list
    {BB965FD0-077F-4CA4-BFD1-39FFEFF15770} Shows in the list
    {837A0B0D-F508-4088-8B05-606477DEB905} Shows in the list
    {F261BF5C-81C4-4E81-9ED6-D7EBFA2A9A5B} Not Shown in the list

    Again, the only version of SolidWorks I have installed is SolidWorks 2019 sp3, which is product code {F261BF5C-81C4-4E81-9ED6-D7EBFA2A9A5B}, the last one in the list.

    Logically it makes sense that the last product does not show up in the Deployment Status, as the last entry does meet the requirement; The application is installed and the ProductCode was found. The requirement, however still fails to pass. I had added the "z" character to the last ProductCode to verify that this was in fact taking place. When the "z" was added this ensured that the Product Code of "{F261BF5C-81C4-4E81-9ED6-D7EBFA2A9A5B}z" could not be found from the returned list. (The "z" has since been removed.)

    Tuesday, September 10, 2019 7:00 PM
  • OK. Then as noted, the deployment monitoring tool is your friend. It's just a stand-alone .exe that you can copy to the test client and run (or run remotely and connect to the test client).

    Additionally, what happens if you simply use the one product for the product that is installed and an operator of equals? Does that work?


    Jason | https://home.configmgrftw.com | @jasonsandys

    Tuesday, September 10, 2019 7:34 PM
  • Hi,

     

    If you plan to share your log snippets or screenshots, please be careful to hide your sensitive information and confidential content.

     

    Best regards,

    Larry


    Please remember to mark the replies as answers if they help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Wednesday, September 11, 2019 7:08 AM
  • OK. Then as noted, the deployment monitoring tool is your friend. It's just a stand-alone .exe that you can copy to the test client and run (or run remotely and connect to the test client).

    I installed the Deployment Monitoring Tool and took a look at what it was reporting. I found the Deployments and checked the deployment for "Mastercam 2020 for SolidWorks". It listed a bunch of items in the Required Violations tab; all the other product codes installed on the computer. Everything except the product code {F261BF5C-81C4-4E81-9ED6-D7EBFA2A9A5B} was listed under the CurrentValue column. The other columns was as follows.

    RuleExpression: OneOf {{768F3B65-1695-47B7-9002-B11400CB111D}, {BB965FD0-077F-4CA4-BFD1-39FFEFF15770}, {837A0B0D-F508-4088-8B05-606477DEB905}, {F261BF5C-81C4-4E81-9ED6-D7EBFA2A9A5B}}

    RuleName: Installed Application v2 One of {{768F3B65-1695-47B7-9002-B11400CB111D}, {BB965FD0-077F-4CA4-BFD1-39FFEFF15770}, {837A0B0D-F508-4088-8B05-606477DEB905}, {F261BF5C-81C4-4E81-9ED6-D7EBFA2A9A5B}}

    RuleLogicalName: Rule_c4454711-37b0-4862-a7fa-7d6228275ecd

    LogicalName: DeploymentType_582c8bf2-2156-4c92-a862-0bc65259c22a

    Additionally, what happens if you simply use the one product for the product that is installed and an operator of equals? Does that work?


    Jason | https://home.configmgrftw.com | @jasonsandys

    If I set the requirement to be Equals to the single ProductCode, the same Requirements not met occur. Everything but that specific product code shows up in the Rule Values list.

    Wednesday, September 11, 2019 7:30 PM