Implementing Updates in Installed Software via Windows Installer XML (WiX)
Implementing Updates in Installed Software via Windows Installer XML (WiX)
Inno SetupWiX ToolsetInstallShieldMSIX Packaging Tool
Check your inbox and confirm the
subscription
Exclusive Newsletter
Exclusive Newsletter
Get the latest WiX insights direct to your inbox. Subscribe now!
Disclaimer: This post includes affiliate links
If you click on a link and make a purchase, I may receive a commission at no extra cost to you.
How to Use WiX MSI to Update an Installed Application
Written by Renato Ivanescu · April 27th, 2023
The process of developing software should always include a solid mechanism for application upgrades.
In this article, we will see how we can use WiX to create an installation package that will install a new version of an MSI application after removing the previous one.
How to Create a Windows Forms Application in Visual Studio
For this tutorial, we’ll use Visual Studio to create a simple Windows Forms application that will be installed and then updated. To create the application, follow the next steps:
1. Go to File → New → Project.
2. From the templates list, select Windows Forms App.
3. Configure your project in the configuration dialog and then press the Create button.
How to Add the Setup Project for WiX in Visual Studio
Now, let’s create the installer package for our application. We need to add a setup project to our solution, and for this we’ll use the WiX extension for Visual Studio.
Make sure you have the WiX extension added to Visual Studio. You’ll also need the Wax extension which provides a setup editor to help you create, verify and maintain the list of deployed files.
Follow the next steps to add the setup project:
1. Right-click on the Project Solution → Add → New project.
2. From Templates, select Setup Project for WiX.
3. Configure the project and press the Create button.
Once the setup project is added, you should see it in the Solution Explorer.
How to add the project output using the WiX Setup Editor
Next, we’ll use the WiX Setup Editor to add the deployable files to our setup project. To open the editor, go to Tools → WiX Setup Editor. Then, make the following configurations:
- Select the Setup Project added to your application.
- In the Root directory, select INSTALLFOLDER.
- Then, in the Projects to install section, select the application you’re creating the installer for.
How to set the WiX Installer Version of Your Application
Before we create the MSI and install the application, let’s set a version number for our application.
Edit the Product.wxs file in the setup project and set the product version to 1.0.1 as seen below:
Copy
Now you can build the project and install your application by running the MSI file. You can find it in the setup project → bin → Debug. When the application is installed, you should find it in the programs list in version 1.0.1.
How to update the application
Let’s suppose we made some changes to our application. We’ll generate a new MSI that will uninstall the previous version and install the new one. For that, you must follow these steps:
1. Make sure you change the Product ID. This is a unique GUID used to identify your application. To avoid setting it manually, you can replace it with the “*” symbol. Thus, it changes every time you build the project.
2. Let’s also increase the version number from 1.0.1 to 1.0.2.
Copy
3. Keep your UpgradeCode constant. As you can see, the UpgradeCode remains the same for the updated version.
4. Use the MajorUpgrade element. This element includes the most common options for updates. If you increase the version number at the first step, you only have to add the MajorUpgrade element with no other attribute, like in the example below:
Copy
5. In addition, if you want the new application version to keep the previous version number (in our example 1.0.1), you have to set the attribute AllowSameVersionUpgrade to yes.
Copy
Once you complete the steps above, you can build and run the MSI. The previous version of your application will be uninstalled, and the new one will be installed.
Conclusion
WiX allows you to upgrade an application’s installed version by modifying the XML-based definition file. Alternatively, you can use Advanced Installer’s GUI, which enables you to upgrade your application instantly.
Advanced Installer #1 alternative to the WiX Toolset
We decided to focus on our main goal to save precious time of our developers.
HANS-LEO TEULINGS
PHD – CEO, NEUROSCRIPT, LLC
You might find useful:
- CAB Embedding Options in MSI
- Updated installers in WiX Toolset
- Custom Actions In WiX Toolset
- Windows Services with WiX Installer
- Set WiX Installer Version to the Current Build Version
- Remove Files and Folders when Uninstalling with WiX
- How to set a WiX Toolset custom action to run only on uninstall
- How to create non-advertised shortcuts for all users / per machine with WiX Toolset
- How to Remove Files on Uninstall Using WiX Toolset
- How to create major upgrades for MSI packages using WiX Toolset
- How to pass CustomActionData to a CustomAction using WiX
- How to build an installer without a license page using WiX Toolset
- How to create a WiX KeyPath attribute
- How to Create a Desktop Shortcut using WiX Toolset
- How to Use WiX MSI to Update an Installed Application
- How to correctly set the install folder in Wix
- WiX Toolset Visual Studio Extension
- How to create a custom dialog in WiX for user input
- How to create an MSI installer with WiX
- How to use WIX MSI to do a silent install or uninstall of a web app
Get the most from packaging with Advanced Installer
Try the 30-day fully-featured edition absolutely free!
No credit card required
Also read:
- [New] 2024 Approved TweetVid to MP4 - Quick Conversion Tool
- [New] The Top 10 Lifters Drones That Move Mountains
- 1. Experiencing Authentic Google Chrome on an iPhone: A Hands-On Review
- Cómo Convertir Archivos TS en MP4 Sin Perder Calidad: Una Guía Paso a Paso
- Effortless Electronic Exchange 5 Secure Pathways to Your PC
- Free Online Tool: Transform Your GIFs Into MKV Videos with Ease
- Gratuit Online - Converseren Van M4V Naar FLV Met Movavi
- In 2024, How to Change/Add Location Filters on Snapchat For your Itel P55T | Dr.fone
- MPG MP4 영상을 무료 음성화 - Online 기술과 Movavi 사용자가 필요한 곳
- Navigating Technology Trends at Tom's Computer Resource
- Optimize Your Gaming Experience: How to Install Latest Drivers for GeForce GTX 1660 Super GPUs
- Pro Video Recording on iPhone Meets Instant Photos
- Revolutionizing On-the-Go Browsing: The New Feature of Personalized Shortcuts in Vivaldi Mobile Browser
- Speedy Android Video Slicing Using Movavi Clips: A Comprehensive Tutorial
- Speedy Disney Disc Extraction: The Best DVD Ripper Tools Online
- Urgent Update Required: Secure Your System From Google Chrome's Latest Exploit
- WireGuard Integration Available in Proton VPN's New Release – Improved Privacy and Speed for Linux Users
- Title: Implementing Updates in Installed Software via Windows Installer XML (WiX)
- Author: Donald
- Created at : 2024-10-01 20:08:58
- Updated at : 2024-10-03 16:07:53
- Link: https://some-tips.techidaily.com/implementing-updates-in-installed-software-via-windows-installer-xml-wix/
- License: This work is licensed under CC BY-NC-SA 4.0.