Step-by-Step Guide: Generating a WiX Installer's KeyPath Property
Step-by-Step Guide: Generating a WiX Installer’s KeyPath Property
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 create a WiX KeyPath attribute
Written by Horatiu Vladasel · October 4th, 2022
One of the main benefits of using Windows Installer to build your software installer is the “self-repair” or “self-healing” capability. This option is particularly useful when keypaths are missing or broken.
How do you trigger the self-repair mechanism?
The most common way to trigger this feature is to launch an advertised shortcut. The way it works is that when this advertised shortcut is launched, Windows Installer checks the keypaths for all the components included within the same feature as the advertised shortcut. If any of them is missing or broken, it prompts the self-repair mechanism.
In this article we will go into how you can set a KeyPath in WiX.
How to create a WiX Keypath?
1. To get started, you must set the KeyPath attribute of the Component element to “yes”.
By doing this, the Directory of the Component is used as a keypath.
If you want to set a File or a Registry value as a keypath for the Component, then you must set the Keypath attribute of the File or Registry element to “yes”.
Copy
2. Now, you must declare the shortcut element and ensure that it has the “Advertise” attribute set to “yes”.
Copy
3. And that’s it. You have fully declared an advertised shortcut which triggers the self-repair mechanism when the component keypath is either missing or broken.
The complete listing for the WiX source file should look like the one below:
Copy
At last, you can go and compile the WiX source file and process the resulting WiX object tile to build your MSI package.
How to Create a Keypath in Advanced Installer?
When you build and create your Windows Installer MSI package with Advanced Installer, you will see that the process is fairly straightforward and easy to follow.
All you need to do is to ensure that the “Advertised shortcut” box is checked.
And that’s it! Advanced Installer follows Microsoft’s best practices when it organizes your resources in features and components. It automatically sets keypaths for all the components.
If for any reason you need to reorganize your resources or change a keypath, then you can do that from the Organization page .
Do you want to create a WiX Keypath without writing code? Try Advanced Installer’s free 30-day full featured trial and do it in one-click.
Conclusion
Setting up keypaths for the components within your installer is mandatory if you want to take advantage of the “self-healing” feature.
If you are using Advanced Installer, that can be done very easily, with just a few clicks.
Hope you enjoyed this article! If you have any other questions on WiX, write them in the comments below.
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] Document Your Days with Xiaomi's State-of-the-Art Screenshot Tool
- [New] In 2024, Navigating the Nuances of Mukbang Filmmaking Techniques
- [New] Rise to the Top - Livestreaming on YouTube, No Matter How Low Followers Are
- [Updated] 2024 Approved Virtual Frontiers Current Trends in VR Tech
- [Updated] From Live to Legacy Preserving Facebook Events for 2024
- [Updated] The Path to Profitable Videography Starting Strong for 2024
- Best Video Transcoding Tools for Ubuntu Users: Top 8 Picks
- Convert AVI Files to M4A Format for Free with Movavi's Online Software
- Descargar Convertidor Online Libre Para Cambiar De GIF a PNG
- Gratuíssimo Convertidor OGG E APE Em Linha Pelo Movavi
- Movavi's No-Cost Media Transformation: Easily Convert M4A/MPEG to M4V Formats
- Movavi's Web-Based, Free Service for Changing M4V Video Format to Movie (MOV)
- Purchase Immediate: Sky-High Video Fix
- Ultimate Troubleshooting Tips to Fix STOP Code 0X0000007B and End Those BSOD Issues
- Updated 2024 Approved MP4 File Editor for PC Quickly Trim, Cut, and Merge Videos
- Virtueel Verwerpen Van ARW Naar PNG: Gratuite Online-Convertitie-Processen Met Movavi
- VOB를 무료로 MJPEG로 바꾸는 Online 도구 - Movavi
- Title: Step-by-Step Guide: Generating a WiX Installer's KeyPath Property
- Author: Donald
- Created at : 2024-09-27 18:05:58
- Updated at : 2024-10-03 18:08:38
- Link: https://some-tips.techidaily.com/step-by-step-guide-generating-a-wix-installers-keypath-property/
- License: This work is licensed under CC BY-NC-SA 4.0.