SQL SERVER – Setup Closed with Exit Code 0x80004005

SQL SERVER - Setup Closed with Exit Code 0x80004005 error Recently I was trying to help one of my clients to install Service Pack 3 for SQL Server 2008 R2 instance. Nothing was coming up when we were hitting setup.exe. I looked into my own blog and found Installation Log Summary File Location – 2012 – 2008 R2. But there was no file getting generated. I looked around of MSDN and found: https://msdn.microsoft.com/en-us/library/ms143702.aspx. The reason was there was exit code 0x80004005.

It says that we should look into %TEMP% folder. So I went to Start > Run > %TEMP% and found sqlsetup.log file as below.

03/01/2016 10:04:11.954 Setup launched
03/01/2016 10:04:11.955 Attempting to determine media source
03/01/2016 10:04:11.956 Media source value not specified on command line argument.
03/01/2016 10:04:11.957 Setup is launched from media directly so default the value to the current folder.
03/01/2016 10:04:11.957 Media source: D:\SOFTWARE\SP3\
03/01/2016 10:04:11.958 Attempt to determine media layout based on file ‘ D:\SOFTWARE\SP3\mediainfo.xml’.
03/01/2016 10:04:11.981 Media layout is detected as: Core
03/01/2016 10:04:11.982 Not a slip stream media, so continuing to run setup.exe from media.
03/01/2016 10:04:11.983 /? or /HELP or /ACTION=HELP specified: false
03/01/2016 10:04:11.984 Help display: false
03/01/2016 10:04:11.985 Checking to see if we need to install .Net version 3.5
03/01/2016 10:04:11.985 Checking to see if we need to install MSI version 4.5
03/01/2016 10:04:11.986 RedistMSI::GetExpectedBuildRevision – Setup expects MSI 4.5.6001.22159 at the minimum
03/01/2016 10:04:11.987 Attempting to get Windows Installer version
03/01/2016 10:04:11.988 Windows Installer version detected: 5.0.7601.18493
03/01/2016 10:04:11.990 RedistMSI::IsVistaRTM – Not Vista RTM build
03/01/2016 10:04:11.991 Required version of Windows Installer is already installed
03/01/2016 10:04:11.992 .Net version 3.5 is already installed.
03/01/2016 10:04:11.992 Windows Installer version 4.5 is already installed.
03/01/2016 10:04:11.993 Patch related actions cannot be run from the local setup.exe, so continuing to run setup.exe from media.
03/01/2016 10:04:11.993 Attempt to initialize SQL setup code group
03/01/2016 10:04:11.994 Attempting to determine security.config file path
03/01/2016 10:04:11.995 Checking to see if policy file exists
03/01/2016 10:04:11.996 .Net security policy file does exist
03/01/2016 10:04:11.997 Attempting to load .Net security policy file
03/01/2016 10:04:12.000 Error: Cannot load .Net security policy file
03/01/2016 10:04:12.001 Error: InitializeSqlSetupCodeGroupCore(64bit) failed
03/01/2016 10:04:12.002 Error: InitializeSqlSetupCodeGroup failed: 0x80004005
03/01/2016 10:04:12.002 Setup closed with exit code: 0x80004005
======================================================================

All I can see is that there is something wrong with .NET security. I asked my .NET expert friend to know if there is any tool to reset the permission? He told CASPOL.EXE can be used to reset the policies.

Caspol.exe (Code Access Security Policy Tool)

So, we went into following directory “C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727” and ran this command: –  caspol.exe -machine -reset

C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727>caspol.exe -machine -reset

If it would have been a 32-bit machine, we would have run the same command under “C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727” folder.

After doing above, the setup was able to start and finish as well.

Reference: Pinal Dave (https://blog.sqlauthority.com)

SQL Error Messages, SQL Server
Previous Post
SQL SERVER – Exception Code c0000005 While Starting SQL Service
Next Post
SQL SERVER – syspolicy_purge_history job failing step: Erase Phantom System Health Records

Related Posts

10 Comments. Leave new

Leave a Reply