Martin Bonner
6/18/2007 10:44:00 AM
On Jun 14, 8:44 pm, Dan Cooperstock <dan...@newsgroups.nospam> wrote:
>
> Martin Bonner <martinfro...@yahoo.co.uk> wrote innews:1181835933.669758.316890@d30g2000prg.googlegroups.com:
>
> > On 13 Jun, 15:59, Dan Cooperstock <i...@Software4NonProfits.com>
> > wrote:
> >> I'm using a CodeProject project in my application that shows how to
> >> embed an editible IE control into a .NET window, and control it in
> >> various ways. (I'm using it for mail merge.) However, the code
> >> requires a reference to the Microsoft.mshtml assembly (a Primary
> >> Interpop Assembly, I believe), and it makes that reference to a
> >> specific version number of it (7.0.3300.0).
> > [snip]
> >> Another suggestion I saw was to distribute and run the
> >> vs_piaredist.exe file from my C:\Program Files\Common Files\Merge
> >> Modules directory as part of my installer.
> > I believe this is the only supported way to do it.
>
> >>In one test I've done so far, that did work, and it
> >> created the correct version of Microsoft.mshtml.dll in the GAC.
> >> However, I'm not sure (a) whether I'm allowed to do this, (b) whether
> >> it would be a consistent solution, or (c) whether it's the best or
> >> smallest solution.
> > It's not bad, because although Microsoft.mshtml.dll is *HUGE*, it
> > compresses very effectively.
>
> >> Is there any other way to do this,
> > I don't think so.
> >> on any arbirtrary non-development PC
> >> with the .NET 2.0 Framework installed? If not, are the answers to all
> >> of the questions in the previous paragraph "yes"?
> > I believe so. Not that vs_piaredist.exe internally invokes Windows
> > Installer, so you can't run it from an MSI module. What we do, is to
> > have a fairly simple application which optionally runs other things:
> > Windows Installer 3.1 setup, .Net Framework 2.0 setup, vs_piaredist, a
> > free tool that we think we can distribute as a setup, but not
> > incorporated into our msi, and finally the msi you first thought of.
> Thank you Martin. I'm going to try that.
>
> The one thing is, I want to be able to detect whether the right version
> of Microsft.mshtml is already there, so I don't run vs_piaredist.exe
> needlessly.
I'm not sure there is more than one :-)
>
> What I came up with, through some registry searching, is to see whether
> there is a value whose name starts with
> Microsoft.mshtml,Version="7.0.3300.0" in the registry key
> HKEY_CLASSES_ROOT\Installer\Assemblies\Global. Does that sound right to
> you?
We look in HKCR\CLSID
\{25336920-03F9-11CF-8FD0-00AA00686F13}\InProcServer32, and check that
the value "Class" has data "mshtml.HTMLDocumentClass".
That won't do a version check, but until we have two versions, I don't
see how you can distinguish.