C++ – How To Prepare An ActiveX Control For Delivery Over The Web

activexccommfc

So i have the misfortune of embedding this proprietary ActiveX control we created into a web page so that it downloads the code from our server and installs as necessary.

Our ActiveX requires a host of other files which need to be installed along with the activex control itself. It should also be noted that the activex and all its dependencies are c++-based COM objects (many use MFC).

So I read this article about it:
http://msdn.microsoft.com/en-us/library/aa751974(VS.85).aspx

But it leaves a lot of things unanswered. For one thing, my ActiveX is actually embedded in a DLL file that contains other COM interfaces. Also, is it possible to have the mentioned cab file include the ActiveX/SDK installer and run that if the GUID isn't present? For example:

[version]
signature="$CHICAGO$"
AdvancedINF=2.0

[Add.Code]
Setup.exe=Setup.exe

[Setup.exe]
file-win32-x86=thiscab
run=%EXTRACT_DIR%\Setup.exe

Security is not an issue here as this is an intranet-based solution (not available publically).

Also, the article mentioned here seems really old. Is there more up to date info available?

Best Answer

You can create a dependency between the installer and a dll that is on the system like this:

[Add.Code]  
Your-dll-name  

[Your-dll-name]  
Version=Your dll version  
hook=setup.exe  

[Setup.exe]  
file-win32-x86=thiscab  
run=%EXTRACT_DIR%\Setup.exe 

If the system cannot find your dll or the version is lower, then it will run the setup.exe that suppose to install and register the dll.

Related Topic