[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

microsoft.public.dotnet.framework.setup

ActiveX Control written in .NET - installation and deployment in IE

(Elad Volpin)

4/3/2006 3:23:00 PM

Hi,

We have an ActiveX Control which was written in .NET 2003. Works great
on the local machine, and our issue is deployment.

Based on the thread (http://tinyurl...) and
(http://tinyurl...), we've signed the dll, and written an INF
file encapsulated in a CAB which contains directives on how to perform
the regasm of the activex.

When surfing on the intranet to the server where the cab resides, an
ActiveX control installation and warning dialog appears, and we select
"install".
This is followed by a few seconds where the installation is supposed to
take place, but nothing happens. Checking the registry we can see that
indeed no activex was registered.

BTW: the CAB also contains the regasm.exe so that we need not busy
ourselves with the path to it.

So the INF file looks like this:
[version]
signature="$CHICAGO$"
AdvancedINF=2.0

[Add.Code]
OCXTest.dll=OCXTest.dll

[OCXTest.dll]
file-win32-x86=thiscab
clsid={XXX-YYY...ZZZ}
FileVersion=1,0,0,0
RegisterServer=no
hook=DOTNET_INSTALLER

[DOTNET_INSTALLER]
run=%EXTRACT_DIR%\regasm.exe %EXTRACT_DIR%\OCXTest.dll

The HTML looks like this:
<object classid="clsid:XXX-YYY...ZZZ"
codebase="http://myMachine/Cab1.CAB"></object>

So - what are we doing wrong ?
Thanks.

10 Answers

rmacias

4/5/2006 3:15:00 AM

0

You can not create ActiveX controls in .NET. I think what your are trying to
say is that you have created a .NET assembly and want to have that invoked
from unmanaged code (by your use of regasm). In your .NET project
properties, make sure the "Register for COM Interop" option is checked. When
you compile your program, this will create a type library that can be
registered on clients.

You can then create a Setup Deployment package (*.msi) to deploy your
assembly, and *.tlb file.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/manunm...


In your project, make sure you

"ewolfman" wrote:

> Hi,
>
> We have an ActiveX Control which was written in .NET 2003. Works great
> on the local machine, and our issue is deployment.
>
> Based on the thread (http://tinyurl...) and
> (http://tinyurl...), we've signed the dll, and written an INF
> file encapsulated in a CAB which contains directives on how to perform
> the regasm of the activex.
>
> When surfing on the intranet to the server where the cab resides, an
> ActiveX control installation and warning dialog appears, and we select
> "install".
> This is followed by a few seconds where the installation is supposed to
> take place, but nothing happens. Checking the registry we can see that
> indeed no activex was registered.
>
> BTW: the CAB also contains the regasm.exe so that we need not busy
> ourselves with the path to it.
>
> So the INF file looks like this:
> [version]
> signature="$CHICAGO$"
> AdvancedINF=2.0
>
> [Add.Code]
> OCXTest.dll=OCXTest.dll
>
> [OCXTest.dll]
> file-win32-x86=thiscab
> clsid={XXX-YYY...ZZZ}
> FileVersion=1,0,0,0
> RegisterServer=no
> hook=DOTNET_INSTALLER
>
> [DOTNET_INSTALLER]
> run=%EXTRACT_DIR%\regasm.exe %EXTRACT_DIR%\OCXTest.dll
>
> The HTML looks like this:
> <object classid="clsid:XXX-YYY...ZZZ"
> codebase="http://myMachine/Cab1.CAB"></object>
>
> So - what are we doing wrong ?
> Thanks.
>
>

(Elad Volpin)

4/5/2006 6:14:00 AM

0

Thanks for your reply.

Bad selection of terms, on my behalf. Of course, the assembly which
contains the usercontrol is already registered for COM interop and
works just like an old fashioned activeX control.

Having said that, we still have a deployment issue with registering the
assembly on the client machine. Please correct me if I'm wrong, but the
MSI package wont help me deploy the assembly when running in IE. I need
a CAB file for that (?).

rmacias

4/5/2006 6:19:00 PM

0

No problem. I misread you post as well. I didn't realize you were
embeddeding this into a web page.

Also, do keep in mind that in order to run REGASM, the client has to be a
member of the administrators group. If the client is a member of the users
group, REGASM will fail with an access denied error. REGASM is really a
development tool and is not meant to be deployed out to register assemblies.

Is it an ASP or ASP.NET website?


"ewolfman" wrote:

> Thanks for your reply.
>
> Bad selection of terms, on my behalf. Of course, the assembly which
> contains the usercontrol is already registered for COM interop and
> works just like an old fashioned activeX control.
>
> Having said that, we still have a deployment issue with registering the
> assembly on the client machine. Please correct me if I'm wrong, but the
> MSI package wont help me deploy the assembly when running in IE. I need
> a CAB file for that (?).
>
>

(Elad Volpin)

4/6/2006 6:15:00 AM

0

Thanks for your reply.

Assuming that there's no security or permissions problem, and assuming
that there's no other way to register .NET usercontrols via IE (or is
there ?) - whats the error in the INF I've written ? why isn't this
working after all ?

rmacias

4/6/2006 12:20:00 PM

0

The INF file looks right to me. I'll try to recreate your problem later on
today. I have a few questions for you though.

1. Is your website classic ASP, or ASP.NET (v1.1 or 2.0)?
2. Is the .NET Framework installed on your clients?
3. Does the version number in your INF match your Assembly?
4. Does your CLSID in your INF match your Assembly?
5. Can you get your deployment scenario to work for a user who is in the
Administrator's Group on the client PC?

These questions will give me a good start for helping you troubleshoot.

"ewolfman" wrote:

> Thanks for your reply.
>
> Assuming that there's no security or permissions problem, and assuming
> that there's no other way to register .NET usercontrols via IE (or is
> there ?) - whats the error in the INF I've written ? why isn't this
> working after all ?
>
>

(Elad Volpin)

4/11/2006 1:01:00 PM

0

See answers inline:

>1. Is your website classic ASP, or ASP.NET (v1.1 or 2.0)?
ASP.NET 2

>2. Is the .NET Framework installed on your clients?
No, and this is why we decided to back off the subject and converted
our code for this assembly into an old fashioned VB6 OCX (which solved
the deployment issue, of course).
Still my question remains, so lets assume that the target client has
..NET 2 installed.

>3. Does the version number in your INF match your Assembly?
Yes, it does.

>4. Does your CLSID in your INF match your Assembly?
Yes, it does.

>5. Can you get your deployment scenario to work for a user who is in the
Administrator's Group on the client PC?
No. I thought it may be a security/permissions issue too, but no - the
user is an administrator.

rmacias

4/11/2006 11:07:00 PM

0

Well, based on your answers, there are several issue on why your deployment
did not work. See the answers below.

"ewolfman" wrote:

> See answers inline:
>
> >1. Is your website classic ASP, or ASP.NET (v1.1 or 2.0)?
> ASP.NET 2

Since this is ASP.NET 2.0, why go through the trouble of creating a client
side control for your page? Why not just create it in ASP.NET and host it
through your web page (Server Side). It would have worked much easier? The
only reason, I can think of, is to why you would want to create a COM
Callable Wrapper for your control is to host it on a classic ASP website.
Since your using .NET, this wouldn't be necessary.

> >2. Is the .NET Framework installed on your clients?
> No, and this is why we decided to back off the subject and converted
> our code for this assembly into an old fashioned VB6 OCX (which solved
> the deployment issue, of course).
> Still my question remains, so lets assume that the target client has
> ..NET 2 installed.

This is probably the most important issue. Even though you are creating a
COM Callable Wrapper for your .NET Control, it is still a COM wrapper for
your .NET code. The .NET code will still have to execute on the client side
(since you were making this installed on the client). Therefore the .NET
Framework 2.0 would have to be installed on each PC. The beauty of .NET Web
Controls is that they run server side, so the .NET Framework would only have
to be installed on your web server. Your control would not work because the
Framework is not installed.

> >3. Does the version number in your INF match your Assembly?
> Yes, it does.
>
> >4. Does your CLSID in your INF match your Assembly?
> Yes, it does.
>
> >5. Can you get your deployment scenario to work for a user who is in the
> Administrator's Group on the client PC?
> No. I thought it may be a security/permissions issue too, but no - the
> user is an administrator.

Again, because the clients did not have .NET 2.0, regasm would have failed
as well.

These were a couple of issues I see based on the information you provided.
If you want to deploy .NET assemblies to clients (whether you create a CCW or
not), the Framework still must be installed on the client. If you create the
control in .NET, and have your web app instantiate your control, it will run
server side, which eliminates the need to deploy it to your clients.

Then again, I don't know what your control does, so I may have missed your
point. Glad you got it working though.

(Elad Volpin)

4/20/2006 3:54:00 PM

0

Hi rmacias,

Thanks for your patience.
Please see answers inline.

> Since this is ASP.NET 2.0, why go through the trouble of creating a client
> side control for your page? Why not just create it in ASP.NET and host it
> through your web page (Server Side). It would have worked much easier? The
> only reason, I can think of, is to why you would want to create a COM
> Callable Wrapper for your control is to host it on a classic ASP website.
> Since your using .NET, this wouldn't be necessary.
This is simple to answer - the COM is supposed to interact with a
MSWord which is installed on the client machine.

> This is probably the most important issue. Even though you are creating a
> COM Callable Wrapper for your .NET Control, it is still a COM wrapper for
> your .NET code. The .NET code will still have to execute on the client side
> (since you were making this installed on the client). Therefore the .NET
> Framework 2.0 would have to be installed on each PC. The beauty of .NET Web
> Controls is that they run server side, so the .NET Framework would only have
> to be installed on your web server. Your control would not work because the
> Framework is not installed.
Yes, the limitation are known to me (I've written them down myself).

> Again, because the clients did not have .NET 2.0, regasm would have failed
> as well.
I disagree. As I've tried to explain, the current test machine has .NET
2 installed, and the user is an administrator on that machine.
Therefore regasm theoratically should not have failed.

Alon

5/15/2006 10:11:00 AM

0

Hi,

I'm in the same state as you but cannot use VS6...
Have you ever succeed to solve it?

another question, when you said you digitaly signed the cab file - did you
use the internal buid in signature or a 3rd party valid signature you bought?

thansk,


(Elad Volpin)

5/17/2006 8:01:00 AM

0

Sorry, but I have no other solution.

The digital signature is by Verisign, AFAIK