Step-by-Step Guide to Building Windows Desktop Icons with the WiX Toolset
Step-by-Step Guide to Building Windows Desktop Icons with the WiX Toolset
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 Desktop Shortcut using WiX Toolset
Written by Renato Ivanescu · February 15th, 2023
In this article, we want to focus on desktop shortcut creation specifically for a Windows Forms application using the WiX Toolset.
Shortcuts serve as a valuable tool in the development of applications, allowing for an easier way to find and launch programs. It’s a common practice to create shortcuts during application installation, especially for desktop access.
Before we get started, you need to make sure you have the WiX Toolset extension for Visual Studio. Check out this article: WiX Toolset Visual Studio Extension to see how you can add the extension to Visual Studio.
How to add the WiX setup project
Once you have the WiX Toolset extension added to Visual Studio and your Windows Forms application is up and running, you need to create a setup project.Follow these steps to create a setup project for your application:
1. Right-click on the project solution → Add → New Project.
2. Choose Setup Project for Wix from the project list.
3. Once you add the setup project, you should find it in the Solution Explorer.
4. To add the desktop shortcut, we have to edit the Product.wxs file.
How to edit the Product.wxs file to add your desktop shortcut
1. Define the directory structure
To include a desktop shortcut in your package, it is necessary to declare the desktop directory. You can achieve this by modifying the
Copy
2. Add the shortcut to your package
Once the desktop directory is added to the directory structure, let’s add the shortcut to the installer package.
Follow these steps:
2.1. Add a reference to the desktop directory structure created at the previous step using
Copy
2.2. Define an atomic unit of installation using a
Copy
2.3. Specify the shortcut to be installed using a
Copy
2.4. Create a registry entry by using a
Copy
Here is how the final code should look:
Copy
3. Add an icon to your desktop shortcut
You can help your users find your application easier by adding an icon to your shortcut. By doing this, you not only establish familiarity with your application but also improve its recognition and accessibility.
Follow these steps to include the icon in your setup project:
3.1. Create a folder under the setup project (Icons), and copy the icon (Shortcuticon.ico) to that folder.
3.2. Then, you can add the icon to your installation package by declaring the
Copy
3.3. Next, you have to add a reference to the icon on the shortcut element using the Id you set for the icon.
<Shortcut Id="ApplicationDesktopShortcut"
Name="DSapp"
Description="My Application"
…
Icon ="MyIcon"
/>
Copy
4. Install the shortcut
In the final step, we need to instruct the installer to install the shortcut. We can achieve that by using a
Copy
Conclusion
While creating a shortcut with WiX can be a time-consuming process involving multiple modifications to the XML file, there is a more efficient solution available.
Using a tool with a powerful GUI, such as Advanced Installer, simplifies the process by offering a visual interface for creating shortcuts.
Additionally, if you already have a WiX project, Advanced Installer even allows you to import it, making the task faster and more straightforward to complete.
You can check out the following video to see how to create a desktop shortcut using Advanced Installer:
Transform your application packaging process with ease and efficiency by trying Advanced Installer’s 30-day full-featured free trial now !
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:
- [Updated] 2024 Approved Facebook's Real-Time Media Watch Guide, 2023
- [Updated] 2024 Approved Journey Around the World on YouTube, Including You
- 2024 Approved From Capture to Share Proven Methods for Live 360° Video on Youtube
- 2024 Approved Top Online Sources for 3D Glitter Text Designs
- Enhance Your Visuals with Our Cutting-Edge Fork of Stable Diffusion, Perfect for Creating Large Format Images Effortlessly
- Expanding AI Assistance: Bringing ChatGPT Features Into Diverse Applications
- Experience the Future with Taco Bell's AI-Powered Drive-Thru System
- Experience Unmatched Travel Planning with Bing's Innovative AI Concierge
- Exploring the Creality K1 Max: How This 3D Printer Is Changing the Game for Hobbyists and Professionals Alike
- Exploring the Innovative Strategy Behind DuckDuckGo's Latest AI-Powered Search Technology
- Free Access: ChatGPT Now Offers Customized GPT Models to Everyone
- How To Effectively Recharge Oculus Quest VR Controllers - A Comprehensive Tutorial
- Identifying Genuine Interactions: Distinguishing Authentic ChatGPT Communications From Fake Ones
- In 2024, Unveiling Clearer Imagery Instagram's Video Cropping Secrets
- In 2024, Ways to stop parent tracking your Vivo Y17s | Dr.fone
- In 2024, What are Location Permissions Life360 On Infinix Zero 5G 2023 Turbo? | Dr.fone
- Recover lost data from Xiaomi 13 Ultra
- Step-by-Step Guide: Adding and Viewing Subtitles on Your DVDs
- Ways to trade pokemon go from far away On Apple iPhone 15? | Dr.fone
- Title: Step-by-Step Guide to Building Windows Desktop Icons with the WiX Toolset
- Author: Donald
- Created at : 2024-10-01 16:54:57
- Updated at : 2024-10-03 16:59:09
- Link: https://some-tips.techidaily.com/step-by-step-guide-to-building-windows-desktop-icons-with-the-wix-toolset/
- License: This work is licensed under CC BY-NC-SA 4.0.