First and foremost, let me reproduce the complete error message I refer to above: “Copying cluster-resource C:\Program Files\Microsoft SQL Server\MSSQL12.SQL14\MSSQL\Binn\fssres.dll to C:\Windows\system32\fssres.dll failed because the destination file exists and is read-only”
I received the above error message while setting up a SQL Server 2014 instance side by side with an existing copy of SQL Server 2012. The setup caused the “Database Engine” component to fail and later it had to be removed before re-attempting setup.
The root cause of such setup failures is often quite easy to locate when you look at the setup logs, which are conveniently placed under the “C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log” folder on your machine. When I looked at the Detail.txt file from such the problematic server, I could sport the following section:
(01) 2015-01-04 08:09:34 Slp: UpdateClusterResourceAction: Resource type = 'SQL Server FILESTREAM Share' ResourceDllName = fssres.dll Source Location = 'C:\Program Files\Microsoft SQL Server\MSSQL12.SQL14\MSSQL\Binn\' Target Location = 'C:\Windows\system32'.
(01) 2015-01-04 08:09:40 Slp: Type 'SQL Server FILESTREAM Share' not found. Performing copy directly ...
(01) 2015-01-04 08:09:40 Slp: Failed to version-copy file 'C:\Program Files\Microsoft SQL Server\MSSQL12.SQL14\MSSQL\Binn\fssres.dll' to 'C:\Windows\system32\fssres.dll'. Exception data is: System.IO.IOException: The process cannot access the file 'C:\Windows\system32\fssres.dll' because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite)
at Microsoft.SqlServer.Configuration.Cluster.UpdateClusterResourceAction.VersionCopy(String source, String target).
Microsoft.SqlServer.Configuration.Cluster.UpdateClusterResourceException: Copying cluster-resource C:\Program Files\Microsoft SQL Server\MSSQL12.SQL14\MSSQL\Binn\fssres.dll to C:\Windows\system32\fssres.dll failed because the destination file exists and is read-only. ---> System.IO.IOException: The process cannot access the file 'C:\Windows\system32\fssres.dll' because it is being used by another process.
Microsoft.SqlServer.Configuration.Cluster.UpdateClusterResourceAction.VersionCopy(String source, String target)
From the above, it is quite clear that the FSSRES.DLL already exists previously. Now, when I checked the file version it was clear that the existing version is of version SQL Server 2012:
On executing a TASKLIST /M fssres.dll command it quickly became clear that the process which has this DLL already loaded is the RHS.exe for the existing instance of SQL 2012. That instance had an Availability Group already configured hence the RHS.exe was loading the DLL.
Given that the DLL was already loaded by the RHS.exe, there was no way for SQL setup to update it. That is why the SQL 2014 instance setup failed.
The workaround I had to use in the above case was to firstly remove the SQL 2014 Database Engine instance; shutdown the cluster service on the failed node and then re-attempt the SQL 2014 setup. Less than ideal, but till the above issue is handled in the setup, we have very little options. I have logged also a Connect item requesting the Product team to investigate this issue. If you think this issue should be fixed, please vote it up on Connect!