Installers - an overview
This page starts with an overview of creating an installer for an EA AddIn and outlines how many of the topics are structured into their own areas.
What does the installer do?
An installer provides a means to deploy an application on a windows system placing files in appropropriate locations (some of which may be selected by the user during installation) as well as optionally set-up configuration files, registry entries and other information that may be used by the application and/or of use to the user.
Typically an installer file will be a "MSI Microsoft Installer file", which itself is a database which contains components and instructions about what should be installed on the system and is an input to the msi installer program (misexec - see below)
There are other installer applications and there is always the option to write your own installer subject to meeting windows requirements.
What is needed to install an EA Addin
An EA AddIn at its lowest level is a class library (DLL) that includes a class which implements functions that are defined as part of the EA interface.
During initialisation EA checks specific registry keys to identify classes that it should "attempt" to load as AddIns's, hence these classes must be registered.
Therefore the role of an EA AddIn installer is to:
- Copy the library file(s) to default or selected file locations
- Register the libraries
- Set Registry keys to link to EA to our AddIn library
The installer may do more to support the functionality of our AddIn, but in general they are similar requirements.
Although the tasks outlined above could be performed manually it is far easier and infinitely less error prone if specialist tools are used to perform these tasks.
Windows installer - msiexec
There are a range of installer tools available. My choice has been to use the windows installer files (.msi) which can be installed using the Microsoft msiexec tool.
The .msi file is created to include all the data needed by msiexec. This will contain:
- checks to be made prior to starting the installation
- Is the enviroment suitable?
- Any there any existing version of our files?
- Is this an upgrade?
- copies of libraries plus any other files that will be installed
- default installation locations
- Registry keys to be set and their values
- Classes to be registered
For other msiexec topics see msiexec topics
Using WiX to create the .msi file
To create the .msi file I use the WIX installer toolkit, with the Visual Studio enviroment where a WIX project can be configured and relevant source files defined.
The output of a WIX project will be an MSI file which can then be run.
WIX supports creating very simple installers with no or a simple UI as well as more sophisticated installers with extensive dialogs.
For other WiX topics see Wix topics
EA AddIn installer examples
Within this pages I have included some examples to illustrate both a minimal installer and an installer that provides customer dialogs to support options. Much of the interesting content is within the WiX Examples area
A key topic for anybody working with installers is the Windows Registry. Topics such as Registering a DLL may be useful.
See Registry topics