Unable to install SP2?

I recently worked on a case where we were unable to install SP2 on a Small Business Server 2003.

Normally this happens when there has been no service pack installed on the server however it has been receiving updates and patches from windows update.

For more information on why this happens have look at this article;

925931  You may be unable to apply more updates at a certain point on a Windows Server 2003-based computer

https://support.microsoft.com/default.aspx?scid=kb;EN-US;925931

Now the here are a couple of links that you may use to resolve the issue.

822798  You cannot install some updates or programs

https://support.microsoft.com/default.aspx?scid=kb;EN-US;822798

Now if you are getting the following error;

Pop-up error:

Failed to install catalog files.

svcpack.log:

960.484: InstallSingleCatalogFile: MyInstallCatalog failed for Tmp.0.ntprint.cat; error= 0xfffffbfe .

Then KB 822798 may not help.

The best article on the web is here:

https://blogs.technet.com/sbs/archive/2007/06/22/sp2-may-fail-to-install-if-a-large-number-of-updates-are-installed.aspx

However if you are getting the following errors;

---------------------------
Setup Error
---------------------------

The system cannot find the file specified.

---------------------------
OK
---------------------------

and then,

---------------------------
Setup Error
---------------------------

installation did not complete.

---------------------------
OK
---------------------------

..the issue is completely different.

Any update or hotfix will bring the same error.
Now the case that I was working on, I saw the above two errors and noticed the following things;

> C:\Windows\System32\Catroot\{F750E6C3-38EE-11D1-85E5-00C04FC295EE} does not contain any files.
> Customer had already tried recreating the CatRoot2 folder.
> Read and Execute permission were missing on the following folder "C:\Windows\Registration\"

So I did the following things;

> Gave Read and Execute permissions to the folder: "C:\Windows\Registration\"
> Stopped Cryptographic service.
From cmd: net stop cryptsvc
> Renamed CatRoot2 folder to .old and created a new blank one.
> Reregistered the following DLLs;

REGSVR32.EXE SOFTPUB.DLL
REGSVR32.EXE WINTRUST.DLL
REGSVR32.EXE INITPKI.DLL
REGSVR32.EXE DSSENH.DLL
REGSVR32.EXE RSAENH.DLL
REGSVR32.EXE GPKCSP.DLL
REGSVR32.EXE SCCBASE.DLL
REGSVR32.EXE SLBCSP.DLL
REGSVR32.EXE Mssip32.dll
REGSVR32.EXE CRYPTDLG.DLL

> Start cryptsvc. (It may already be started.)
net start cryptsvc
> When this did not help, I again looked at the folder;
C:\Windows\System32\Catroot\{F750E6C3-38EE-11D1-85E5-0C04FC295EE}
> If you carefully look read the article on link https://blogs.technet.com/sbs/archive/2007/06/22/sp2-may-fail-to-install-if-a-large-number-of-updates-are-installed.aspx

..you will notice that the hotfix 912354 should be installed and the cab file should be in the above location.

> However the hotfix was not installed.
> Now I could not install this hotfix as it would give me the same error.
> Why is this hotfix required?
> Because it updates the file LICDLL.DLL.
> I looked at the version of file on the server and it was a older version. Can't remember the version now.
> It should at least be 5.2.3790.2598.
> Now I had the following version on my Virtual PC:
5.2.3790.3959
> I uploaded it on folders.live.com and downloaded it on his server.
> Renamed the original file to LICDLL.OLD and replaced it with the one from my server.
> Reregistered the DLL
REGSVR32.EXE LICDLL.DLL
> Restarted the cryptographic service.
net stop cryptsvc && net start cryptsvc

> And now we were able to apply SP!