SharpReader is growing

And I'm not talking about user-base. To implement some features related to the embedded browser, I will need to use the IHTMLDocument2 interface, which is part of the Microsoft.mshtml.dll assembly. The lack of this assembly on some user's systems is what caused 0.9.1.2 to fail for them at startup.

Since this assembly does not come with the regular framework install, I'll have to include it in the SharpReader zip distribution. The problem is that this dll is 7.8MB in size! This would mean SharpReader's zip distribution would go from about 400KB to about 2MB, which will not only make things harder on those of you still cursed with dial-up (I feel for you...) but will most likely also kill my bandwidth.

Are there any .NET gurus out there that have a solution for this problem? If this were Java I could just unpack the jar, get just the class-files I need and re-jar those again. Is there something similar I can do with a .NET assembly? Or can I somehow generate code like found here but more up-to-date? (that implementation of IHTMLDocument2 misses some of the methods I need, like focus() and write()).

Help!

TrackBack URL for this entry: http://www.hutteman.com/scgi-bin/mt/mt-tb.cgi/58
Comments

I think what I did was detect whether they had it on first use, then provide a download at that point. IIRC, those without it are in the minority.

Posted by Jeff Key at June 17, 2003 9:27 PM

Why not just offer it as an external download. Catch the exception, and launch a browser directed to a download page.

Most any developer should have it on their machine.

Posted by Dan Bright at June 17, 2003 10:11 PM

I agree with Dan. I just did a search on my machine and found six different copies!

Posted by Ron Green at June 17, 2003 11:02 PM

Why not generate it on the fly with tlbimp? %system%\mshtml.tlb should be present on any box that has IE installed (I think). Of course the presence of tlbimp implies that the sdk is installed, but at 32k tlbimp.exe is MUCH less bandwidth intensive to distribute than Microsoft.mshtml.dll. ;)

Posted by John Renaud at June 17, 2003 11:57 PM
  • If you were to break down and have an installer, it could check for the .dll and either download it or generate it if necessary.
  • You could try trickle download, which is pretty complex.
  • Since you can't just use the types from the Microsoft.mshtml.dll (you can't catch the exception since it is thrown by the loader, which is outside your program), you could do a slimmed-down version of the trickle-down approach. Create an appdomain. Try to load each of the assemblies you need. Create/download the ones that are needed. Now load the rest of your app (in a satellite .dll) into the same appdomain, and invoke your main routine, using Reflection to keep the interface madness to a minimum.

Posted by Joe Hildebrand at June 18, 2003 2:29 AM

Look at the latest Syndirella source. There's a file in it called IHtmlDocument2.cs that uses COM interop to wrap its interface. Dmitry said he got the source from the windows forms faq, but the only article I could find was about using the IHTMLDocument3 interface (http://www.syncfusion.com/faq/winforms/search/841.asp).

Posted by rick at June 18, 2003 6:08 AM

ildasm/ilasm supports round-tripping.
Run ildasm xx.dll /out:xx.il on the interop assembly, edit the IL file (ripping out the pieces you don't need) in a text editor and create a dll again with ilasm /dll xx.il.

Given that you only need a small part of what's in Microsoft.mshtml.dll you will end up with something MUCH smaller.


Posted by Simon Hodd at June 18, 2003 7:03 AM

How about... forget the internal browser feature enhancement? I don't use IE and don't really want or need an "internal" browser.

I'm not on top of the story, but I don't understand why a developer would increase his app's investment in technology that Microsoft is going into one of its famous vassilating dance routines about. Many of us are concerned enough with having to swollow a basic .NET hit in terms of disk storage and undisclosed, unseen "features" and tie-ins. If this enhancement pushes me further along the line toward being required to upgrade to XP, I'd like to know about it ASAP.

Alternatively, and in a less rantful mode, why not take the internal browser and all its plumbing out of your product and make it an optional added "feature" and separate download/install. (I'd be surprised if it were even possible, but I make the suggestion nonetheless.)

Thanks. ...edN

Posted by ed nixon at June 18, 2003 9:19 AM

http://www.nikhilk.net/Entry.aspx?id=11

Posted by RichB at June 18, 2003 10:10 AM

Hitting the Wall
It's useful when a developer so clearly depicts what he's trying to do, what the issues are and what the...

Trackback from Rodent Regatta at June 18, 2003 10:26 AM

If you end up needing some bandwidth, I'd be glad to help hosting the download.

Posted by Jeremy Zawodny at June 18, 2003 11:33 AM

[user perspective warning!]
I'm with Ed Nixon on this (i'm not a developer so don't understand exactly whay you need new functions | excuse my ignorance) - the internal browser is FAR lower on my priorities than a slim app and elegant UI for RSS handling. I prefer having MY browser used to read full articles than an embedded IE. Have it as it is, and don't bloat sharpreader trying to turn it into a browser shell...
[/user perspective warning!]

Posted by Ian at June 19, 2003 8:08 AM

Sorry, but I like the internal browser for some feeds (ones that have no content) - so that I can read the post right away w/o having to click on the title link, etc.

If it was removed, I'd probably switch or keep using the current version instead of upgrading.

Posted by Andy B at June 19, 2003 11:00 AM

Don't ditch the melding of the browser interface and the RSS functionality. It rocks. It's all web technolgy anyway, so they really belong together.

Here's an idea... since you are building sharpreader on MS technology, why not build it as an add-on to IE, rather than trying to add IE to sharpreader? Then I can use sharpreader seamlessly w/my web browser and all of it's functionality...and I would still have a small download.

There might be downsides. I'm not a developer, so I don't know if it's even feasible/reasonable for you...just an idea.

Posted by Ben at June 19, 2003 11:25 AM

For the many people who don't use IE as their main browser, that would be a hefty blow to usability.

Posted by tamaracks at June 20, 2003 12:42 PM

I run Windows XP but use Mozilla for my browser because of the built in pop up and cookie blocking abilities. If you are building in browsing, any way you could let the user choose which browser? I would hate to be using sharpreading and have a zillion pop-ups because of the story I clicked on.

Thanks,jb

Posted by JayB at June 22, 2003 11:24 PM

Couldn't you just use Roeder's Reflector to get the interface definition and then just embed it into your app?

Posted by chadb at June 23, 2003 2:26 PM

Hello.

I am using SharpReader both at work and home.

Is it possible to export all data about subscriptions or to copy one configuration to another with all relevant stuff? Where are data now? In Isolated Storage? Registry?

Thanks,
Dejan

Posted by Dejan Vesic at June 25, 2003 6:38 AM

SharpReader loves IE
Since development of Syndirella was stopped some time ago, and some people were raving about SharpReader at that time, I...

Trackback from Outer Web Thought Log at June 25, 2003 8:09 AM

Given that you only need a small part of what's in Microsoft.mshtml.dll you will end up with something MUCH smaller.

Posted by Billtom at October 27, 2003 2:51 PM
This discussion has been closed. If you wish to contact me about this post, you can do so by email.