One of these will definitely do the trick
Error opening file for writing during installation in Windows 10/11
If you try to install or open an application and you see the message "Error opening file for writing", then there is a big problem. This error will stop you: you will not be able to continue until the problem is fixed.
This message is usually caused by incorrect file permissions, but that's not the only cause. Corrupt installation files, existing (and running) applications, your user account settings, and more can all be the culprit.
Fortunately, there are a few steps you can try to fix the problem. If you want to fix the error "error opening file for writing" on Windows, follow these steps.