5 Replies Latest reply on Oct 31, 2013 6:22 PM by Lawrence Garvin

    File Exists rule returning wrong result

    Andrew M

      I'm trying to create a simple third party package that evaluates as applicable if a file is missing from the client workstation and as installed if the file exists, but the agent is not reporting the expected status of the package.

       

      The size, version and date of the file are irrelevant and may change so I don't want to include them in the test. The problem I have is that if I leave the "Created Date" and "Modified Date" boxes disabled in the rule, the client reports not applicable and logs the following warning:

      2013-10-31 09:42:07:652 1248 1ba0 Agent WARNING: Failed to evaluate Installed rule, updateId = {921C6E69-6344-4A56-9668-7D5051F14272}.1, hr = 80070002
      2013-10-31 09:42:07:652 1248 1ba0 Agent WARNING: Failed to evaluate Installable rule, updateId = {921C6E69-6344-4A56-9668-7D5051F14272}.1, hr = 80070002
      
      
      
      

       

      If I enable the check boxes with the default values (03/16/09 12:00:00 AM), then on a client where the file is missing, the warning isn't logged, but the package is still evaluated as not applicable instead of applicable/not installed. The agent returns the same result whether or not the parent folder exists on the client.

       

      My rules are very simple.

      Prerequisite:

      <sdp:PrerequisiteRule SchemaVersion="1.0">
        <bar:WindowsVersion Comparison="GreaterThanOrEqualTo"MajorVersion="5"MinorVersion="0"ServicePackMajor="4"ServicePackMinor="0"/>
      </sdp:PrerequisiteRule>
      
      
      
      

       

      Applicability:

      <sdp:ApplicabilityRule SchemaVersion="1.0">
        <lar:Not>
          <bar:FileExists Path="C:\folder\subfolder\9.1.4.3.5.1-03.txt"/>
        </lar:Not>
      </sdp:ApplicabilityRule>
      
      
      
      

       

      Installed:

      <sdp:InstalledRule SchemaVersion="1.0">
        <bar:FileExists Path="C:\folder\subfolder\9.1.4.3.5.1-03.txt"/>
      </sdp:InstalledRule>
      
      
      
      

       

      Interestingly, the packages seems to evaluate exactly as expected if the test file has a simple filename, such as "filename.txt", but something appears to go wrong if I use the example filename "9.1.4.3.5.1-03.txt". I don't know if this is due to the length (14+3 chars), or the multiple dots or something else.

       

      Edit: Title changed to remove reference to file date - problem doesn't seem related to date attribute

        • Re: File Exists rule returning wrong result
          Andrew M

          Now I'm quite confused. I tried some more tests with different file names and paths in the applicability rule and I'm including the full results below

           

          "C:\9.1.4.3.5.1-03.txt" WORKS (returns applicable/not installed)

          "C:\foo.bar.txt" WORKS (returns applicable/not installed), so the problem isn't multiple dots

          "C:\f.o.o.b.a.r-03.txt" FAILS (generates warnings and returns Not Applicable)

          "C:\filename.txt" WORKS (returns applicable/not installed)

           

          "C:\folder\subfolder\9.1.4.3.5.1-03.txt" FAILS (generates warnings and returns Not Applicable)

          "C:\folder\subfolder\filename.txt" WORKS (returns applicable/not installed)

          "C:\folder\subfolder\1.3.5-7.txt" FAILS (generates warnings and returns Not Applicable)

          "C:\folder\subfolder\f.o.o.b.a.r-03.txt" WORKS (returns applicable/not installed)

          "C:\folder\subfolder\foo.bar.txt" FAILS (generates warnings and returns Not Applicable)

          "C:\folder\subfolder\Patch103.txt" FAILS (generates warnings and returns Not Applicable)

           

          Any insight would be extremely helpful!

          • Re: File Exists rule returning wrong result
            Andrew M

            So it appears that the folder names have some significance. I substituted the folder names in some of my previous examples above. Here are two blocks of data from the log file with verbose tracing on.. It doesn't really clear anything up for me, but this is the log for the failed package testing the actual file path "C:\CharlesRiver\91435\client\Patch103.txt"

            2013-10-31    14:45:15:792    1248    223c    Agent    Evaluated Superseded rule, updateId = {963E3ADA-C990-454C-BD9D-E3E30343135E}.1, result = False
            2013-10-31    14:45:15:792    1248    223c    Perf,    UpdateRule(Superseded), time, 0, {963E3ADA-C990-454C-BD9D-E3E30343135E}.1, handler, none, result = False
            2013-10-31    14:45:15:792    1248    223c    EEHndlr    Expression Element detected: Size=156, handlerID=1, weight=1
            2013-10-31    14:45:15:792    1248    223c    EEHndlr    CSubExpressionHandler QI: ISusExprEvaluate3
            2013-10-31    14:45:15:792    1248    223c    EEHndlr    CSubExpressionHandler::AddRef: refcount is 2
            2013-10-31    14:45:15:792    1248    223c    EEHndlr    CSubExpressionHandler::AddRef: refcount is 3
            2013-10-31    14:45:15:792    1248    223c    EEHndlr    CSubExpressionHandler::Release: refcount is 2
            2013-10-31    14:45:15:792    1248    223c    EEHndlr    Expression ID is 8
            2013-10-31    14:45:15:792    1248    223c    EEHndlr    Total number of attributes is 2
            2013-10-31    14:45:15:792    1248    223c    EEHndlr    Number of variable Length attributes is 1
            2013-10-31    14:45:15:792    1248    223c    EEHndlr      EE: FileExists evaluated to Error!, return hr=0x80070002
            2013-10-31    14:45:15:792    1248    223c    EEHndlr    Evaluation of Expression 8 returned hr=0x80070002
            2013-10-31    14:45:15:792    1248    223c    EEHndlr    Expression ID is 8
            2013-10-31    14:45:15:792    1248    223c    EEHndlr    Total number of attributes is 2
            2013-10-31    14:45:15:792    1248    223c    EEHndlr    Number of variable Length attributes is 1
            2013-10-31    14:45:15:792    1248    223c    EEHndlr    CSubExpressionHandler::Release: refcount is 1
            2013-10-31    14:45:15:792    1248    223c    EEHndlr    Final Result of the rule evaluation is Error!
            2013-10-31    14:45:15:792    1248    223c    Agent    WARNING: Failed to evaluate Installed rule, updateId = {963E3ADA-C990-454C-BD9D-E3E30343135E}.1, hr = 80070002
            2013-10-31    14:45:15:792    1248    223c    Agent    Evaluated Installed rule, updateId = {963E3ADA-C990-454C-BD9D-E3E30343135E}.1, result = Error!
            2013-10-31    14:45:15:792    1248    223c    Perf,    UpdateRule(Installed), time, 0, {963E3ADA-C990-454C-BD9D-E3E30343135E}.1, handler, base, result = Error!
            2013-10-31    14:45:15:792    1248    223c    EEHndlr    Operator Detected: Size=336,NumRules=2,Operator=1,Weight=2
            2013-10-31    14:45:15:792    1248    223c    EEHndlr    Expression Element detected: Size=136, handlerID=1, weight=1
            2013-10-31    14:45:15:792    1248    223c    EEHndlr    CSubExpressionHandler QI: ISusExprEvaluate3
            2013-10-31    14:45:15:792    1248    223c    EEHndlr    CSubExpressionHandler::AddRef: refcount is 2
            2013-10-31    14:45:15:792    1248    223c    EEHndlr    CSubExpressionHandler::AddRef: refcount is 3
            2013-10-31    14:45:15:792    1248    223c    EEHndlr    CSubExpressionHandler::Release: refcount is 2
            2013-10-31    14:45:15:792    1248    223c    EEHndlr    Operator Detected: Size=168,NumRules=1,Operator=3,Weight=1
            2013-10-31    14:45:15:792    1248    223c    EEHndlr    Expression Element detected: Size=156, handlerID=1, weight=1
            2013-10-31    14:45:15:792    1248    223c    EEHndlr    CSubExpressionHandler QI: ISusExprEvaluate3
            2013-10-31    14:45:15:792    1248    223c    EEHndlr    CSubExpressionHandler::AddRef: refcount is 3
            2013-10-31    14:45:15:792    1248    223c    EEHndlr    CSubExpressionHandler::AddRef: refcount is 4
            2013-10-31    14:45:15:792    1248    223c    EEHndlr    CSubExpressionHandler::Release: refcount is 3
            2013-10-31    14:45:15:792    1248    223c    EEHndlr    Expression ID is 8
            2013-10-31    14:45:15:792    1248    223c    EEHndlr    Total number of attributes is 2
            2013-10-31    14:45:15:792    1248    223c    EEHndlr    Number of variable Length attributes is 1
            2013-10-31    14:45:15:792    1248    223c    EEHndlr      EE: FileExists evaluated to Error!, return hr=0x80070002
            2013-10-31    14:45:15:792    1248    223c    EEHndlr    Evaluation of Expression 8 returned hr=0x80070002
            2013-10-31    14:45:15:792    1248    223c    EEHndlr    Expression ID is 8
            2013-10-31    14:45:15:792    1248    223c    EEHndlr    Total number of attributes is 2
            2013-10-31    14:45:15:792    1248    223c    EEHndlr    Number of variable Length attributes is 1
            2013-10-31    14:45:15:792    1248    223c    EEHndlr    WARNING: COperatorTreeNode::Evaluate failed with hr=80070002
            2013-10-31    14:45:15:792    1248    223c    EEHndlr    WARNING: COperatorTreeNode::Evaluate failed with hr=80070002
            2013-10-31    14:45:15:792    1248    223c    EEHndlr    CSubExpressionHandler::Release: refcount is 2
            2013-10-31    14:45:15:792    1248    223c    EEHndlr    CSubExpressionHandler::Release: refcount is 1
            2013-10-31    14:45:15:792    1248    223c    EEHndlr    Final Result of the rule evaluation is Error!
            2013-10-31    14:45:15:792    1248    223c    Agent    WARNING: Failed to evaluate Installable rule, updateId = {963E3ADA-C990-454C-BD9D-E3E30343135E}.1, hr = 80070002
            2013-10-31    14:45:15:792    1248    223c    Agent    Evaluated Installable rule, updateId = {963E3ADA-C990-454C-BD9D-E3E30343135E}.1, result = Error!
            2013-10-31    14:45:15:792    1248    223c    Perf,    UpdateRule(Installable), time, 0, {963E3ADA-C990-454C-BD9D-E3E30343135E}.1, handler, base, result = Error!
            2013-10-31    14:45:15:792    1248    223c    Handler    CUHHandlerBase::AddRef: refcount is 2
            2013-10-31    14:45:15:792    1248    223c    Handler    CUHHandlerBase::Release: refcount is 1
            2013-10-31    14:45:15:792    1248    223c    Handler    CUHHandlerBase::AddRef: refcount is 2
            2013-10-31    14:45:15:792    1248    223c    Handler    CUHHandlerBase::Release: refcount is 1
            2013-10-31    14:45:15:792    1248    223c    Perf,    UpdateRule(IsPresent), time, 0, {963E3ADA-C990-454C-BD9D-E3E30343135E}.1, handler, none, result, 0
            2013-10-31    14:45:15:792    1248    223c    Agent    Final detection state for update 673270 (updateId = {963E3ADA-C990-454C-BD9D-E3E30343135E}.1) is "NotApplicable"
            2013-10-31    14:45:15:792    1248    223c    Perf,    DetectForUpdate, time, 0, {963E3ADA-C990-454C-BD9D-E3E30343135E}.1, handler, base, result, "NotApplicable"
            

             

            And this is the successful result of a test for the path "C:\folder\subfolder\Patch103.txt"

            2013-10-31    15:25:51:443    1248    25b0    Agent    Evaluated Superseded rule, updateId = {D1704385-1B60-4D8E-9CB3-437F8DECE76D}.1, result = False
            2013-10-31    15:25:51:443    1248    25b0    Perf,    UpdateRule(Superseded), time, 0, {D1704385-1B60-4D8E-9CB3-437F8DECE76D}.1, handler, none, result = False
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    Expression Element detected: Size=114, handlerID=1, weight=1
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    CSubExpressionHandler QI: ISusExprEvaluate3
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    CSubExpressionHandler::AddRef: refcount is 2
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    CSubExpressionHandler::AddRef: refcount is 3
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    CSubExpressionHandler::Release: refcount is 2
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    Expression ID is 8
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    Total number of attributes is 1
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    Number of variable Length attributes is 1
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    The full path of the filename is C:\folder\subfolder\Patch103.txt
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr      EE: FileExists evaluated to False, return hr=0
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    Evaluation of Expression 8 returned hr=0
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    Expression ID is 8
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    Total number of attributes is 1
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    Number of variable Length attributes is 1
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    Expression Element: Result of Evaluation is False
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    CSubExpressionHandler::Release: refcount is 1
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    Final Result of the rule evaluation is False
            2013-10-31    15:25:51:443    1248    25b0    Agent    Evaluated Installed rule, updateId = {D1704385-1B60-4D8E-9CB3-437F8DECE76D}.1, result = False
            2013-10-31    15:25:51:443    1248    25b0    Perf,    UpdateRule(Installed), time, 0, {D1704385-1B60-4D8E-9CB3-437F8DECE76D}.1, handler, base, result = False
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    Operator Detected: Size=294,NumRules=2,Operator=1,Weight=2
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    Expression Element detected: Size=136, handlerID=1, weight=1
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    CSubExpressionHandler QI: ISusExprEvaluate3
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    CSubExpressionHandler::AddRef: refcount is 2
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    CSubExpressionHandler::AddRef: refcount is 3
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    CSubExpressionHandler::Release: refcount is 2
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    Operator Detected: Size=126,NumRules=1,Operator=3,Weight=1
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    Expression Element detected: Size=114, handlerID=1, weight=1
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    CSubExpressionHandler QI: ISusExprEvaluate3
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    CSubExpressionHandler::AddRef: refcount is 3
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    CSubExpressionHandler::AddRef: refcount is 4
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    CSubExpressionHandler::Release: refcount is 3
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    Expression ID is 8
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    Total number of attributes is 1
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    Number of variable Length attributes is 1
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    The full path of the filename is C:\folder\subfolder\Patch103.txt
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr      EE: FileExists evaluated to False, return hr=0
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    Evaluation of Expression 8 returned hr=0
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    Expression ID is 8
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    Total number of attributes is 1
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    Number of variable Length attributes is 1
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    Expression Element: Result of Evaluation is False
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    Removing child tree for index 0
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    CSubExpressionHandler::Release: refcount is 2
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    Expression ID is 1
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    Total number of attributes is 5
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    Number of variable Length attributes is 0
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr      EE: Evaluating WindowsVersion
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr      EE: WindowsVersion expression evaluated to True, return hr=0
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    Evaluation of expression: 1 returned hr=0
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    Expression ID is 1
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    Total number of attributes is 5
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    Number of variable Length attributes is 0
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    Expression Element: Result of Evaluation is True
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    Removing child tree for index 1
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    CSubExpressionHandler::Release: refcount is 1
            2013-10-31    15:25:51:443    1248    25b0    EEHndlr    Final Result of the rule evaluation is True
            2013-10-31    15:25:51:443    1248    25b0    Agent    Evaluated Installable rule, updateId = {D1704385-1B60-4D8E-9CB3-437F8DECE76D}.1, result = True
            2013-10-31    15:25:51:443    1248    25b0    Perf,    UpdateRule(Installable), time, 0, {D1704385-1B60-4D8E-9CB3-437F8DECE76D}.1, handler, base, result = True
            2013-10-31    15:25:51:443    1248    25b0    Perf,    UpdateRule(IsPresent), time, 0, {D1704385-1B60-4D8E-9CB3-437F8DECE76D}.1, handler, none, result, 0
            2013-10-31    15:25:51:443    1248    25b0    Agent    Final detection state for update 673271 (updateId = {D1704385-1B60-4D8E-9CB3-437F8DECE76D}.1) is "Installable"
            2013-10-31    15:25:51:443    1248    25b0    Perf,    DetectForUpdate, time, 0, {D1704385-1B60-4D8E-9CB3-437F8DECE76D}.1, handler, base, result, "Installable"
            
            
            • Re: File Exists rule returning wrong result
              Lawrence Garvin

              I'm trying to create a simple third party package that evaluates as applicable if a file is missing from the client workstation and as installed if the file exists, but the agent is not reporting the expected status of the package.

               

              The size, version and date of the file are irrelevant and may change so I don't want to include them in the test.

              You should leave the date values unchecked. Checking the date options would require that the file exist *AND* the file has exactly that creation/modification date.

               

              Note, regarding testing for the absence of a file, I would suggest using a File Version Rule rather than a NOT File Exists Rule. If you test for File Version LESS THAN <someValue> (as you'll see we do in most of our packages), if that file is ABSENT, then the rule also evaluates as true because the "version" is, in a manner of speaking, less than the file version being looked for. To minimize complications with actual file versions that may exist, you might check for LESS THAN 999.999.999.999.

              Interestingly, the packages seems to evaluate exactly as expected if the test file has a simple filename, such as "filename.txt", but something appears to go wrong if I use the example filename "9.1.4.3.5.1-03.txt".

              I would say this is an important clue.

              I tried some more tests with different file names and paths in the applicability rule and I'm including the full results below

               

              "C:\9.1.4.3.5.1-03.txt" WORKS (returns applicable/not installed)

              "C:\foo.bar.txt" WORKS (returns applicable/not installed), so the problem isn't multiple dots

              "C:\f.o.o.b.a.r-03.txt" FAILS (generates warnings and returns Not Applicable)

              "C:\filename.txt" WORKS (returns applicable/not installed)

               

              "C:\folder\subfolder\9.1.4.3.5.1-03.txt" FAILS (generates warnings and returns Not Applicable)

              "C:\folder\subfolder\filename.txt" WORKS (returns applicable/not installed)

              "C:\folder\subfolder\1.3.5-7.txt" FAILS (generates warnings and returns Not Applicable)

              "C:\folder\subfolder\f.o.o.b.a.r-03.txt" WORKS (returns applicable/not installed)

              "C:\folder\subfolder\foo.bar.txt" FAILS (generates warnings and returns Not Applicable)

              "C:\folder\subfolder\Patch103.txt" FAILS (generates warnings and returns Not Applicable)

               

              Any insight would be extremely helpful!

              There seems to be absolutely no rhyme-nor-reason with the results obtained above. I would be curious about your exact testing methodologies, as it seems you modified and published ten packages to the same client in the space of 41 minutes. It's entirely possible that the client was not evaluating the actual package you intended it to evaluate. That would depend on whether you published revisions of the same package, or published ten separate packages. Was the WUA evaluating one package at a time, or is there a log capture of the results from all ten variations of these packages within the same detection event?

               

              In any event, the behavior of the Windows Update Agent with respect to any particular rule in the SDP (e.g. this File Exists rule) would be a topic of discussion for Microsoft Support, since the relationships and behavior regarding how the WUAgent interprets the XML and/or deals with circumstances surrounding the filesystem is totally outside the scope of anything Patch Manager can affect. If you believe there is a defect in how the WUAgent handles this rule, you should open a ticket with Microsoft Product Support.

                • Re: File Exists rule returning wrong result
                  Andrew M

                  Thanks for the suggestion. For testing, I delete any previously published test packages, duplicated a template package and changed the applicability and installed rules on each duplicate, then published all test packages. I then performed a detect and report on the client and checked the windowsupdate.log and the status on the wsus server.

                   

                  I tried your suggestion of using a file version rule and am still experiencing the issue. I used the following rules:

                  <sdp:ApplicabilityRule SchemaVersion="1.0">
                   <bar:FileVersion Path="C:\CharlesRiver\91435\client\Patch103.txt"Csidl="0"Comparison="LessThan"Version="9.9.9.9"/>
                   </sdp:ApplicabilityRule>
                  

                   

                  <sdp:InstalledRule SchemaVersion="1.0">
                  <lar:Not>
                   <bar:FileVersion Path="C:\CharlesRiver\91435\client\Patch103.txt"Csidl="0"Comparison="LessThan"Version="9.9.9.9"/>
                  </lar:Not>
                  </sdp:InstalledRule>
                  

                   

                  And got the following result:

                  2013-10-31    16:01:17:203    1248    25e0    Agent    Evaluated Superseded rule, updateId = {40EA0669-051C-421D-9706-571C1D6CA041}.1, result = False
                  2013-10-31    16:01:17:203    1248    25e0    Perf,    UpdateRule(Superseded), time, 0, {40EA0669-051C-421D-9706-571C1D6CA041}.1, handler, none, result = False
                  2013-10-31    16:01:17:203    1248    25e0    EEHndlr    Operator Detected: Size=216,NumRules=1,Operator=3,Weight=1
                  2013-10-31    16:01:17:203    1248    25e0    EEHndlr    Expression Element detected: Size=204, handlerID=1, weight=1
                  2013-10-31    16:01:17:203    1248    25e0    EEHndlr    CSubExpressionHandler QI: ISusExprEvaluate3
                  2013-10-31    16:01:17:203    1248    25e0    EEHndlr    CSubExpressionHandler::AddRef: refcount is 2
                  2013-10-31    16:01:17:203    1248    25e0    EEHndlr    CSubExpressionHandler::AddRef: refcount is 3
                  2013-10-31    16:01:17:203    1248    25e0    EEHndlr    CSubExpressionHandler::Release: refcount is 2
                  2013-10-31    16:01:17:203    1248    25e0    EEHndlr    Expression ID is 10
                  2013-10-31    16:01:17:203    1248    25e0    EEHndlr    Total number of attributes is 4
                  2013-10-31    16:01:17:203    1248    25e0    EEHndlr    Number of variable Length attributes is 1
                  2013-10-31    16:01:17:204    1248    25e0    EEHndlr      EE: FileVersion expression: path=C:\CharlesRiver\91435\client\Patch103.txt, comparison=1
                  2013-10-31    16:01:17:204    1248    25e0    EEHndlr      EE: FileVersion evaluated to Error!, return hr=0x80070002
                  2013-10-31    16:01:17:204    1248    25e0    EEHndlr    Evaluation of Expression 10 returned hr=0x80070002
                  2013-10-31    16:01:17:204    1248    25e0    EEHndlr    Expression ID is 10
                  2013-10-31    16:01:17:204    1248    25e0    EEHndlr    Total number of attributes is 4
                  2013-10-31    16:01:17:204    1248    25e0    EEHndlr    Number of variable Length attributes is 1
                  2013-10-31    16:01:17:204    1248    25e0    EEHndlr    WARNING: COperatorTreeNode::Evaluate failed with hr=80070002
                  2013-10-31    16:01:17:204    1248    25e0    EEHndlr    CSubExpressionHandler::Release: refcount is 1
                  2013-10-31    16:01:17:204    1248    25e0    EEHndlr    Final Result of the rule evaluation is Error!
                  2013-10-31    16:01:17:204    1248    25e0    Agent    WARNING: Failed to evaluate Installed rule, updateId = {40EA0669-051C-421D-9706-571C1D6CA041}.1, hr = 80070002
                  2013-10-31    16:01:17:204    1248    25e0    Agent    Evaluated Installed rule, updateId = {40EA0669-051C-421D-9706-571C1D6CA041}.1, result = Error!
                  2013-10-31    16:01:17:204    1248    25e0    Perf,    UpdateRule(Installed), time, 0, {40EA0669-051C-421D-9706-571C1D6CA041}.1, handler, base, result = Error!
                  2013-10-31    16:01:17:204    1248    25e0    EEHndlr    Operator Detected: Size=364,NumRules=2,Operator=1,Weight=2
                  2013-10-31    16:01:17:204    1248    25e0    EEHndlr    Expression Element detected: Size=136, handlerID=1, weight=1
                  2013-10-31    16:01:17:204    1248    25e0    EEHndlr    CSubExpressionHandler QI: ISusExprEvaluate3
                  2013-10-31    16:01:17:204    1248    25e0    EEHndlr    CSubExpressionHandler::AddRef: refcount is 2
                  2013-10-31    16:01:17:204    1248    25e0    EEHndlr    CSubExpressionHandler::AddRef: refcount is 3
                  2013-10-31    16:01:17:204    1248    25e0    EEHndlr    CSubExpressionHandler::Release: refcount is 2
                  2013-10-31    16:01:17:204    1248    25e0    EEHndlr    Expression Element detected: Size=204, handlerID=1, weight=1
                  2013-10-31    16:01:17:204    1248    25e0    EEHndlr    CSubExpressionHandler QI: ISusExprEvaluate3
                  2013-10-31    16:01:17:204    1248    25e0    EEHndlr    CSubExpressionHandler::AddRef: refcount is 3
                  2013-10-31    16:01:17:204    1248    25e0    EEHndlr    CSubExpressionHandler::AddRef: refcount is 4
                  2013-10-31    16:01:17:204    1248    25e0    EEHndlr    CSubExpressionHandler::Release: refcount is 3
                  2013-10-31    16:01:17:204    1248    25e0    EEHndlr    Expression ID is 10
                  2013-10-31    16:01:17:204    1248    25e0    EEHndlr    Total number of attributes is 4
                  2013-10-31    16:01:17:204    1248    25e0    EEHndlr    Number of variable Length attributes is 1
                  2013-10-31    16:01:17:204    1248    25e0    EEHndlr      EE: FileVersion expression: path=C:\CharlesRiver\91435\client\Patch103.txt, comparison=1
                  2013-10-31    16:01:17:204    1248    25e0    EEHndlr      EE: FileVersion evaluated to Error!, return hr=0x80070002
                  2013-10-31    16:01:17:204    1248    25e0    EEHndlr    Evaluation of Expression 10 returned hr=0x80070002
                  2013-10-31    16:01:17:204    1248    25e0    EEHndlr    Expression ID is 10
                  2013-10-31    16:01:17:204    1248    25e0    EEHndlr    Total number of attributes is 4
                  2013-10-31    16:01:17:204    1248    25e0    EEHndlr    Number of variable Length attributes is 1
                  2013-10-31    16:01:17:204    1248    25e0    EEHndlr    WARNING: COperatorTreeNode::Evaluate failed with hr=80070002
                  2013-10-31    16:01:17:204    1248    25e0    EEHndlr    CSubExpressionHandler::Release: refcount is 2
                  2013-10-31    16:01:17:204    1248    25e0    EEHndlr    CSubExpressionHandler::Release: refcount is 1
                  2013-10-31    16:01:17:204    1248    25e0    EEHndlr    Final Result of the rule evaluation is Error!
                  2013-10-31    16:01:17:204    1248    25e0    Agent    WARNING: Failed to evaluate Installable rule, updateId = {40EA0669-051C-421D-9706-571C1D6CA041}.1, hr = 80070002
                  2013-10-31    16:01:17:204    1248    25e0    Agent    Evaluated Installable rule, updateId = {40EA0669-051C-421D-9706-571C1D6CA041}.1, result = Error!
                  2013-10-31    16:01:17:204    1248    25e0    Perf,    UpdateRule(Installable), time, 0, {40EA0669-051C-421D-9706-571C1D6CA041}.1, handler, base, result = Error!
                  2013-10-31    16:01:17:204    1248    25e0    Handler    CUHHandlerBase::AddRef: refcount is 2
                  2013-10-31    16:01:17:204    1248    25e0    Handler    CUHHandlerBase::Release: refcount is 1
                  2013-10-31    16:01:17:204    1248    25e0    Handler    CUHHandlerBase::AddRef: refcount is 2
                  2013-10-31    16:01:17:204    1248    25e0    Handler    CUHHandlerBase::Release: refcount is 1
                  2013-10-31    16:01:17:204    1248    25e0    Perf,    UpdateRule(IsPresent), time, 0, {40EA0669-051C-421D-9706-571C1D6CA041}.1, handler, none, result, 0
                  2013-10-31    16:01:17:204    1248    25e0    Agent    Final detection state for update 673274 (updateId = {40EA0669-051C-421D-9706-571C1D6CA041}.1) is "NotApplicable"
                  2013-10-31    16:01:17:204    1248    25e0    Perf,    DetectForUpdate, time, 0, {40EA0669-051C-421D-9706-571C1D6CA041}.1, handler, base, result, "NotApplicable"
                  
                    • Re: File Exists rule returning wrong result
                      Lawrence Garvin

                      <sdp:InstalledRule SchemaVersion="1.0"> 

                      <lar:Not> 

                      <bar:FileVersion Path="C:\CharlesRiver\91435\client\Patch103.txt"Csidl="0"Comparison="LessThan"Version="9.9.9.9"/> 

                      </lar:Not> 

                      </sdp:InstalledRule> 

                      Only use the File Version rule in the Applicability Ruleset, in place of the previous NOT File Exists rule.

                       

                      The Installed Ruleset can use either, but since you don't have an actual version number to test against, a File Version rule in the Installed Ruleset will always return FALSE, ergo the package is never installed, and thus it will either be Not Applicable or Not Installed, even when it shouldn't. You should continue to use the File Exists rule in the Installed Ruleset.

                       

                      2013-10-31    16:01:17:204    1248    25e0    EEHndlr      EE: FileVersion expression: path=C:\CharlesRiver\91435\client\Patch103.txt, comparison=1 

                      2013-10-31    16:01:17:204    1248    25e0    EEHndlr      EE: FileVersion evaluated to Error!, return hr=0x80070002 

                      0x80070002 is:

                      0x80070002-2147024894ERROR_FILE_NOT_FOUNDThe System cannot find the file specified

                       

                      Which in the case where you know that the file actually does exist, suggests that the ACLs are preventing the WUAgent from being able to read the folder/subfolder where the file is actually found.

                       

                      I would suggest first testing the package against a known readable to everybody place ... like a subfolder of %ProgramFiles%, or the %windir%\temp folder, so you can eliminate questions about paths and ACLs, and focus on whether there is, or is not, an issue with the filename itself.