When installing Microsoft Security Essentials, you get:
Error code 0x8004FF81
You get error code 0x8004FF81 when you are trying to install Microsoft Security Essentials on a computer that has a virus that’s posing as Microsoft Security Essentials. One such virus (W32:FakeAV-FFG[Trj]) writes to the registry keys that MSE uses, tricking the installer to either think that MSE is already installed or fail the installation with error code 0x8004FF81.
To fix error code 0x8004FF81, run a virus scan from another brand of antivirus software to remove the virus then navigate to the following registry key and delete any instances of “Debugger” with a REG_SZ value of “svchost.exe”, before rebooting the PC:
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options
You should now be able to install Microsoft Security Essentials without error code 0x8004FF81.
❗ Note: Personally, whenever I find a computer with a virus infection, I rebuild the PC. The reason for this is that you have no idea what zero day (new and therefore undetectable) viruses could be on your system.