ActiveX automatic setup from internet explorer

O

Ofer Lavi

Hi,

I am trying to build an activeX that, if missing, will be downloaded
and setup automatically on the client's browser (internet explorer).

Using VB6, it was easy, using the <Object> tag, the classid attribute
for its reference, and the codebase attribute for its .cab file.

Now, I am using vb.net. I managed to create the object (using
ComClass<...> and ClassId, InterfaceId and EventsId.

Also, compiling it on the machine, marking the "register for COM
Interop" checkbox under the "build" property page. The object is
registered, and I can use it in a web browser.

I also managed to create a setup file (.msi) using Windows Installer
Bootstrapper, which takes the output from the first project, and I can
use it to install the object on other computers.

However, It does not download automatically, nor showing the security
warning that comes with downloading ActiveX objects. The problem is
not a browser security problem. If I use a direct link to the .msi, it
downloads it and installs it. I also tried packaging the files in a
..cab file, and use no bootstrapper, or web bootstrapper (in the setup
project property pages) but with no luck.

Thanks,
Ofer.
 
C

Crirus

What do you mean by setup?

I did such activeX embedded in a html and simply run from the client
computer... sure, it is downloaded like an applet first.

<object id="Test" classid="resTestVB.dll#resTestVB.picResShow" height="500"
width="500" VIEWASTEXT>
<param name="Text" value="Simple Control">
</object>
 
F

Felix Wang

Hi Ofer,

Thanks for posting. However, Windows Installer MSI can not achieve your
goal. If you point to an MSI file directly, it will be treated like an
ordinary file (download or open). The "Web bootstrapper" you mentioned in
fact refers to another feature. For example, we have a setup.exe. If we run
it, it will go to a particular web site and install a Windows Installer MSI
file. Then the "setup.exe" is a web bootstrapper.

To package an ActiveX control, we still need to use a CAB file. Packing the
files into a CAB file may not be sufficient. We also need to add an INF
file into the CAB if we have a number of other files in the cabinet, so
that Internet Explorer will know what files need to be copied and what
files need to be registered in the cabinet.

For more information on the issue, you may visit the link below:

Packaging ActiveX Controls
http://msdn.microsoft.com/library/default.asp?url=/workshop/components/activ
ex/packaging.asp?frame=true

On the other hand, the root of the issue here is that the DLL file
generated by VB.Net in fact is not a pure COM component. We may try to
register it with "RegSvr32.exe" and we will see an error message. Instead,
we need to register it with the "RegAsm.exe". As a result, putting the DLL
in an ActiveX CAB package will not work either. The following information
is for your reference as well:

Registering Assemblies with COM
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
l/cpconregisteringassemblieswithcom.asp?frame=true

I hope the information I have provided here is useful to you. If you have
any concerns or new findings regarding this issue, please feel free to let
me know.

Regards,

Felix Wang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top