Windows Installer FAQ – Part 1

I am planning to write a series of posts covering some key discussions, topics and FAQs in the stream of application packaging. I reckon this post would help, when some of you look at a change in your careers or when stuck up with an issue. This would be my first post of the series. For few of the questions, I will post the answers as well. I would also post in questions, for which I do not know the answer. I would expect you guys to answer that for me 🙂

Well, I shall make a point clear, this is just an FAQ for Application Packagers. Please do use this FAQ ethically. Let me start from the Basics in this first Post.

Q1. What is Application Packaging and why is it needed?
Application packaging bundles applications and operating systems into a single file called a distribution unit (.msi), which makes it easier to deploy and install them on user’s computers. Packaging reduces the total cost of ownership for the customers by enabling them to efficiently install and configure the applications. This results in an application package, which provides the product with new capabilities like advertise features without installing them, installs products on demand, add user customizations etc. Read more on the Application Deployment and Compatibility tools here.

Q2. What process is generally followed while re-packaging applications?
These are the stages of the application packaging life-cycle:
1. Package request is received
2. Technical Evaluation of the Application Source is done.
3. Packaging
3.1 Capture
3.2 Editing
3.3 Testing
4. Quality Assurance (QA)
5. Deployment Testing (if Any)
6. User Acceptance Testing (UAT)

Q3. Why do we need Windows Installer Technology? How does it work?
Windows Installer is used to handle Application Installations on Windows Platform. Installer technology is made up of these three below elements which work together.
Windows Installer client – Any application that calls Windows Installer to perform a task (Example SMS distribution, Add Remove Program, Windows-based shell..etc. )
Windows Installer service – a System service “Msiexec.exe” for installing and managing applications.
Windows Installer package (an .msi file.) – A database file which is used to manage the various states of the application like adding, changing, or removing it from a computer.
A MSI file is a database, which contains information on which files/ registries needs to be installed. As its a database, the installer knows, what all gets into the machine. Hence, it takes care that, only the necessary components are removed while un-installation.

Q4. How does an MSi Install in a machine?
When an MSI is triggered for Installation, the msiexec service starts the installation and it follows these 3 phases.
Acquisition – In this phase, the MSI collects all the data and inputs from the user and generates the installation scripts. (When the user presses the cancel button, the installation rollbacks)
Execution – In this phase, the generated Installation script, gets executed and all the necessary files and registries are all set to get copied and the installation starts. (When the user presses the cancel button, the installation rollbacks)
Commit – In this phase, the MSI marks a footprint in the machine and goes towards a point of no-return. Means, in this phase, the installation cannot roll-back.

Q5. What are the advantages we get by packaging applications? / What are the advantages by using Windows Installer MSIs?
1. Customize Applications to suit the user needs.
2. Simplify the Installation and Un-installation Procedures.
3. Saves Time in both Installation and Un-installation.
4. Once packaged, applications can be quickly installed on a range of desktops in multiple locations, saving administrative costs, simplifying the licensing fees management and minimizing support and repair expenditures.
5. Saves Space of the product by doing apt modifications to applications.
6. Has a great flexibility of obtaining the lost files through a phenomenon called Self Heal, this reduces the down time of application. If a critical file (a .DLL or .EXE file, for example) that is part of the distribution is corrupt or is deleted, the user can be prompted to repair the installation by presenting the original .MSI distribution. Additionally, if the installation media is available (for example, on a network share), the repair simply happens automatically.
7. Can be advertised. So that on demand installation could take place.
8. Application upgrading can be done with ease
9. Clean installation and Un-Installation is achieved by a process called Roll-Back.
10. Simplifies management of new user set-up along with the revision and distribution of software repairs and new applications to existing users. Application recovery can also be improved.
11. Helps eliminate uncontrolled software downloads and installation, enables applications to be safely removed and reduces non-business traffic on a corporate network.
12. Using .MSI format, can automate software distribution process and ensure that the installation doesn’t break other applications that have already been installed.
13. Application is installed via an OS service.
14. State management is maintained. In the past, it’s been difficult to know whether an application is installed on a machine. You would have to query for a .DLL with a specific version number or determine whether an .EXE file with a specific name was present. Windows Installer provides an application programming interface (API) that lets programmers and administrators see whether a specific application is installed on a machine.
15. Scriptable API. This whips together a VBScript to help us with the MSI file manipulations. The API to manipulate MSI files is so powerful that it can create, validate and update packages, trigger installs and uninstalls, examine the MSI repository data on computers, and perform some custom actions.
16. Served installs. Because MSI files can be housed in a share point and delivered via a server, we can keep our installation files all in one place or move them around — closer to the users if necessary.

I would recommend, You read the other parts too – Part 1 , Part 2 , Part 3 , Part 4