Read Registry Key HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5\Version into NET351
if Variable NET351 Greater Than (Version) 3.5.30729.00
  Set Variable NET351 to TRUE
else
  Set Variable NET351 to FALSE
end
if Variable NET351 Equals FALSE
  Get System Setting Windows Vista into NET351_ISVISTA
  Get System Setting Windows 2003 into NET351_IS2003
  Get System Setting Windows XP into NET351_ISXP
  Get System Setting Service Pack 1 into NET351_SP1
  Get System Setting Service Pack 2 into NET351_SP2
  if Variable NET351_ISVISTA Equals FALSE
    if Variable NET351_IS2003 Equals TRUE
      if Variable NET351_SP1 Equals FALSE
        Comment: .NET 3.5 SP1 requires Service Pack 1 on Server 2003
        MessageBox: $TITLE$ Setup, $TITLE$ requires at least Service Pack 1 or later. Please upgrade your operating system and try again.$NEWLINE$$NEWLINE$$TITLE$ Setup cannot continue.
        Terminate Installation
      end
    else
      if Variable NET351_ISXP Equals TRUE
        if Variable NET351_SP2 Equals FALSE
          Comment: .NET 3.5 SP1 requires Service Pack 2 on XP
          MessageBox: $TITLE$ Setup, $TITLE$ requires at least Service Pack 2 or later. Please upgrade your operating system and try again.$NEWLINE$$NEWLINE$$TITLE$ Setup cannot continue.
          Terminate Installation
        end
      else
        Comment: .NET 3.5 SP1 is not supported on older Windows versions
        MessageBox: $TITLE$ Setup, $TITLE$ requires at least Windows XP or later. Please upgrade your operating system and try again.$NEWLINE$$NEWLINE$$TITLE$ Setup cannot continue.
        Terminate Installation
      end
    end
  end
  Set Variable PREREQ to TRUE
  Set Variable PRELIST to $PRELIST$$NEWLINE$Microsoft .NET Framework 3.5 Service Pack 1
end
 
