When installing sqlserver, the installation file is often suspended, and sometimes the machine can be restarted, but sometimes it will always be prompted to restart, "A previous program installation has created a pending file operation on the installation computer. You must restart the computer before running the installer ." In fact, you only need to delete a value of the registry.
Enter regedit in the running window, open the Registry Editor, find PendingFileRenameOperations in KEY_LOCAL_MACHINE \ SYSTEM \ ControlSet001 \ Control \ Session Manager, and delete this key value (this key value is a temporary project of the installer, close the Registry Editor. Re-install.
This is because many programs that install and uninstall files may be used and cannot be operated. Therefore, this value is written in the Registry and executed when the system restarts. After the command is executed, the key value is automatically deleted, however, the operation may fail for some reason, and the key value cannot be deleted.