if Variable DOTNET20SP2_X64 Equals FALSE
  Set x64 - Native 64 bit Windows, AMD64 and EM64T Architectures - installation mode
  Set Variable PROGRESSTEXT to Installing Microsoft .NET Framework 2.0 Service Pack 2 (x64)
  Get System Setting Windows 8 into NET2SP2_IS8_X64
  if Variable NET2SP2_IS8_X64 Equals TRUE
    Set Variable PROGRESSMODE to MARQUEE
    Set Variable DOTNET20SP2_RESULT_X64 to 
    Run Program dism.exe /online /Enable-Feature /all /FeatureName:NetFx3 (WAIT, get result into variable DOTNET20SP2_RESULT_X64)
    Set Variable PROGRESSMODE to 
    if Variable DOTNET20SP2_RESULT_X64 Equals 3010
      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 DOTNET20SP2_RESULT_X64 not Equals 0
      MessageBox: $TITLE$ Setup, Microsoft .NET Framework 2.0 Service Pack 2 (x64) could not be installed.$NEWLINE$$NEWLINE$Please use Windows Update to manually install this update on your system.$NEWLINE$$NEWLINE$$TITLE$ Setup cannot continue.
      Terminate Installation
    end
  else
    Set Variable DOTNET20SP2_FILEBAG_X64 to 
    Set Variable DOTNET20SP2_RESULT_X64 to 
    Set Variable DOTNET20SP2_ERROR_X64 to 
    Get Common Folder Location Special->Boot Path into DOTNET20SP2_BOOTPATH_X64
    Define File Bag : #IADIR#\runtimes\net20sp2bin_x64\*.*, include files recursively, get runtime location of files into variable DOTNET20SP2_FILEBAG_X64
    Get System Setting Windows Vista into DOTNET20SP2_ISVISTA_X64
    if Variable DOTNET20SP2_ISVISTA_X64 Equals TRUE
      Extract 7Zip Archive $DOTNET20SP2_FILEBAG_X64$\vista.7zip into folder $DOTNET20SP2_BOOTPATH_X64$ (get result into variable DOTNET20SP2_EXTRACT_X64)
      if Variable DOTNET20SP2_EXTRACT_X64 not Equals SUCCESS
        MessageBox: $TITLE$ Setup, Unable to extract temporary files for Microsoft .NET Framework 2.0 Service Pack 2 (x64) installation. $DOTNET20SP2_EXTRACT_X64$$NEWLINE$$NEWLINE$Please free up some space on your boot drive and try again.$NEWLINE$$NEWLINE$$TITLE$ Setup cannot continue.
        Terminate Installation
      end
      Set Variable PROGRESSMODE to MARQUEE
      Run Program wusa.exe "$DOTNET20SP2_BOOTPATH_X64$\net20sp2bin_x64\Vista\NetFX2.0-KB948609-v6001-x64.msu" /quiet /norestart (WAIT, get result into variable DOTNET20SP2_RESULT_X64)
      Recursively Delete Files $DOTNET20SP2_BOOTPATH_X64$\net20sp2bin_x64\*.*
      Call DLL Function kernel32.dll->RemoveDirectoryA
      Set Variable PROGRESSMODE to 
      if Variable DOTNET20SP2_RESULT_X64 Equals 3010
        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 DOTNET20SP2_RESULT_X64 not Equals 0
        MessageBox: $TITLE$ Setup, Microsoft .NET Framework 2.0 Service Pack 2 (x64) could not be installed. $DOTNET20SP2_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
    else
      Extract 7Zip Archive $DOTNET20SP2_FILEBAG_X64$\net20sp2bin_x64.7zip into folder $DOTNET20SP2_BOOTPATH_X64$ (get result into variable DOTNET20SP2_EXTRACT_X64)
      if Variable DOTNET20SP2_EXTRACT_X64 not Equals SUCCESS
        MessageBox: $TITLE$ Setup, Unable to extract temporary files for Microsoft .NET Framework 2.0 Service Pack 2 (x64) installation. $DOTNET20SP2_EXTRACT_X64$$NEWLINE$$NEWLINE$Please free up some space on your boot drive and try again.$NEWLINE$$NEWLINE$$TITLE$ Setup cannot continue.
        Terminate Installation
      end
      Install/Remove MSI Package $DOTNET20SP2_BOOTPATH_X64$\net20sp2bin_x64\netfx20a_x64.msi[ADDEPLOY=1] (get result into variable DOTNET20SP2_RESULT_X64)
      Recursively Delete Files $DOTNET20SP2_BOOTPATH_X64$\net20sp2bin_x64\*.*
      Call DLL Function kernel32.dll->RemoveDirectoryA
      if Variable DOTNET20SP2_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 DOTNET20SP2_RESULT_X64 not Equals SUCCESS
        MessageBox: $TITLE$ Setup, Microsoft .NET Framework 2.0 Service Pack 2 (x64) could not be installed. $DOTNET20SP2_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
    end
  end
  Set Win32 - Native 32 bit Windows and Windows 32 on Windows 64 (WOW64) - installation mode
end
 
