How to use WIX MSI to do a silent install or uninstall of a web app
When it comes to installing or uninstalling an application package, the level of user interaction can vary based on your specific needs. In cases where you prefer to minimize user involvement, a convenient solution is to opt for a silent install or uninstall. With a silent installation, users are spared the hassle of navigating through an installation wizard and repeatedly clicking the "Next" button.
This approach proves particularly beneficial in scenarios where you need to perform multiple installations or uninstallations, such as in enterprise settings or when deploying software across numerous devices.
If you're using WiX and you want to learn how to create an MSI package for a silent installation or uninstallation of an application, this article is exactly what you're searching for.
How to silently install and uninstall the MSI package
When you are creating an MSI installation package with WiX, you have two options for performing a silent install and uninstall:
1. Do not add any UI/UIRef elements to the installer package.
If you use WiX to create an MSI package, it will not have a built-in user interface by default (except for a simple progress dialog).
To add an user interface to an MSI created with WiX, you have to use the WiXUI library. This is the standard user interface that WiX Toolset comes with. When creating a setup project, this library is not referenced by default. So, you will have a silent install if you do not add a reference for this library.
2. Use command line arguments.
This option is available regardless of the software used to create MSI packages; therefore, it is available for MSI packages created with WiX. MSIs use msiexec.exe to install and uninstall the setup and accept the following silent install standard parameters:
- /quiet: quiet mode → no user interaction required
- /passive: unattended mode → the installation only shows a progress bar
- /qn → specifies there is no UI during the installation process
A regular command line used to install an MSI silently should look like this:
msiexec /i <AppName.msi> /qn /l*v install.log
You can use the /l*v install parameter to create an installation log. As the GUI is hidden, the installation log helps you identify the errors that can occur during the installation process.
If your installation package uses an EXE bootstrapper, you have to use a specific command line to launch the MSI. This command line can use the same parameters as when the MSI is launched with msiexec. The parameters will be passed to the MSI package.
Keep in mind that you must use an elevated command prompt to silently install an MSI package. Otherwise, the installation will fail as you do not have the privileges to complete the installation. To achieve this, use the Run as administrator context menu option.
How to make the MSI installer package silent using Advanced Installer?
When using Advanced Installer to create an MSI package, you have the opportunity to enhance the user interface (UI) with attractive and robust themes. However, if you intend to execute a silent installation, you can effortlessly achieve this by enabling the "Limit to basic user interface" option. By selecting this option, the MSI will perform a silent install, displaying only a simple progress indicator and error handling functionality.
You can find this option on the Install Parameters page, under the Install Options section. Once enabled, a progress bar will be displayed throughout the installation process, ensuring a seamless experience for the user. With this setting in place, users won't need to perform any actions during the installation, as it will proceed automatically in the background.
Conclusion
To perform a silent install using WiX without command-line arguments, you can omit or avoid adding a reference to the WiXUI library. However, with Advanced Installer, you can simply check the option available through the GUI to limit the MSI installation to a basic user interface.
Discover the Advanced Installer UI level settings by watching the below video: