The SMS Installer does not correctly compare string values that start with numbers (832503)



The information in this article applies to:

  • Microsoft Systems Management Server Installer 2.0

SYMPTOMS

The Microsoft Systems Management Server (SMS) Installer "If/While Statement" script item (action) does not correctly work with the "Expression True" operation when the values to compare are two strings that start with numbers, but that contain non-numeric characters.

For example, the expression "2003-08-25" = "2003/07/11" is incorrectly evaluated as TRUE. The same problem occurs if you use "Expression True" to evaluate variables. Additionally, the "Set Variable" action has the same problem with the "Evaluate Expression" operation.

CAUSE

The SMS Installer treats a string that starts with a number as a numeric value. The SMS Installer compares the integers only up to the first non-numeric character. For example, in the strings "2003-08-25" and "2003/07/11", the SMS Installer stops at the - and /characters.

RESOLUTION

A supported hotfix is now available from Microsoft, but it is only intended to correct the problem that this article describes. Apply it only to systems that are experiencing this specific problem.

To resolve this problem, contact Microsoft Product Support Services to obtain the hotfix. For a complete list of Microsoft Product Support Services telephone numbers and information about support costs, visit the following Microsoft Web site:Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.The English version of this hotfix has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.
   Date         Time   Version         Size       File name     Platform
   ---------------------------------------------------------------------
   09-Jan-2004  19:03  2.0.158.0       9,797,632  Smsimain.exe  x86

	
Note Because of file dependencies, the most recent hotfix or feature that contains these files may also contain additional files.

To install this fix, run the Smsimain.exe program, and then follow the instructions.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section of this article.

WORKAROUND

To work around this issue for the "If/While Statement" script item, follow these steps:
  1. Assign the first string that you want to compare to a variable.
  2. Specify the variable name in the If Variable field.
  3. Select Equals or Not Equal as the operator and add the second string to the The Value field.

MORE INFORMATION

The hotfix that is described in this article updates only the following actions and operators in the SMS Installer:
  • "If/While Statement" - "Expression True"
  • "Set Variable" - "Evaluate Expression"
Additionally, this update only affects the equality (=) and non-equality (<>) evaluations. The other evaluations, like <, >, <=, and >=, work only with whole numbers; they do not work with strings.

After you install the hotfix, the two SMS Installer script items examine the data that you want to compare for any non-numeric characters. If the script item finds a non-numeric character, the script item treats the data as a string instead of as a number.

The return value from the "Set Variable" script item in combination with the "Evaluate Expression" operation may sometimes be -1 instead of 1. (This issue also occurs with earlier versions of the SMS Installer. The issue is not specific to this hotfix.) A value of -1 is returned when you use the <> (non-equality) operator to compare two strings and the expression evaluates to TRUE. Microsoft recommends that you look for a value that is not equal to 0 to determine if an expression evaluates to TRUE. This issue does not affect the "If/While Statement" script item in combination with the "Expression True" operation.

Modification Type:MinorLast Reviewed:6/5/2006
Keywords:kbHotfixServer kbQFE KB832503