if Variable NET3SP2 Equals FALSE
  Set Variable PROGRESSTEXT to Installing Microsoft .NET Framework 3.0 Service Pack 2
  Set Variable NET3SP2_FILEBAG to 
  Set Variable NET3SP2_RESULT to 
  Set Variable NET3SP2_ERROR to 
  Get Common Folder Location Special->Boot Path into NET3SP2_BOOTPATH
  Comment: Define File Bag : #IADIR#\runtimes\NET3SP2bin\*.*, include files recursively, get runtime location of files into variable NET3SP2_FILEBAG
  Define File Bag : #IADIR#\runtimes\NET3SP2bin.7zip, include files recursively, get runtime location of files into variable NET3SP2_FILEBAG
  Extract 7Zip Archive $NET3SP2_FILEBAG$\net3sp2bin.7zip into folder $NET3SP2_BOOTPATH$ (get result into variable NET3SP2_EXTRACT)
  if Variable NET3SP2_EXTRACT not Equals SUCCESS
    MessageBox: $TITLE$ Setup, Unable to extract temporary files for Microsoft .NET Framework 3.0 Service Pack 2 installation. $NET3SP2_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 NET3SP2_ISVISTA Equals TRUE
    Set Variable PROGRESSMODE to MARQUEE
    Run Program wusa.exe "$NET3SP2_BOOTPATH$\net3sp2bin\Vista\NetFX3.0-KB948610-v6001-x86.msu" /quiet /norestart (WAIT, get result into variable NET3SP2_RESULT)
    Comment: Run Program wusa.exe "$NET3SP2_FILEBAG$\Vista\NetFX3.0-KB948610-v6001-x86.msu" /quiet /norestart (WAIT, get result into variable NET3SP2_RESULT)
    Set Variable PROGRESSMODE to 
    if Variable NET3SP2_RESULT not Equals 0
      if Variable NET3SP2_RESULT not Equals 3010
        Read Registry Key HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.0\Setup\Version into NET3SP2_REGISTRY_VISTA
        if Variable NET3SP2_REGISTRY_VISTA Equals 3.0.30618.00
          Set Variable NET3SP2_RESULT to 0
        end
      end
    end
  else
    Install/Remove MSI Package $NET3SP2_BOOTPATH$\net3sp2bin\Netfx30a_x86.msi[VSEXTUI=1] (get result into variable NET3SP2_RESULT)
    Comment: Install/Remove MSI Package $NET3SP2_FILEBAG$\Netfx30a_x86.msi[VSEXTUI=1] (get result into variable NET3SP2_RESULT)
  end
  Recursively Delete Files $NET3SP2_BOOTPATH$\net3sp2bin\*.*
  Call DLL Function kernel32.dll->RemoveDirectoryA
  if Variable NET3SP2_ISVISTA Equals TRUE
    if Variable NET3SP2_RESULT not Equals 0
      if Variable NET3SP2_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 3.0 Service Pack 2 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 NET3SP2_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 NET3SP2_RESULT Equals ERROR
      MessageBox: $TITLE$ Setup, Microsoft .NET Framework 3.0 Service Pack 2 could not be installed.  $NET3SP2_ERROR$$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
 
