Where to start learning Windows Installer?

    Installer picWindows Installer Technology (MSI) is the de facto standard in the world of system administrators who distribute and support software for desktop and server versions of Windows. The MSI format is supported by all the largest configuration management systems (Microsoft SCCM, CA Unicenter and many others), and for some software distribution systems it is the only supported format.
    My experience with this technology, both theoretical and practical, was gained during my time at Infopulse Ukraine and related to the creation of MSI packages and the preparation of ready-made MSI packages for automatic installation in a corporate environment.


    Why do you need this?


    If you are involved in the centralized installation of applications on Windows networks, knowledge of the MSI format and the ability to create and edit packages in this format can be very useful for you when preparing the package for deployment and diagnosing problems. In Europe and the USA, Windows Installer technology is in demand by many large customers, so knowledge of MSI can be a plus for a system administrator in employment.

    What you need to know and be able to before learning?


    Nothing complicated. If you have experience administering and supporting a small (and preferably a large, hierarchical) network of Windows machines, most likely you have already come across the basic questions and concepts that you will need. Before you begin, make sure that you understand the structure of the Windows file system, the structure of the user profile, and the structure of the registry, you know what processes and services are in Windows, you can manage user accounts, and you know where the event logs are. In order to learn how to create MSI packages, you do not need to have developer experience, although of course it is better if you have such experience. And it’s not at all necessary to be able to write SQL queries, although this can also be useful (after all, every MSI file is a small relational database). But you must be able to read and understand the technical documentation in English, without this, most likely nothing will work. When studying the theory (and when creating packages in practice), at least initially try to strictly follow the Windows Installer standards, avoiding utility utilities such as InstallShield / InstallScript, so you’ll better understand how to create the MSI package correctly.

    We prepare the sandbox and begin the practice



    You need to start by installing and configuring a virtual machine. In the learning process, you will have to experiment a lot, so it’s better to do it in the sandbox. If you need free products - install VirtualBox or  VMWare Player (for professional tasks, their functionality may not be enough, but for training - it’s quite suitable). In a virtual machine, of course, you need to install Windows of your choice (XP and above).
    If you already have experience with utilities from Sysinternals - great. If not, it's time to fill the gap. We need at least two: to monitor the file and registry activity of the application during installation or during its operation - Process Monitor , to start the installation on behalf of the LocalSystem account -PsExec . Practice using these utilities on a simple application such as notepad (what resources does notepad work with when opening a file, when saving a file; run notepad as a LocalSystem user, experiment with saving files and setting file associations), these skills will come in handy later on.

    Install Panda QuickShot or other software to compare system states. Understand the basic functionality, learn to track file and registry changes in the system when installing a new application or changing system settings (the simplest is to register a new file association for notepad, change the desktop wallpaper and track where these settings are stored). Get creative, the field for experimentation is vast.
    Panda orca pic
    Download the MSI installer of some simple application (for example, Orca, InstEd or Firefox). Install the package on a virtual machine, using the utilities described above, study the resources it installs. Learn how to use the Windows Installer command line (msiexec /?), Experiment with various installation options and compare the result. Uninstall the application from the command line, install the package in silent mode.
    Install InstEd or Orca on the host machine. Open the MSI package that you installed on the virtual machine using one of these utilities. Compare the records of the main tables in the MSI package (File, Directory, Registry) with the resources (files, folders, registry keys) installed by this package on your virtual machine (the result of comparing snapshots using Panda QuickShot).
    InstEd Orca pic

    Bit of theory


    Now is the time to tackle the theory. I will not duplicate the official documentation and some useful articles on the links below, just try to list the things that you need to deal with first:

    Support the reading of documentation on these topics by experimenting with finished packages, and over time, you can try to make the package yourself . This knowledge will be enough for you to make small changes to MSI packages when preparing for deployment in a corporate environment (typical tasks are setting package properties, editing the registry, deleting files and shortcuts, disabling the Remove button for an application in Add / Remove Programs). Just do not forget to make rigorous testing after making any changes to the package before putting the package into commercial operation. When testing, be sure to use the recommendations provided in  this article .
    I think this is where you can finish the introductory part. In the future (if there is interest), I will try to talk about the features of some ready-made MSI packages provided by software manufacturers for deployment in a corporate environment and consider other issues of interest to system administrators.
    Suggestions, comments, and suggestions on topics for the following articles are welcome.

    Overview of utilities and documentation


    You can use simple editors of MSI files with limited functionality for free - here we mention the classic Microsoft Orca and the rather convenient InstEd. These editors allow you to make small changes to finished MSI files, create and apply transforms, but creating MSI packages in them from scratch is quite difficult (and for large packages it does not make sense at all). But if you really want to learn the MSI technology, you just need to collect a couple of simple packages in InstEd or Orca and validate them for compliance with the Windows Installer standard.
    Specialized utilities for performing setup capture (creating or converting installation packages from the so-called "old formats" to the MSI format using a comparison of "snapshots" of the system before and after installing the application or monitoring changes in the system on the fly) is a free AppDeploy Repackager , or the more serious MSI Generator .MSI packages created using these utilities may require some refinement, which can be done using the MSI editor.
    Serious full-featured (and very expensive) IDEs that provide support for the full cycle of work with MSI packages - if you work on MSI technology professionally, you most likely can not do without these programs. Until recently, two products dominated this segment - AdminStudio from Flexera and  Wise Package Studio from Symantec, but Symantec recently announced the cessation of work on the development of Wise Package Studio, and the market is in the hands of Flexera. In addition to working with MSI, AdminStudio allows you to work with virtual packages of Microsoft App-V, VMware Thin App and Citrix XenApp formats. For trial purposes , a trial 21-day version is available.
    Separately worth mentioning WIX(Windows Installer XML) - a set of utilities for creating .msi files from XML descriptions. This project was released by Microsoft under an open Common Public License, supports a command line interface, and can be used to automate the creation of versions of installation packages. There is a good description on Habré .

    Useful resources:


    Articles on Windows Installer on RSDN: one , two . They are good because they describe the basic concepts and concepts of MSI in Russian and in a fairly readable form. Articles are a bit outdated (describe standard 2.0), but they have not lost relevance. It is important to understand that just these articles to study MSI are not enough - you need to read a lot of MSDN and practice a lot.
    Articles on MSDN  are the most comprehensive source of information that will be needed in the process of studying and further work. There are step-by-step exercises for practicing creating MSI packages from scratch.
    AppDeploy.com - A public knowledge base on applications, you can often find features of installing or configuring ready-made packages released by large vendors (Adobe, Microsoft), command lines to automate installation, and other useful things.
    For convenience, I’ll duplicate links to programs from the text in one list:

    Also popular now: