After developing an application, you must be able to deploy it on the end user's computer. For this, there are several methods that each respond to different needs. Before choosing the one that suits you, you must first ask yourself a few questions:
- What should we deploy? files, desktop shortcuts, registry keys, file associations, and so on.
- What are the dependencies and how to install them? You must also pay attention to version conflicts in the case of shared components
- Who performs the deployment? The user, an administrator, centralized management (Active Directory)
- Installation by user or machine?
- Does the application require settings for its installation? Installation location, optional components, license, etc.
- How to check that the application is installed?
- How to update the application once deployed? Frequency of update?
- How to uninstall it?
- Transactional installation and update (all or nothing)?
- and surely others…
Here are several ways to deploy an application:
Copy of the application files
This is probably the simplest solution: simply copy the application (executable or zip archive) to a place accessible to the user (web, ftp, shared directory). The user manages to retrieve it and copy it wherever he wants.
The applications deployed in this way must be uninstalled without any problem and without leaving the system in a wobbly state by simply deleting the executable.
Windows Installer is the standard way to install software (documentation).
Windows Installer (formerly Microsoft Installer) is a component of Windows that installs, updates, and uninstalls programs. The developer creates a package (MSI file) that, without going into details, describes the deployment steps: creating folders, copying files, creating registry keys, creating shortcuts, launching an executable, etc. But Windows Installer offers many other features including:
- Installation with graphical interface or silent installation
- Ability to split the application into several features. The user can thus install only the functionalities which they need. For example the Office installer allows you to choose which product of the Office suite you want to install (Word, Excel, PowerPoint, Access, …)
- 2 installation contexts: By machine (all users) or by user
- On-demand installation: The application (or feature) is only installed when it is first used
- Logging the installation
- Transactional installation: 1 transaction per MSI or 1 transaction for multiple MSI
- Ability to sign the MSI file with Authenticode
This solution has a lot of features and is standard on Windows. However the free tools for creating MSI packages are not all intuitive. Among these are WiX or Visual Studio Installer Project (native under VS2010 and available as an extension for VS2013).
Same principle as Windows Installer, but generates an executable (.exe) and not an MSI. The generated package does not use Windows Installer and does not benefit from its advantages. It also makes it more difficult to integrate with different deployment solutions such as GPOs. This type of installer is generally easier to create than an MSI file.
ClickOnce is an installer for .NET applications. It allows to deploy an application by answering 3 problems:
- No need for administrator rights ⇒ All users can install the application
- Each application installed in a specific folder ⇒ This avoids problems of conflict with shared components
- Integrated update system
The deployment is very simple: just copy the files generated by ClickOnce on a website, a shared folder or a simple folder (in the last case, there is no automatic update). Just like the MSI it is possible to sign the installer.
ClickOnce is very simple to implement and meets a specific need however there is no way to customize the installation (GUI, location of installed files, parameter during installation, etc.).
Packet Management System
To handle the deployment of COTS (Commercial off-the-shelf), Unix systems have long used package management systems: Aptitude, Yum, etc. Chocolatey and others are trying to provide the same mechanism for Windows.
Chocolatey is based on PowerShell and the Nuget format. Chocolatey provides CmdLet to quickly wrap traditional installers (MSI or EXE) and allows you to do what you want with the power of PowerShell.
Currently this type of solution is not yet widely used, but it will surely evolve with the arrival of Windows 10 and OneGet! Stay tuned!
- No need for installation ⇒ Copy of files
- Simple need and user installation ⇒ ClickOnce
- More advanced need ⇒ MSI
Optionally you can wrap the chosen solution in a package Chocolatey.