If none of the above work, the RDP client installation is fundamentally broken at the OS component store level. An In-Place Upgrade reinstalls Windows without deleting your apps or files.
Steps:
If you are getting this error while trying to install software via RDP: i remote desktop connection error code 0x904 install
Q: Is error 0x904 the same as 0x904f?
A: No. 0x904f relates to a licensing timeout (network), whereas 0x904 is a client installation/initialization failure. If none of the above work, the RDP
Q: Can a VPN cause error 0x904? A: Rarely. VPNs cause network errors (0x204, 0x516). However, some VPNs install network adapters that hook into the RDP stack. Try disconnecting the VPN completely and restarting the RDP client. Q: Is error 0x904 the same as 0x904f
Q: Does this error affect Windows Server RDSH (Remote Desktop Session Host)?
A: Yes. On Windows Server 2016, 2019, and 2022, the 0x904 error appears on the client machine, not the server. You must apply these fixes to the computer initiating the connection.
Q: I see "Error 0x904" when installing Remote Desktop Services role. What now?
A: That indicates a corruption in the Windows Server side. Run DISM /Online /Cleanup-Image /RestoreHealth and ensure the ServerMediaStack feature is not blocked by Group Policy.