[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.interop

How to ensure Microsoft.mshtml is on deployement machines?

Dan Cooperstock

6/13/2007 2:59:00 PM

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).

When I deploy my application to other machines, however, either this
assembly is not present (although they definitely have the .NET 2.0
Framework installed) or it is the wrong version, so it doesn't work in
either case.

I've seen some prior discussion of this elsewhere, but I'm not happy with
the suggestions.

One was to distribute the specific Microsoft.mshtml.dll from my machine
with my application, but that's 8MB, which is a fairly big deal in an app
that is currently only about 5MB in total (excluding the framework, of
course). Also, one person said they tried that and it crashed on some
machines.

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. 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.

Is there any other way to do this, 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"?

Thanks.

---------------------------
Dan Cooperstock
DONATION web site: http://www.Software4NonP...
DONATION Support forums: http://forums.Software4NonP...
Email: mailto:info@Software4NonProfits.com
Phone: 416-423-9064
4 Answers

Martin Bonner

6/14/2007 3:46:00 PM

0

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.

Dan Cooperstock

6/14/2007 7:45:00 PM

0

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.

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?

Thanks - Dan.

Martin Bonner <martinfrompi@yahoo.co.uk> wrote in
news: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.
>
>



--
---------------------------
Dan Cooperstock
DONATION web site: http://www.FreeDonationSo...
DONATION Support forums: http://forums.FreeDonationSo...
E-mail: mailto:info@FreeDonationSoftware.org
Home Phone: 416-423-9064

Martin Bonner

6/18/2007 10:44:00 AM

0

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.

Dan Cooperstock

6/20/2007 1:11:00 PM

0

Martin Bonner <martinfrompi@yahoo.co.uk> wrote in
news:1182163438.087189.318980@q75g2000hsh.googlegroups.com:

> 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,
> 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.

I also posted this in the the MSDN Forum for Windows Forms - ClickOnce
and Setup and Deployment Projects. David Guyer MSFT, from Microsoft's
Development Technologies Group, had the following suggestion, which I
think is better:

"Do a file-search under c:\program files\Microsoft.NET\Primary Interop
Assemblies, and use the file version as well to narrow the search down."

I'm doing that now. My installation software allows me to check file
versions, so I can check that it is 7.0.3300.0, which is what I need. It
seem to work well.

He said that my registry checking idea (looking in HKEY_CLASSES_ROOT
\Installer\Assemblies\Global) was in internal Windows Installer registry
path which was subject to change.

---------------------------
Dan Cooperstock
DONATION web site: http://www.FreeDonationSo...
DONATION Support forums: http://forums.FreeDonationSo...
E-mail: mailto:info@FreeDonationSoftware.org
Home Phone: 416-423-9064