Windows Modules Installer Error:126

Anonymous
2009-10-29T22:22:40+00:00

My Gateway has Vista Home Premium 64 bit with SP1. Windows updates are not working at all.

After doing some digging I discovered Avast Anti-Virus may have deleted TrustedInstaller.exe which I believe may have something to do with the problem although TrustedInstaller.exe is still in C:/WINDOWS/services (which as far as I know is the correct location). Also, when I open Services (Start > Search "Services" > Services) and try to start the Windows Modules Installer It gives me the error:126 The specified module could not be found. This led me to belive that it may have something to do with my registry?

sfc /scannow also does not work.

Ive tried a number of fixes. One involved copying TrustedInstaller.exe from a friends computer to my C:/WINDOWS/Services

I have also consulted similar posts on this site sadly, to no avail. I tried installing SP2 hoping that would fix it, but without Windows Modules Installer working I could not get it to work.

I am willing to try anything short of reformatting. Restore is not an option as I dont have a restore point...

Any help you can provide with this would be greatly appreciated. Please explain in begginers terms any instructions you may have to fix this as I am little more than a beginner. Google is the only thing that got me this far :-)

Windows for home | Previous Windows versions | Install and upgrade

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
Answer accepted by question author
Anonymous
2011-01-30T01:35:08+00:00

Ok folks quit your freakout...the answer exists and Google can find it. I fixed it on mine.

My symptoms:

  • Windows update fails
  • Manual install of service pack fails
  • sfc fails
  • Windows Modules Installer (aka TrustedInstaller) won't run and returns error 126
  • ...other stuff I can't remember fails
  • Errors like CO_E_SERVER_EXEC_FAILURE(0x80080005)

I read through a number of threads like this, here and on other sites. I tried the instructions above to no avail (although I can't be sure they weren't part of the solution). Then I found this:

http://www.vistax64.com/tutorials/282940-windows-modules-installer-error-126-fix.html

There is much detail there, written in broken English, with screenshots provided. Here is what worked for me, partially copypasta and partially paraphrased for brevity and clarity:

I was missing the following registry key: 

HKLM\Software\Microsoft\Windows\CurrentVersion\Component Based Servicing\Version.

To fix it:

  1. Navigate to C:\Windows\Servicing\Version and read the name of a subfolder. It will be named something like 6.1.7600.16385. That is your {TrustedInstaller ID}. Copy the name of that folder to the clipboard (and paste it in Notepad for safe keeping). 
  2. Find a subfolder in C:\Windows\WinSxS whose name starts with:

x86_microsoft-windows-servicingstack_31bf3856ad364e35_{TrustedInstaller ID} (32bit Windows)

amd64_microsoft-windows-servicingstack_31bf3856ad364e35_{TrustedInstaller ID} (64bit Windows)

Copy the name of that folder to the clipboard (and paste it in Notepad for safe keeping).

  1. Create subkey "HKLM\Software\Microsoft\Windows\CurrentVersion\Component Based Servicing\Version". You will need to take ownership of "Component Based Servicing" then give yourself full access permissions before you can create the key.
  2. In the new Version key, create an "expandable value" using the TrustedInstaller ID as its name and the complete path of the folder you identified in WinSxS as its value. Properly you should use %SystemRoot%\WinSxS\whatever instead of C:\Windows\WinSxS\whatever.

Was this answer helpful?

300+ people found this answer helpful.
0 comments No comments

64 additional answers

Sort by: Oldest
  1. Anonymous
    2011-09-22T06:08:42+00:00

    theHolycow,

    cant thank you enough!!!!   have been spending hours on this.  No one else close to the solution.

    ignore everything else you read and do the registry addition above and all will work once more.

    You are in a word AWESOME!

    Riclesb

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2011-09-25T16:01:39+00:00

    Fantastic! 

    follow this man's instructions to the letter and it should fix your problem, thanks Greg!

    FYI, this problem started when my daughters laptop ran out of space on the C drive, it seemed to be working fine after I freed up some space, so it took a few months before I realised no windows updates were being installed!

    As with others I have spent a few hours researching this to no avail, until I read this thread.

    I'm sorry but the MS solutions in this thread just didn't work for me on this occasion.  Greg's solution was 110% definitely what fixed it.  sfc is now running on the laptop with the problem, and up till now I got the resource protection service failure.  But not any more!

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2011-10-19T17:55:34+00:00

    Great Answer, worked like a charm solving installation errors with applications like Symantec Systrem Restore (BESR) 2011.  Fixed the error 126 and the Windows Modules Installer starts fine.

    Nice, thanks!

    ->N

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2011-11-09T11:33:26+00:00

    Man, you rock .. after endless trawling, this is the only fix that does it.  Once again, I can install updates, including service pack 1 for win7.

    Was this answer helpful?

    0 comments No comments