locked
redistributing mshtml.dll RRS feed

  • Question

  • Hi all,

    I'd like to ask a question about redistributing mshtml.dll in a commercial software. Is this legal? I know I could use Windows Forms WebBrowser component, but it depends on version of IE installed on your PC (links dynamicaly). The issue is that I need multiple versions of IE functionality in single project, which means I should add multiple references to Microsoft.mshtml.dll to my project and redistribute it with it. Is this a legal practice, should I buy some kind of licence from Microsoft or is this impossible to achieve in legal way? Thank you in advance.
    Monday, December 22, 2008 9:36 AM

Answers

  •  I doubt its legal or that you can get a licence to do this.   The version of mshtml on the machine may vary depending on IE version and service packs.  What variations between these dlls cause you a problem?
    Anthony Jones - MVP ASP/ASP.NET
    • Marked as answer by StraySod Thursday, December 25, 2008 3:35 PM
    Monday, December 22, 2008 9:55 PM
  • Hi,

    See IETester from http://www.debugbar.com


    (c! someone has already been there and done that!)



    Note that with IE8 you can switch browser modes using the Developer Tool.


    Regards.
    Rob^_^
    • Marked as answer by StraySod Thursday, December 25, 2008 3:35 PM
    Tuesday, December 23, 2008 6:28 AM
  • The tools that let you have multiple versions of IE installed side-by-side are using a trick of the Windows loader.  And they are redistributing multiple versions of several system DLLs.  Legal issues aside (which, most likely, nobody here is qualified to answer), you can't just redist mshtml alone--you'll have to redist every dll that it depends on (and every dll those dlls depend on, and so on).  You might be able to get away with 10 or 20 dlls, but you'll never be 100% certain that it will behave correctly in all situations since you have no idea what mshtml's internal dependencies are.  Remember--it's part of the OS.  I've seen the source code--it's a nasty beast.

    My advice is DON'T do this.  There are many downsides.  For example (and I told the IETester guy this too), your mshtml dll that you redist won't get updated by Windows Update, so when (not if, when) there are security issues, it won't get patched, leaving your app vulnerable to all sorts of nasty security attacks. 

    Instead you should detect what version of mshtml is installed and adjust your app to behave accordingly.  If that's a non-starter, find a nice open-source HTML rendering engine (like webkit) and redist that.

    • Marked as answer by StraySod Thursday, December 25, 2008 3:35 PM
    Thursday, December 25, 2008 12:12 AM

All replies

  •  I doubt its legal or that you can get a licence to do this.   The version of mshtml on the machine may vary depending on IE version and service packs.  What variations between these dlls cause you a problem?
    Anthony Jones - MVP ASP/ASP.NET
    • Marked as answer by StraySod Thursday, December 25, 2008 3:35 PM
    Monday, December 22, 2008 9:55 PM
  • Hi,

    See IETester from http://www.debugbar.com


    (c! someone has already been there and done that!)



    Note that with IE8 you can switch browser modes using the Developer Tool.


    Regards.
    Rob^_^
    • Marked as answer by StraySod Thursday, December 25, 2008 3:35 PM
    Tuesday, December 23, 2008 6:28 AM
  • Thank you for your replies,

    Anthony: In our project one of the features is to see the difference of rendering result in different versions of IE (should help webdevelopers), I was hoping I could use LoadLibrary function to load redistributed dll file of custom version. This is what I'm able to manage (maybe there's a better way, I'm still analysing the issue).
    Apparently using the one installed with users version of IE wouldn't be enough as I need multiple versions (can't use WebBrowser control as well - same issue).

    IECUSTOMIZER: I've seen the IETester project before and already contacted mr. rabaute who developed it (of course he didn't reveal his magic :)). IETester is a testing tool which is free to download, which means it should be ok to redistribute mshtml.dll files (at least I think so), which is exactly how IETester works. After installing it contains multiple dirs called IEx. Every one of these containes a copy of mshtml.dll and other libraries.
    I will check Developer Tool to see if this could help me..

    I think I would be able to use the functionality of multiple versions of mshtml.dll. I just thought it wouldn't be legal and couple of people (including Mr. Anthony Jones) already confirmed it. So, thank you again and will appreciate any other remarks.. Have a nice Christmas time
    Wednesday, December 24, 2008 12:39 PM
  • The tools that let you have multiple versions of IE installed side-by-side are using a trick of the Windows loader.  And they are redistributing multiple versions of several system DLLs.  Legal issues aside (which, most likely, nobody here is qualified to answer), you can't just redist mshtml alone--you'll have to redist every dll that it depends on (and every dll those dlls depend on, and so on).  You might be able to get away with 10 or 20 dlls, but you'll never be 100% certain that it will behave correctly in all situations since you have no idea what mshtml's internal dependencies are.  Remember--it's part of the OS.  I've seen the source code--it's a nasty beast.

    My advice is DON'T do this.  There are many downsides.  For example (and I told the IETester guy this too), your mshtml dll that you redist won't get updated by Windows Update, so when (not if, when) there are security issues, it won't get patched, leaving your app vulnerable to all sorts of nasty security attacks. 

    Instead you should detect what version of mshtml is installed and adjust your app to behave accordingly.  If that's a non-starter, find a nice open-source HTML rendering engine (like webkit) and redist that.

    • Marked as answer by StraySod Thursday, December 25, 2008 3:35 PM
    Thursday, December 25, 2008 12:12 AM
  • Thanks for your post Jeffdav. Covering the dependencies of mshtml.dll was other issue I was afraid of :) It looks like there are too many obstacles to achieve what we are trying to achieve. If I would have some news about this topic I'll post it here. 
    Thursday, December 25, 2008 3:34 PM
  • For testing I use couple of extra Virtual Machines with other versions of IE installed.
    Anthony Jones - MVP ASP/ASP.NET
    Thursday, December 25, 2008 4:15 PM
  • You generate your own interop assembly usng tlbimp instead of using the ones in MSHTML. mshtml.dll is 7MB. A lot of types in the dll, such as all classes and disp interfaces are useless because they may change between versions or contain unmarshallable method signatures, but you still have may stable interfaces like IHtmlDocument2. You may want to create your own interface if you are using IE6 because a bug in IE6's type library.



    MSMVP VC++
    Wednesday, January 7, 2009 7:42 PM
  • Check this article : 
    Internet Explorer Late Binding Automation
    Internet Explorer automation sample code using late binding, without Microsoft.mshtml and shdocvw dependency.

    http://www.codeproject.com/KB/cs/IELateBindingAutowod.aspx
    • Proposed as answer by inpuarg Thursday, June 11, 2009 3:29 PM
    Thursday, June 11, 2009 3:28 PM