How to create an MSI to install and register an ActiveX Control?

Solution 1:

What you're asking for is completely feasible. The "how" you do it, basically, is to learn to use an MSI authoring tool, determine where the files need to go on the hard drive, determine what needs to go into the registry, and build an MSI file that does what you want.

Personally, I use the Windows Installer XML (WiX) toolkit to build MSI files.

  • There is an absolutely wonderful WiX tutorial maintained by Gábor DEÁK JAHN. If you're looking to build a silent installer w/ no UI then there is a lot of this tutorial that you don't really need to learn, but it's still great stuff.

  • Although it applies to WiX 2.0 (which isn't the current version, but is still available and works just fine), this WiX tutoial does a pretty good job.

There are a lot of third-party graphical MSI builders out there, too. They break down into snapshot-based and non-snapshot-based.

The snapshot-based package builders suffer from the problem of picking up unrelated changes to the snapshot computer during software installation and can create really messy packages. I will sometimes use a snapshot tool to get a "feel" for what an installer does, but I always build my production packages by-hand.

The non-snapshot-based systems are usually just graphical IDEs for the MSI schema (and some general WiX XML source files that are "compiled" with WiX), allowing you to drag and drop, etc, to create packages.

Whtever you do, gaining some knowledge about how the Windows Installer works will give you the best chance of building good packages. Microsoft's documentation is a bit dense, but there's a lot of good stuff in there. In the end, I've found that trial-and-error has been the best way to get familiar with the nuances of Windows Installer.

Solution 2:

I have successfully done this a few times using the following steps:

  1. Extract all files from the cab into a new folder
  2. Open a command prompt and cd into that directory
  3. Run heat like so:

    "c:\Program Files (x86)\Wix Toolset v3.9\bin\heat.exe" dir . -cg CoreCmpGroup -gg -template fragment out.wxs

  4. Then use the out.wxs in your project. All COM registrations etc. will be done magically for you. :)