3 Replies Latest reply on Oct 9, 2014 9:02 AM by Lawrence Garvin

    Invalid comparison attribute 'StartsWith'

    homes32

      When trying to setup an applicability rule to do a string comparison match on the first part of a string I receive the following error message:

       

      The 'Comparison' attribute is invalid - The value 'StartsWith' is invalid according to its datatype

       

      looking at the XML generated I see that patch manager is placing StartsWith as the comparison type

      -<sdp:ApplicabilityRule SchemaVersion="1.0">

       

       

       

       

      <bar:RegSz Key="HKEY_LOCAL_MACHINE"Subkey="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{6B6244FE-F141-4368-B7CF-C9BC517AD6C3}"Value="DisplayVersion"RegType32="false"Comparison="StartsWith"Data="10.0.3911."/>

       

      </sdp:ApplicabilityRule>


      hower the WSUS BaseTypesSchema states the the correct attribute should be BeginsWith not StartsWith


      <simpleType name="StringComparison">

      <restriction base="token">

      <enumeration value="EqualTo" />

      <enumeration value="BeginsWith" />

      <enumeration value="Contains" />

      <enumeration value="EndsWith" />

      </restriction>

      </simpleType>

       

      What can I do to get my rule working? is there some way I can manually edit the XML until patch manager can be fixed to supply the correct attribute? I am using patch manager version 2.0.2207.02

        • Re: Invalid comparison attribute 'StartsWith'
          Lawrence Garvin

          This does seem to be an implementation bug. I'll refer it to the Product team for investigation.

           

          As for a workaround, are there no more reliable sources for doing a version check? Typically version checks are done by file. Sometimes a product embeds the version in a registry value.

           

          Let's talk about the need to use StartsWith/BeginsWith?

           

          Typically an Applicability Rule is implemented as a LESS THAN comparison against a specific four-part version number. Understanding your specific atypical use-case will help identify an alternative approach.

            • Re: Invalid comparison attribute 'StartsWith'
              homes32

              My main issue with the version numbers is that the program in question gets installed in a directory named after its version number and registry settings get placed in a subkey  named after its version number, however it does not remove subkeys from previous versions so I can't test for a subkey. I also can't go by product ID as they change the CLSID with each release. thinking about that made me realize that my approach above won't work anyway as the uninstall registry key where I can get a version number will only contain a version number from that specific version (CLSID). I went back to using Equals and added a second condition to check for containing the other version number and all seems well.

               

              -<sdp:ApplicabilityRule SchemaVersion="1.0">

               

               

               

               

              -<lar:Or>

               

               

              <bar:RegSz Key="HKEY_LOCAL_MACHINE"Subkey="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{68C8359E-216F-4D63-8D99-4713CC8C45A4}"Value="DisplayVersion"RegType32="false"Comparison="EqualTo"Data="10.0.3911.58"/>

               

               

              <bar:RegSz Key="HKEY_LOCAL_MACHINE"Subkey="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{4DCBD31D-4A5A-46FC-9975-829F4C77FDAB}"Value="DisplayVersion"RegType32="false"Comparison="EqualTo"Data="10.0.3911.24"/>

               

              </lar:Or>

              </sdp:ApplicabilityRule>



              thank you for your response.

              1 of 1 people found this helpful