When Installing UiPath Studio And Robot, Error Message "An unexpected error has occurred" Appears

How to resolve the error message "An unexpected error has occurred" received when installing UiPath Studio and Robot?

Issue Description: When installing UiPath Studio and Robot, error message "An unexpected error has occurred" appears .

Below error is logged in the log file:

[4734:09BC][2021-08-20T16:05:11]e000: Error 0x80070005: Failed to write run key value.

[4734:09BC][2021-08-20T16:05:11]e000: Error 0x80070005: Failed to update resume mode.

[4734:09BC][2021-08-20T16:05:11]e000: Error 0x80070005: Failed to begin registration session.

[3C6C:4820][2021-08-20T16:05:11]e000: Error 0x80070005: Failed to begin registration session in per-machine process.

[3C6C:4820][2021-08-20T16:05:11]e000: Error 0x80070005: Failed to register bundle.

Resolution: Exit the anti-virus software.