Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1323
  • Last Modified:

Microsoft Installer Problem: 'failed to register MSHTML.TLB'

Using the Visual Studio Installer (MS VS 6.0 with Service Pack 5.0 installed, including the SP5 updated merge module files) I am having this consistent error when I run the installer file (project1.msi):

Error 1904:  Module C:\WINNT\SYSTEM32\MSHTML.TLB failed to register. HRESULT -2147024769

This error happens toward the end of the install process.  The web-related code of the installed program then has runtime errors.

The project includes a WebBrowser object, and also uses the Inet object to do some parsing of web documents.  It builds and runs successfully from within Visual Studio, and the .exe works fine if you just run it within the project directory.

Question:  What is wrong with my installer or project!?  Please give detailed instructions on how to correct this problem.

Thanks in advance!

  • 3
  • 2
1 Solution
I assume you can't register the TLB (Type Library), you don't always have to ship & register every component, as some of them are default within the OS. All you have to do is in your Visual Sutdio Installer project is find the file MSHTML.TLB, find the property called 'Register' and set it to 0 - vsifrNone.

gornhyhuyAuthor Commented:
Thanks RainUK, but that doesn't solve the problem for someone who does need that TLB to be packaged in the installer. Presumably Microsoft includes that dll in there for a reason.

The real question is: why won't it register properly, and how can I make it register successfully?
gornhyhuyAuthor Commented:
I rebuilt the project from the ground up and it looks like the dependancy on MSHTML.TLB doesn't appear until I use WebBrowser1.Navigate

Don't know if that helps any?

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

You are incorrect in saying that "Presumably Microsoft includes that dll in there for a reason."  

According to the MSDN help pages regarding the VB MS Installer and their service pack updates:

"Mshtml.tlb is being included incorrectly in the setup package, and the PDW is not able to determine what dependencies there are for the file.

Mshtml.tlb does not need to be installed on target computers because it is already installed on Windows 2000 and any computers that have Internet Explorer.
There are two ways to resolve this problem:
You can manually deselect the Mshtml.tlb file so that it is not included in your setup package.

If you install the latest service pack for Visual Studio 6.0, the Package and Deployment Wizard does not pick up Mshtml.tlb. "

So, you should technically solve this problem by properly using the latest Service Pack, but short of that, you should manually "delete" the dependency on MSHTML.tlb inside the VS Installer program on the project properties page under Files --> Dependencies

One more thought:
If you leave the mshtml.tlb in the installer dependencies, but just click 'continue' when it fails to register, the program should finish the install correctly.  My hunch is that the failure happens only on a machine that already has the mshtml.dll available (w2k or IE already installed). This way you can supply the TLB to people who don't have it already, and those that do will just have to suffer through the failure message.

or maybe you can have 2 installer versions available, one for non-IE people and one for the rest of us.
Good luck!
gornhyhuyAuthor Commented:
Thanks... I couldn't find that level of detail anywhere.  If only I could get my service pack install to actually work like they say it does.

I'll try the 2 installer option for now.

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now