XP Service Pack 2 Install Problems

When I tried to upgrade a user's home system running Windows XP Professional from Service Pack 1 to Service Pack 2, I encountered a number of problems which took me a considerable amount of time to resolve.

When I tried to install SP2 from the administrator's account, I got an error message part way through in the "backing up files" phase that "Service Pack 2 Setup could not backup registry key HKCR\.DVR-MS to file C:\WINDOWS\$NTServicePackUninstall$\reg00013. 5: Access is denied."

SP2 cant backup registry key

When I ran regedit and tried to open the key, I got the message "Cannot open .dvr.ms: Error while opening key.

Regedit SP2 install error
opening key

I right-clicked on the .dvr-ms registry key and chose "Permissions". I then saw the message "You do not have permission to view the current permission settings for .dvr-ms, but you can make permission changes." I clicked on "OK" A window opened that allowed me to add access to the key.

Permissions for .dvr-ms key

I clicked on the "Add" button and added access for the Administrators group and the System account (click on "Add", put in account and/or group names, click on "Check Names", and then "OK" when they are confirmed).

Add users or groups

I gave full control for the Administrators group and the System account and then clicked on "OK".

Adding permissions

When I clicked on "OK", I got the message "Unable to save permission changes on .dvr-ms. Access is denied." So I clicked on "Cancel". So I went through the process of changing the permissions again, except when the "Permissions for .dvr-ms" window opened, instead of clicking on "Add", I clicked on "Advanced". I then clicked on the "Owner" tab. In the "Current owner of this item" field, I saw "Unable to display current owner." Below it was a "Change owner to" field. I selected the Administrator account as the owner by clicking on it to highlight it. I then checked "Replace owner on subdirectories and objects and clicked on "OK".

Advanced security
settings for .dvr-ms

But I still got the access is denied message. But when I rechecked the permissions, I could see that the System account now had access to the key. I then added the Administrator account again and gave the System and Administrator account full access to the key.

I then saw the following for the key:

NameTypeData
DefaultREG_SZWMP.DVR-MSFile
PerceivedTypeREG_SZvideo

I then went back to the "Service Pack 2 Setup could not backup registry key HKCR\.DVR-MS to file C:\WINDOWS\$NTServicePackUninstall$\reg00013. 5: Access is denied" error message window and clicked on "Retry". The backup then proceeded. However, minutes later it aborted with an "Access is denied" error message.

SP2 install - access is denied

When I clicked on "OK" for that window, another window opened with the message below:

Service Pack 2 Setup Error
Service Pack 2 installation did not complete.

Select "OK to undo the change that have been made.
Service Pack 2 installation did not complete. Select "OK" to undo the changes that have been made.

[ OK ]

When I clicked on "OK", another window opened with the following error message displayed.

Service Pack 2 Setup Error
Service Pack 2 installation did not complete.

Windows XP has been partially updated and may not work properly.
[ OK ]

A log file is created for a Service Pack 2 installation. The log file is %WINDIR%\svcpack.log. %WINDIR% is normally C:\Windows on a Windows XP system, though it may also be C:\WINNT, if the system was upgraded from an earlier verion of Windows; you can determine what it is on a system by using the command echo %WINDIR% at a command prompt. At the end of that log file, I saw the following:


3355.110: Copied file:  C:\WINDOWS\INF\msmsgs.inf
3355.156: Copied file:  C:\WINDOWS\System32\spool\DRIVERS\W32X86\3\unires.dll
3355.391: Copied file:  C:\WINDOWS\System32\spool\DRIVERS\W32X86\3\unidrvui.dll
3355.531: Copied file:  C:\WINDOWS\System32\spool\DRIVERS\W32X86\3\unidrv.dll
3364.844: PruneCatalogsFromHotfixes:RegQueryValueEx Failed: 0x0 
3364.844: PruneCatalogsFromHotfixes:RegQueryValueEx Failed: 0x0 
3364.844: PruneCatalogsFromHotfixes:RegQueryValueEx Failed: 0x0 
3364.844: PruneCatalogsFromHotfixes:RegQueryValueEx Failed: 0x0 
3364.844: PruneCatalogsFromHotfixes:RegQueryValueEx Failed: 0x0 
3364.844: PruneCatalogsFromHotfixes:RegQueryValueEx Failed: 0x0 
3364.844: PruneCatalogsFromHotfixes:RegQueryValueEx Failed: 0x0 
3364.844: PruneCatalogsFromHotfixes:RegQueryValueEx Failed: 0x0 
3365.641: PruneCatalogsFromHotfixes:RegQueryValueEx Failed: 0x0 
3365.641: PruneCatalogsFromHotfixes:RegQueryValueEx Failed: 0x0 
3365.641: PruneCatalogsFromHotfixes:RegQueryValueEx Failed: 0x0 
3365.641: PruneCatalogsFromHotfixes:RegQueryValueEx Failed: 0x0 
3365.641: PruneCatalogsFromHotfixes:RegQueryValueEx Failed: 0x0 
3365.641: PruneCatalogsFromHotfixes:RegQueryValueEx Failed: 0x0 
3365.641: PruneCatalogsFromHotfixes:RegQueryValueEx Failed: 0x0 
3365.641: PruneCatalogsFromHotfixes:RegQueryValueEx Failed: 0x0 
3365.641: PruneCatalogsFromHotfixes:RegQueryValueEx Failed: 0x0 
3365.641: PruneCatalogsFromHotfixes:RegQueryValueEx Failed: 0x0 
3365.641: PruneCatalogsFromHotfixes:RegQueryValueEx Failed: 0x0 
3365.641: PruneCatalogsFromHotfixes:RegQueryValueEx Failed: 0x0 
3365.641: PruneCatalogsFromHotfixes:RegQueryValueEx Failed: 0x0 
3365.641: PruneCatalogsFromHotfixes:RegQueryValueEx Failed: 0x0 
3365.641: PruneCatalogsFromHotfixes:RegQueryValueEx Failed: 0x0 
3365.641: PruneCatalogsFromHotfixes:RegQueryValueEx Failed: 0x0 
3365.641: PruneCatalogsFromHotfixes:RegQueryValueEx Failed: 0x2 
3365.641: PruneCatalogsFromHotfixes:RegQueryValueEx Failed: 0x0 
3367.125: PruneCatalogsFromHotfixes:RegQueryValueEx Failed: 0x0 
3368.531: PruneCatalogsFromHotfixes:RegQueryValueEx Failed: 0x0 
3368.531: PruneCatalogsFromHotfixes:RegQueryValueEx Failed: 0x0 
3368.531: PruneCatalogsFromHotfixes:RegQueryValueEx Failed: 0x2 
3368.531: PruneCatalogsFromHotfixes:RegQueryValueEx Failed: 0x2 
3368.531: PruneCatalogsFromHotfixes:RegQueryValueEx Failed: 0x0 
3368.531: PruneCatalogsFromHotfixes:RegQueryValueEx Failed: 0x0 
3368.531: PruneCatalogsFromHotfixes:RegQueryValueEx Failed: 0x0 
3368.531: PruneCatalogsFromHotfixes:RegQueryValueEx Failed: 0x2 
3371.360: Num Ticks for Copying files : 698125
3371.547: DoRegistryUpdates:SetupInstallFromInfSection Failed for ProductInstall.GlobalRegistryChanges.Install error: 0x5 
3371.547: INF_REGISTRY Failed
3371.610: DoInstallation:DoRegistryUpdates failed
3388.516: Unregistration of sprecovr successful
3388.891: Access is denied.
3602.485: Message displayed to the user: Access is denied.
3602.485: User Input: OK
3602.485: Service Pack 2 installation did not complete.

Select 'OK' to undo the changes that have been made.
3804.610: Message displayed to the user: Service Pack 2 installation did not complete.

Select 'OK' to undo the changes that have been made.
3804.610: User Input: OK
3804.610: Starting process:  C:\WINDOWS\$NtServicePackUninstall$\spuninst\spuninst.exe /~ -u -z
4411.156: Software Update Rollback has completed with return code 0xbc2.  This rollback requires a reboot.
4411.172: Service Pack 2 installation did not complete.

Windows XP has been partially updated and may not work properly.

I searched through the registry for references to PruneCatalogsFromHotfixes, but found none.

Microsoft has a knowledgebase article titled You receive an "Access is denied" error message when you try to install Windows XP Service Pack 2 or Windows Server 2003 Service Pack 1, that suggests one should look in the svcpack.log file for the following lines:

xxxx.xxx: DoInstallation:DoRegistryUpdates failed.
xxxx.xxx: Access is denied.
xxxx.xxx: Message displayed to the user: Access is denied.
Note xxxx.xxx represents the timestamp of each entry.

If they are found, the article suggests enabling verbose logging for setupapi.log, another log file found in %WINDIR%. Instructions for enablling verbose logging are found in How to enable verbose logging on a Windows XP-based computer. The instructions on that page are as follows

INTRODUCTION

When you troubleshoot installation issues or setup issues, sometimes you must review registry entries that are listed in the Setupapi.log file. By default, the Setupapi.log file does not contain registry information. To record registry information in the Setupapi.log file, you must enable verbose logging on a Microsoft Windows XP-based computer.

RESOLUTION

Warning Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you reinstall your operating system. Microsoft cannot guarantee that these problems can be solved. Modify the registry at your own risk.
To enable verbose logging on a Windows XP-based computer, follow these steps:

1.Click Start, click Run, type regedit in the Open field, and then click OK
2.Locate and then double-click LogLevel under the following registry subkey:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Setup

3.On the Edit DWORD Value window, click to select Hexadecimal on the Base pane.
4.Type 0000FFFF in the Value data box.
5.Click OK.

Note When you enable verbose logging, the size of the Setupapi.log file grows to approximately 4 megabytes (MB). To reset the registry value after you troubleshoot, follow these steps again. However, set the DWORD value to 0 in step 4.

If you don't want to navigate through the registry to find the value of the key, you can use a reg query command as shown below to query the value for LogLevel.


C:\Documents and Settings\Administrator>reg query HKEY_LOCAL_MACHINE\SOFTWARE\M
crosoft\Windows\CurrentVersion\Setup /v loglevel

! REG.EXE VERSION 3.0

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup
    loglevel    REG_DWORD       0x20000000

On the system I was working on the loglevel value in the registry was hexadecimal 20000000, which is decimal 536870912, not 0, when I checked it. And the log file was already about 4 MB (it was 3.64 MB). I set the value to hexadecimal 0000FFFF (decimal 65535) as suggested and then reran the Service Pack 2 installation again.

When it started, I got another error message.

Service Pack 2 Setup Error
The system must be restarted before installing the Service Pack 2, to allow some prior file update operations to complete. (These operations were previously scheduled by some other install or uninstall operation.)

[ OK ]

I rebooted and started the installation again, only to get yet another error message.

Service Pack 2 Setup Error
The requested section was not present in the activation context

[ OK ]

As is often the case with Microsoft products, the error message is not very clear. So what section is not present? When I clicked on "OK", I got the message "Service Pack 2 installation did not complete." When I looked in the svcpack.log file again, I saw the following at the end of the file.


128.421: AnalyzePhaseSix used 328 ticks
844.484: IsSPBetaKey:CoCreateInstance Failed: 0x80040154 
846.515: Trying CheckVLKForBlock again
846.796: DoInstallation:SetupOpenInfFile for OldUninstallInf file C:\WINDOWS\$NtServicePackUninstall$\spuninst\spuninst.inf not found: 0x3 
846.796: CreateUninstall = 1,Directory = C:\WINDOWS\$NtServicePackUninstall$ 
847.296: Error: CheckVLKForBlock failed
847.296: Inventory complete: ReturnStatus=536753840, 828781 ticks
847.296: Num Ticks for invent : 828781
857.390: UnRegisterSpuninstForRecovery, failed to delete SpRecoverCmdLine value, error 0x2
857.390:  DoInstallation: Failed to unregistering spuninst.exe for recovery.
857.453: The requested section was not present in the activation context.
1059.109: Message displayed to the user: The requested section was not present in the activation context.
1059.109: User Input: OK
1059.125: Service Pack 2 installation did not complete.
1095.296: Message displayed to the user: Service Pack 2 installation did not complete.
1095.296: User Input: OK
1095.296: Update.exe extended error code = 0x1ffe36b0
1095.312: Update.exe return code was masked to 0x643 for MSI custom action compliance.

But it wasn't immediately apparent to me how that information could lead me to a fix either.

At xp sp2 install error requested section was not found in the, I found a posting by someone who had corrected a similar problem installing XP SP2 by reregistering two DLL files, licdll.dll and regwizc.dll. I looked in setupapi.log for references to the files and saw the following references to libcdll.dll, but found none for regwizc.dll.


#-336 Copying file "c:\14ab6b38223829cf9ab5856be8\i386\licdll.dll" to "C:\WINDOWS\System32\licdll.dll" via temporary file "C:\WINDOWS\System32\SET3C6.tmp".

#-336 Copying file "c:\049e13535f856814739b108bda\i386\licdll.dll" to "C:\WINDOWS\System32\licdll.dll" via temporary file "C:\WINDOWS\System32\SET5A8.tmp".
#W190 File "C:\WINDOWS\System32\SET5A8.tmp" marked to be moved to "C:\WINDOWS\System32\licdll.dll" on next reboot.

I wasn't sure that reregistering the DLL files would help, but I tried it anyway. When I entered the command regsvr32.exe licdll.dll at a command promt, I got the error message, DllRegister Server in licdll failed. Return code was 0x80020009. Entering the command, regsvr32.exe regwizc.dll, however, produced the message DllRegisterServer in regwizc.dll succeeded. So I tried the installation of Service Pack 2 again. But I got the same "The requested section was not present in the activation context" error message again.

I next went through the steps listed at Service Pack Installation Checklist.

I had previously scanned the system for adware/spyware with Spybot Search & Destroy 1.4 and Bazooka Adware and Spyware Scanner and removed all of the adware/spyware they found. I had also scanned the system for viruses with Symantec AntiVirus Corporate Edition 8.0 and removed viruses it found. I tried the "Do you have parasites?" scan at http://www.aumha.org/a/noads.php. That scan found nothing.

The system had 1.24 GB of free space. When I first tried to install SP 2, I had received warnings about disk space, so I had freed additional space to get to 1.24 GB of space. The checklist recommended having at least 2 GB of space, so I attempted to delete everything in the user's C:\Documents and Settings\Trip\Local Settings\Temp directory, since that was consuming about 1/2 GB of space. ButI received the message "Cannot remove folder 5KTXYHQR: It is being used by another person or program. Close any programs that might be using the file and try again." Yet that folder didn't appear when I looked in the Temp directory with Internet Explorer or from a command prompt, even though Windows Explorer was set to display hidden files and folders and not hide protected operating system files. That made me suspicious that spyware was still on the system, since spyware will often hide itself in folders or files it makes invisible in Windows Explorer and from a command prompt. And I would not expect any files or folders to be open in the user's Temp directory when I was logged into the Administrator account, not that user's account. I also searched the registry for any references to 5KTXYHQR, but found none.

I downloaded Sysinternal's RootkitRevealer utility and ran it. When I looked at its scan results, I found no reference to 5KTXYHQR, however, and nothing that looked suspicious to me.

RootkitRevealer scan
results

I then searched to see if it might be a subdirectory within the user's temp directory and found it.


C:\Documents and Settings\Trip\Local Settings\Temp>dir /s/ad 5KTXYHQR
 Volume in drive C has no label.
 Volume Serial Number is 148D-85C8

 Directory of C:\Documents and Settings\Trip\Local Settings\Temp\Temporary Inter
net Files\Content.IE5

03/13/2006  11:20 PM    <DIR>          5KTXYHQR
               0 File(s)              0 bytes

     Total Files Listed:
               0 File(s)              0 bytes
               1 Dir(s)   1,802,342,400 bytes free

When I went to that directory, however, I didn't find any files in it. In order to find out which process had the directory open I downloaded and installed Sysinternal's Process Explorer. I ran the program and clicked on "Find" then "Find handle or DLL". I then searched for "5KTXYHQR". I found that the cleanmgr.exe process had the directory open.

Process Explorer 5KTXYHQR

I had run Microsoft Windows Disk Cleanup utility earlier. It was taking an extremely long time to get through just the first phase of its analysis of what could be done to free disk space, so I canceled it. But apparently the process remained running in the background. I ran the Windows Task Manager and killed the process.

Task Manager - cleanmgr.exe

I rechecked the free disk space. I found that 1.65 GB was now free. I reran the SP 2 installation. But I still got the "The requested section was not present in the activation context." error message. I rebooted and tried again with the same results.

I went back to trying suggestions I found in a posting, xp sp2 install error requested section was not found in the in a Wugnet forum. That posting suggested using secedit, which analyzes system security by comparing your current configuration to at least one template. I tried the command listed below with the results shown also. Note: there is a typo in the the command listed on the referenced webpage with a "/" before regkeys in the command. That slash shouldn't be there.


C:\Documents and Settings\Administrator>secedit /configure /cfg %windir%\repair\
secsetup.inf /db secsetup.sdb /verbose /areas regkeys

Task is completed. Some files in the configuration are not found on this system
so security cannot be set/queried. It's ok to ignore.
See log %windir%\security\logs\scesrv.log for detail info.

I then reran the SP 2 installation again. At last, the installation was successful, with no error messages produced.

When I checked the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\LogLevel value in the registry, I found it had been reset to 0 by the installation of SP 2. I left it at that value.

References:
  1. You receive an "Access is denied" error message when you try to install Windows XP Service Pack 2 or Windows Server 2003 Service Pack 1
    Microsoft Help and Support
    January 25, 2006
  2. How to enable verbose logging on a Windows XP-based computer
    Microsoft Help and Support
    September 9, 2005
  3. Reg
    Microsoft Windows XP Professional Product Documentation
  4. xp sp2 install error requested section was not found in the
    By Mavrick
    August 8, 2005
  5. Service Pack Installation Checklist
    March 30, 2005
  6. Secedit
    Microsoft Windows XP Professional Documentation