if Variable NET2SP1 Equals FALSE
  Set Variable PROGRESSTEXT to Installing Microsoft .NET Framework 2.0 Service Pack 1
  Set Variable CONTINUEANYWAY to 
  Set Variable NET2SP1_FILEBAG to 
  Set Variable NET2SP1_RESULT to 
  Set Variable NET2SP1_ERROR to 
  Get Common Folder Location Special->Boot Path into NET2SP1_BOOTPATH
  Comment: Define File Bag : #IADIR#\runtimes\net2sp1bin\*.*, include files recursively, get runtime location of files into variable NET2SP1_FILEBAG
  Define File Bag : #IADIR#\runtimes\net2sp1bin.7zip, include files recursively, get runtime location of files into variable NET2SP1_FILEBAG
  Extract 7Zip Archive $NET2SP1_FILEBAG$\net2sp1bin.7zip into folder $NET2SP1_BOOTPATH$ (get result into variable NET2SP1_EXTRACT)
  if Variable NET2SP1_EXTRACT not Equals SUCCESS
    MessageBox: $TITLE$ Setup, Unable to extract temporary files for Microsoft .NET Framework 2.0 Service Pack 1 installation. $NET2SP1_EXTRACT$$NEWLINE$$NEWLINE$Please free up some space on your boot drive and try again.$NEWLINE$$NEWLINE$$TITLE$ Setup cannot continue.
    Terminate Installation
  end
  if Variable NET2SP1_ISVISTA Equals TRUE
    Set Variable PROGRESSMODE to MARQUEE
    Run Program wusa.exe "$NET2SP1_BOOTPATH$\net2sp1bin\Vista\NetFX2.0-KB110806-v6000-x86.msu" /quiet /norestart (WAIT, get result into variable NET2SP1_RESULT)
    Comment: Run Program wusa.exe "$NET2SP1_FILEBAG$\Vista\NetFX2.0-KB110806-v6000-x86.msu" /quiet /norestart (WAIT, get result into variable NET2SP1_RESULT)
    Set Variable PROGRESSMODE to 
    if Variable NET2SP1_RESULT not Equals 0
      if Variable NET2SP1_RESULT not Equals 3010
        Check File Version $NET2SP1_WINDIR$\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll into Variable NET2SP1_FILE
        if Variable NET2SP1_FILE Equals TRUE
          Set Variable NET2SP1_RESULT to 0
        end
      end
    end
  else
    Install/Remove MSI Package $NET2SP1_BOOTPATH$\net2sp1bin\Netfx20a_x86.msi[VSEXTUI=1] (get result into variable NET2SP1_RESULT)
    Comment: Install/Remove MSI Package $NET2SP1_FILEBAG$\Netfx20a_x86.msi[VSEXTUI=1] (get result into variable NET2SP1_RESULT)
  end
  Recursively Delete Files $NET2SP1_BOOTPATH$\net2sp1bin\*.*
  Call DLL Function kernel32.dll->RemoveDirectoryA
  if Variable NET2SP1_ISVISTA Equals TRUE
    if Variable NET2SP1_RESULT not Equals 0
      if Variable NET2SP1_RESULT 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
      else
        MessageBox: $TITLE$ Setup, Microsoft .NET Framework 2.0 Service Pack 1 could not be installed. Please use Windows Update to manually install this update on your system.$NEWLINE$$NEWLINE$$TITLE$ Setup cannot continue.
        Terminate Installation
      end
    end
  else
    if Variable NET2SP1_RESULT 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 NET2SP1_RESULT Equals ERROR
      MessageBox: $TITLE$ Setup, Microsoft .NET Framework 2.0 Service Pack 1 could not be installed.  $NET2SP1_ERROR$$NEWLINE$$NEWLINE$Please use Windows Update to manually install this update on your system.$NEWLINE$$NEWLINE$Would you continue to install $TITLE$ Setup ?
      if Variable CONTINUEANYWAY Equals NO
        Terminate Installation
      end
      Comment: Terminate Installation
    end
  end
end
 
