Get System Setting Windows Vista into NET3SP2_ISVISTA
if Variable NET3SP2_ISVISTA Equals TRUE
  Comment: On Vista, read a registry location to determine the .NET 3 SP2 installation state
  Read Registry Key HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.0\Setup\Version into NET3SP2_REGISTRY_VISTA
  if Variable NET3SP2_REGISTRY_VISTA not Greater Than (Version) 3.0.30617.99
    Set Variable NET3SP2 to FALSE
  else
    Set Variable NET3SP2 to TRUE
  end
else
  Comment: On legacy OS'es, read another registry location to determine the .NET 3 SP2 installation state
  Read Registry Key HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.0\Version into NET3SP2_REGISTRY
  if Variable NET3SP2_REGISTRY not Greater Than (Version) 3.2.30728
    Set Variable NET3SP2 to FALSE
  else
    Set Variable NET3SP2 to TRUE
  end
end
if Variable NET3SP2 Equals FALSE
  Get System Setting Windows 2003 into NET3SP2_IS2003
  Get System Setting Windows XP into NET3SP2_ISXP
  Get System Setting Service Pack 1 into NET3SP2_SP1
  Get System Setting Service Pack 2 into NET3SP2_SP2
  if Variable NET3SP2_ISVISTA Equals FALSE
    if Variable NET3SP2_IS2003 Equals TRUE
      if Variable NET3SP2_SP1 Equals FALSE
        Comment: .NET 3.0 SP2 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 NET3SP2_ISXP Equals TRUE
        if Variable NET3SP2_SP2 Equals FALSE
          Comment: .NET 3.0 SP2 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 2.0 SP2 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.0 Service Pack 2
end
 
