InstallShield Tips and Tricks

MSI Installations - Best Practices

What is an MSI Installer?

Before we get to an MSI Installer, let’s start with how applications were deployed prior to MSI installers becoming a standard. Back in Windows 3.1 or Windows 95 days, developers who wanted to deploy apps on Windows used to come up with scripts that determine how the various components of the application need to interact with the Windows operating system. Like if a registry entry needs to be created, a script had to be written. Now, this led to pretty unstable application deployments and resulted in Windows being left with a lot of leftovers from the installers.

When Microsoft came with Windows 2000, MSI was first introduced as a standard for deploying applications into Windows OS and is still the most favored installer tech.

MSI installers are designed as a relational database that stores information about the files, directories, registry settings, and other resources required for the installation process. One of the key advantages of MSI installers is their ability to provide a standardized and consistent installation experience. They support features such as silent installations (unattended installations without user interaction), custom user interfaces, and rollback capabilities in case of installation failures. MSI installers also offer advanced features for application management, including patching and upgrading existing installations. They provide options for handling conflicts, managing dependencies, and enforcing rules and conditions during the installation process.

Overall, MSI installers simplified the installation and management of software applications on Windows systems, providing a standardized and reliable approach for software distribution and installation.

How to Create/Edit MSI

If you are a Visual Studio developer, the easiest way to start creating your Windows installer is to use Microsoft Visual Studio Installer Project from the Visual Studio marketplace. Since this is a free offering from Microsoft, this comes with several limitations.

You could use third-party software like InstallShield to create MSI installers.

Here is short video on how to create your first MSI installer using InstallShield:

Targeting/Preventing installers to run on a specific Windows OS

You may be a developer or a software vendor who is developing apps for modern Windows OS and may want to prevent users running older versions of Windows from running the installer. Or you are developing an app specific to Windows 10 and above and want to avoid Windows 7. InstallShield provides a way to use what’s called ‘Launch Conditions’ in MSI to accomplish this.

Please read this blog post to understand more.

Using Custom Actions when building an installer

Though MSI installers are robust, there will certainly be occasions where you want to execute a particular custom exe or a custom script at a installation sequence. MSI installers have a provision named ‘Custom Actions’ that help you execute a specific script or call a library from a dll during the installation.

Please read this blog post to understand more.

Use of Merge Modules for reusing common components in MSI Installers

A merge module is a component used in the context of MSI (Microsoft Installer) technology. It allows the sharing and reuse of common components and resources across multiple MSI-based installations. Merge modules provide a way to encapsulate and distribute specific functionality or dependencies as a standalone unit that can be included in different MSI installers.

Merge modules typically contain files, registry entries, and other resources necessary for the proper functioning of a particular component or dependency. For example, a merge module may include runtime libraries, shared components, or custom controls that need to be installed alongside an application. By using merge modules, developers can avoid duplicating components and reduce the size of their MSI installers. This modular approach enables easy management and maintenance of shared components, as any updates or fixes can be applied to the merge module, which will then be automatically reflected in all the MSI installers that include it. Merge modules are created separately from the main MSI installer. Once created, they can be referenced and included in multiple MSI projects as a component. During installation, the merge module's contents are merged into the main MSI installer, ensuring that all the necessary files and resources are installed together.

Please read this blog post to understand more.