Home Categories Patching Solved: The detection failed, this can be due to a corrupted installation database
Solved: The detection failed, this can be due to a corrupted installation database
Written by KbNk   
Wednesday, 19 August 2009 13:44


Recently I had to upgrade my MOSS farm with Aprils CU. So I confirmed downtime, prepared myself to patch 6 servers and during nice saturday morning, started to patch.

I have doubleclicked installation exe file downloaded from microsoft.com and after 10 seconds following message appeared:

The detection failed, this can be due to a corrupted installation database


Basicaly that means that your installed database is not in good shape and process has difficulties to read required informations from it. So patching could not continue.

As this happened on all servers in the farm, initial talks about reinstalling whole MOSS 2007 were proscribed. Because of importancy, there was no time and opportunity to play and google, MS call had to be logged.


Actually.. I was pretty much surprised how fast it was sorted out and how proffesional two engineers were.


So you have two options how to solve this. (well basicaly three  - you can remove all information about MOSS with Windows Installer CleanUp Utility -

http://support.microsoft.com/kb/290301 to remove all references to MOSS, delete all folders and install it again :-) But definetelty we dont want to go with this way  )


1.there are many articles about this how to solve it just with regedit.exe. They are all similar to next few words:



Take a backup of the products hive HKEY_CLASSES_ROOT\Installer\Products by exporting it to a file.

Microsoft Office SharePoint Server 2007


1. Rename




Microsoft Windows SharePoint Services 3.0


1. Rename




Run the your patch again. If this succeeds a new Patches regkey will be created.


Well.. that might help in some cases but it didn't help me. I had seriously corrupted installers database. Somebody or something deleted files and folders directly in %windir%\installer folder. Well at least that is only RCA from MS.

If you need to solve this issue and registry magic doesn't help. Following might.



Run the ROIScan.vbs that is attached to this article. It doesnt have GUI but list also non-microsoft products, what is better. You can find output in " %temp%" folder.

when you run it just by typing cscript %path to script%\roiscan.vbs it will collect all information about any software and put it in nice summary on the top of the log.



Then you should copy from some working server whole "%windir%\installer" folder to temp location on affected server or download and extract all files that are listed in the output. Best from some same configured server so you have all required files. Or you can run WiCollectFiles.vbs (attached) on every server on your environmnent. This will collect all unique files from installer folder to central location.


Use as follows:

1. Create a network share with "write" permissions "\\<Server>\Restore" on any server.

2. Run the attached script on all relevant servers to build up the structured files collection

cscript WiCollectFiles.vbs SRestoreLocation="\\<Server>\Restore"

The script will collect all unique files and you can use that share for the repair operations.



Once you have created the central restore share. You use another attached script called MspFixUp.vbs

To run the repair with MspFixUp you can use this command from the broken servers

cscript MspFixUp.vbs /L0 SRestoreLocation="\\<Server>\Restore"

This will look into all MSP /MSI files compare with informations you have on servers and rename MSP/MSI and stores them in %windir%\installer folder.

Important: "You can use L1 swich that will unregister all Office patches that could not be restored!

I dont recommend it, so i used L0 that will just restore ones that can be restored.


Note:    If we run the command with the SRestoreLocation pointing to a server, the runtime of the script will be quite long!

To improve the runtime of the script you can copy the "Restore" share locally first and use


You can use ROIScript.vbs or WIPR.exe to collect informations again and see what you missing. It will actually tell you exact file names, and how they should be called, so you can extract them, download or collect any other way, then just rename them and place to Installers folder again.



That is pretty much it, it solved my problem and was not so complicated. I have tested the scripts and had confirmed from MS, that they used them for a lot of cases without any issue. I recommend to check at least header of each of them to see possible switches and options.



FileDescriptionFile size
Download this file (Scripts to article on moss2007.kbnk.info.zip)All Scripts in this articleContains all scripts mentioned in this article78 Kb
Add New Search
Write comment
[b] [i] [u] [url] [quote] [code] [img] 
Please input the anti-spam code that you can read in the image.
Waseem Arfi     |65.204.218.xxx |2009-12-17 12:44:02
Oooh man ... you have made my day. Weeks effort ha s been spent on it by me.

hanks dear a lot ... I will put your blogs link on my side as well. Tha nks aga

I get my problem solved following your tips.

Ran Ovadia   |192.118.48.xxx |2009-12-28 14:30:34

Please assist, when I run step 3 - I get an error that local .msi can't
be found.

Any idea ?

KbNk   |Registered |2009-12-28 16:54:08
Hello Ran,
what exactly are you doing. I cannot f ind step 3, sorry what comm
and do you enter or w hat script are you running ?
|I would say you ente r wrong
path in step |C , when you try to locate y our installer repository ?
Lance   |208.195.70.xxx |2010-06-22 19:23:32
Thanks for the fix - worked like a charm on multip le servers where I had this p
Anonymous   |195.245.193.xxx |2010-10-08 15:11:22
Saved my day - thank you

Frank Clemen

!joomlacomment 4.0 Copyright (C) 2009 Compojoom.com . All rights reserved."