When you run .NET Framework 3.5 SP1 setup or Microsoft .NET Framework 3.5 Family Update with a user account whose name begins with a '#' character, the installation will fail.
In this scenario, if you open the verbose MSI log file for the .NET Framework 3.5 SP1 (%temp%\dd_net_framework35*.txt from this list of log files) and search for the string return value 3, you will see an error like the following:
MSI (s) (1A:BC) [11:11:11:111]: Product: Microsoft .NET Framework 3.5 SP1 -- Error 1406.Could not write value InstalledBy to key \SOFTWARE\Microsoft\Updates\Microsoft .NET Framework 3.5 SP1\KB953595. System error. Verify that you have sufficient access to that key, or contact your support personnel.
The registry key that is causing this failure is new in the .NET Framework 3.5 SP1, so this error will not occur when installing the .NET Framework 3.5 or earlier.
The entry for the InstalledBy value in the Registry table of the .NET Framework 3.5 SP1 MSI is set to the value [LogonUser]. This will set the registry value to the built-in Windows Installer property named LogonUser (See MSDN https://msdn.microsoft.com/hi-in/library/aa369780(en-us).aspx for more information).
If the LogonUser property begins with a '#' character, Windows Installer will attempt to write the InstalledBy registry value as a REG_DWORD value (because the '#' character is a special prefix when used in a registry value as described in this MSDN topic at https://msdn.microsoft.com/hi-in/library/aa371168(en-us).aspx, however, if the LogonUser value is not actually a DWORD the MSI will fail with a 1406 error.
How to work around this issue
Run .NET Framework 3.5 SP1 setup with a different user account that does not start with a '#' character. You can either log off and log on with another user account or use the RunAs command to run .NET Framework 3.5 SP1 setup with a different user account that does not start with a '#' character to avoid this error.