if Variable DOTNET40CLIENT_X64 Equals FALSE
  Set x64 - Native 64 bit Windows, AMD64 and EM64T Architectures - installation mode
  Set Variable PROGRESSTEXT to Installing Microsoft .NET Framework Client 4.0 (x64)
  Set Variable DOTNET40CLIENT_FILEBAG_X64 to 
  Set Variable DOTNET40CLIENT_RESULT_X64 to 
  Set Variable DOTNET40CLIENT_ERROR_X64 to 
  Define File Bag : #IADIR#\runtimes\netfx_core_x64\*.*, include files recursively, get runtime location of files into variable DOTNET40CLIENT_FILEBAG_X64
  if Variable DOTNET40CLIENT_IS7 Equals TRUE
    Set Variable PROGRESSTEXT to Installing Microsoft Windows 7 Update for .NET Framework Client 4.0 (x64)
    Set Variable PROGRESSMODE to MARQUEE
    Run Program wusa.exe "$DOTNET40CLIENT_FILEBAG_X64$\Windows6.1-KB958488-v6001-x64.msu" /quiet /norestart (WAIT, get result into variable DOTNET40CLIENT_RESULT_X64)
    Set Variable PROGRESSMODE to 
  else
    if Variable DOTNET40CLIENT_ISVISTA Equals TRUE
      Set Variable PROGRESSTEXT to Installing Microsoft Windows Vista Update for .NET Framework Client 4.0 (x64)
      Set Variable PROGRESSMODE to MARQUEE
      Run Program wusa.exe "$DOTNET40CLIENT_FILEBAG_X64$\Windows6.0-KB956250-v6001-x64.msu" /quiet /norestart (WAIT, get result into variable DOTNET40CLIENT_RESULT_X64)
      Set Variable PROGRESSMODE to 
    else
      if Variable DOTNET40CLIENT_IS2003 Equals TRUE
        Set Variable PROGRESSTEXT to Installing Microsoft Windows Imaging Component (x64)
        Set Variable PROGRESSMODE to MARQUEE
        Run Program $DOTNET40CLIENT_FILEBAG_X64$\wic\update\update.exe /quiet /norestart (WAIT, get result into variable DOTNET40CLIENT_RESULT_X64)
        Set Variable PROGRESSMODE to 
        if Variable DOTNET40CLIENT_RESULT_X64 Equals 3010
        else
          if Variable DOTNET40CLIENT_RESULT_X64 not Equals 0
            MessageBox: $TITLE$ Setup, Microsoft Windows Imaging Component (x64) could not be installed.$NEWLINE$$NEWLINE$$TITLE$ Setup cannot continue.
            Terminate Installation
          end
        end
      end
    end
  end
  Set Variable PROGRESSTEXT to Installing Microsoft .NET Framework Client 4.0 (x64)
  Install/Remove MSI Package $DOTNET40CLIENT_FILEBAG_X64$\netfx_core_x64.msi[VSEXTUI=1 TRANSFORMS=netfx4_aip.mst] (get result into variable DOTNET40CLIENT_RESULT_X64)
  if Variable DOTNET40CLIENT_RESULT_X64 Equals REBOOT
    MessageBox: $TITLE$ Setup, Your computer needs to be restarted before $TITLE$ Setup can continue.$NEWLINE$$NEWLINE$Please save your work in all running programs and click OK to restart your computer. Setup will resume once your computer restarts.$NEWLINE$$NEWLINE$If you click CANCEL, setup will exit. You will have to run setup again at a later time to install $TITLE$.
    if Variable REBOOTNOW Equals OK
      Reboot Computer and Resume Setup
    else
      Terminate Installation
    end
  end
  if Variable DOTNET40CLIENT_RESULT_X64 Equals ERROR
    MessageBox: $TITLE$ Setup, Microsoft .NET Framework Client 4.0 (x64) could not be installed. $DOTNET40CLIENT_ERROR_X64$$NEWLINE$$NEWLINE$Please use Windows Update to manually install this update on your system.$NEWLINE$$NEWLINE$$TITLE$ Setup cannot continue.
    Terminate Installation
  end
  Set Win32 - Native 32 bit Windows and Windows 32 on Windows 64 (WOW64) - installation mode
end
 
