Fix Visual Studio installation error
Many users, like me, who tried to run Microsoft Visual Studio (2013/2015/2017) installer , may get the error window with a message:
The computer needs to be restarted before setup can continue. Please restart the computer and run setup again.
It might happens either when you try to install or uninstall the software. So, as you see, it requires for computer restart. Actually, there are several things you can do:
- Restart your computer
OR - Use trick-script to override “restart-required” flag temporarily
[Method 1] Restarting your PC correctly
Of course, the standard way could be to obey the requirement and restart PC, but not with “Shutdown“, because it might use fast start-up (which ignores some pending changes). So, you should use actual “Restart” button. After logon, you should be able to continue the Visual Studio installation without the issue. If issue still persists, you might read the MS documentation of the issu(there is written, that in some cases you might need to restart it again 2nd times).
[Method 2] Ignore “Restart-Required” flag temporarily
If you dont want to loose time in restarting your computer, I’ve finally found the trick (thanks to installation error logs). So, It took a time till I’ve finally created the cmd(batch) script to change the specific values temporarily to ignore restart requirement. Here is the script you can run at first:
After you run it, then open Visual Studio Installer again, and voila, it should allow you to proceed with installation. But note, the script creates temporary file on your desktop, which you should RUN after you finish installation, to restore the Reboot-Required flag! However, if you already run the installer successfully (i.e. you installed VS after last shutdown and now you want to run it again), then this solution wont help, you need to restart.
(btw, there was also a video on youtube, which only triggers manual update, however, that part is solved much better within the above script, instead of badly manual trigger).
Feel free to comment.