There was an issue in the v3.2 installer that didn't correctly identity .NET 4.5 installations (so that it thought that v4.0 was not installed). This was fixed in the v4.0 installer, but because you are doing an update, the issue is that the part when it uninstalls v3.2 uses the older installer which does not have the fix.

If you open the following registry keys and locate the Version string and change it from 4.5.50709 to 4.0.30319 it will fake the installer into thinking that .NET 4.0 is installed. Once you are done, you can change it back.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Client
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full

If that doesn't work then then you should:

  1. Use a .NET Cleanup Tool to remove .NET 4.5.1, 4.5 and 4.0.
  2. Then install just .NET 4.0 framework (full / expanded version not just client profile)
  3. Follow the instructions above to add the missing registry entries if they are not present
  4. Run the upgrader
  5. Then reinstall .NET 4.5 or .NET 4.5.1 if you need these for other software