
Problem
When trying to install or uninstall SQL Server, the setup process fails with the following message:
Rule "Restart Computer" failed.
A computer restart is required. You must restart this computer before installing SQL Server.
This happens because there are pending restart operations on the machine and the setup needs a reboot before continuing. The problem is, that sometimes, even if the computer is restarted, the setup process can fail at exactly the same step.
Solution
Check if there are pending rename file operations that needs to be done after the computer is restarted.
To do this open a registry editor (Start -> Run -> Regedit) and navigate to the following path:
HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\
Right click on the PendingFileRenameOperations registry key from the right pane, to see the files that will be renamed after the restart.
These entries are added to the registry when a program needs to rename a file that is being used. The file names are stored in this registry key until the system is restarted so they can be renamed.
The best approach is to rename the PendingFileRenameOperations registry key (PendingFileRenameOperations_OLD for example) and re-run the SQL Server Setup. This time, the setup will pass the "Restart Computer" rule. After the computer starts you can rename back the PendingFileRenameOperations_OLD to PendingFileRenameOperations registry key or add the containing entries to the newly created PendingFileRenameOperations key (if this is the case).
Sometimes the PendingFileRenameOperations registry key is not present in the above path. In this situation, a solution will be to avoid the pending restart by installing / uninstalling SQL from the command line. To do this go to the SQL installation folder and from the cmd prompt execute the following:
setup.exe /SkipRules=RebootRequiredCheck /ACTION=install
or
setup.exe /SkipRules=RebootRequiredCheck /ACTION=uninstall
By doing this, the setup will skip the rule that verifies if there are any restart pending operations.
No.2
Error
Attributes do not match. Present attributes (Directory, Compressed) , included attributes (0), excluded attributes (Compressed, Encrypted)
When you will see this issue
You may hit this error when you are tying to upgrade SQL Server and drive where SQL Server binaries and/or shared features are installed is compressed with NTFS windows file system compression and/or encryption is enabled.
Resolution
Go to “C:\\Program Files” and check the properties of “Microsoft SQL Server” folder. Here in the properties window you will fins advanced option under the General tab. Now go to advanced option and look for “Compress contents to save disk space” and “encrypt contents to secure data”. You will find these options as checked. Please uncheck these options and apply the changes. Now run the install again and it will run successfully.
No.3
安装SQL server 2008 R2时遇到如下问题,在安装到Setup Support Files 后,系统一闪而过下图错误信息后安装中断。
报错:preparing SQL server 2008 R2 setup error details,please wait。如下图:
由于此次安装的系统为英文版,所以要求安装的SQL server 为英文,但是在安装文件中的
X:\\Installation\\sql server 2008 R2\\1033_enu_lp\\x86 目录中缺少相关文件,所以意外中断。
解决方法:
将X:\\Installation\\sql server 2008 R2\\2052_chs_lp\\x86目录中的setup文件夹复制到其下,然后重新安装。
