Get System Setting Windows 8.1 into DOTNET452_IS81
Get System Setting Windows in 64 bit Mode into ISWINDOWS64BIT
if Variable ISWINDOWS64BIT Equals TRUE
  Set x64 - Native 64 bit Windows, AMD64, EM64T, and ARM64 Architectures - installation mode
end
Read Registry Key HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\Version into DOTNET452_X86X64
if Variable ISWINDOWS64BIT Equals TRUE
  Set Win32 - Native 32 bit Windows and Windows 32 on Windows 64 (WOW64) - installation mode
end
 
if Variable DOTNET452_IS81 Equals TRUE
  if Variable DOTNET452_X86X64 Greater Than (Version) 4.5.51649
    Set Variable DOTNET452_X86X64 to TRUE
  else
    Set Variable DOTNET452_X86X64 to FALSE
  end
else
  if Variable DOTNET452_X86X64 Greater Than (Version) 4.5.51208
    Set Variable DOTNET452_X86X64 to TRUE
  else
    Set Variable DOTNET452_X86X64 to FALSE
  end
end
 
if Variable DOTNET452_X86X64 Equals FALSE
  Get System Setting Windows 8 into DOTNET452_IS8
  Get System Setting Windows 7 into DOTNET452_IS7
  Get System Setting Windows Vista into DOTNET452_ISVISTA
  Get System Setting Service Pack 2 into DOTNET452_SP2
   
  if Variable DOTNET452_ISVISTA Equals FALSE
    Comment: .NET 4.52  is not supported on older Windows versions
    MessageBox: $TITLE$ Setup, $TITLE$ requires at least Windows Vista or later. Please upgrade your operating system and try again.$NEWLINE$$NEWLINE$$TITLE$ Setup cannot continue.
    Terminate Installation
  else
    if Variable DOTNET452_IS7 Equals FALSE
      if Variable DOTNET452_SP2 Equals FALSE
        Comment: .NET 4.52  requires Service Pack 2 on Windows Vista
        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
    end
  end
   
  Set Variable PREREQ to TRUE
  Set Variable PRELIST to $PRELIST$$NEWLINE$Microsoft .NET Framework 4.52 (x86/x64)
end
 
