How to Create a Desktop Shortcut for a Windows Forms Application?

create desktop shortcut for windows form application

Written by Renato Ivanescu · February 14, 2024

Creating a seamless user experience for an app often involves using shortcuts.

Desktop shortcuts provide a direct method of accessing any application. Now, the main question is: how can we? create a desktop shortcut for an application deployed via an MSI package?

This article has you covered. It will guide you through the process of creating a desktop shortcut for a Windows Forms application installed via an MSI package. We will use Visual Studio and Free Visual Studio Advanced Installer extension to build the installer.

noteBefore moving on to the next steps, make sure you have the Advanced Installer add-in for Visual Studio installed. If not, you can find it in the Visual Studio Marketplace.

1. Create the application

Let’s start by creating an example Windows Forms application in Visual Studio:

  • go to File → New → Project.
  • Select Windows Forms application from the list of templates.
  • Name your project and click Create.

2. Add the configuration project

Next, add the Configuration Project needed to create the MSI package:

  • Right click on Project Solution → Add → New Project.
  • unravel Advanced installer project template from the list of templates.
  • Enter a name for the project and create it.
Advanced Installer Project Template

Advanced Installer Project Template

After creating the setup project, open the Advanced Installer Project (.aip) file to access and edit your installer details.

Advanced installer project viewer

Advanced installer project viewer

3. Add Project Product

Before we dive into creating the desktop shortcut, it’s essential to include the build output of your solution in the installer project:

  • go to Files and Folders tab in the viewer and click on Add Project Product the button.
  • In the opened dialog you need to select a publication profile and click OK the button.

note
If you do not yet have a published profile, you will be prompted to create one.
Choose to publish to a local folder. After configuring this profile, there is no need to publish anything manually – the configuration project will handle it automatically when you build it.
Then, go back to Files and Folders tab, click on Add Project Product again and select the publishing profile you just created.

4. Create the desktop shortcut for the Windows Forms application

To create the desktop shortcut, follow these steps in the Advanced Installer:

  • Open your project in the Advanced Installer by clicking Switch to advanced installer button in the lower left corner of the project viewer.
  • Navigate to Files and Folders page and find Application folder.
The application folder in the advanced installer

The application folder in the advanced installer

  • Right click on the application executable file and select New shortcut for installed file.
  • IN New file shortcut dialog, select Desktop folder HOW Shortcuts folderthen press OK the button.
File Shortcuts Features in Advanced Installer

File Shortcuts Features in Advanced Installer

After saving your project in the advanced installer, return to Visual Studio. You will be prompted to refresh the installer project since it has been modified. CLICK [Yes] the button.

5. Build and install the application

It’s time to build the configuration project to generate the MSI. Then, run it to install the app. Once the installation is complete, you will find the application shortcut on your desktop.

Tutorial video

Written by
Check out the author's page
Renato Ivanescu

Renato is a technical writer for Advanced Installer and an assistant professor at the University of Craiova. He is currently a Ph.D. student, and computers and information technology are his areas of interest. He loves innovation and takes on big challenges.

Để lại một bình luận

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *

Contact Me on Zalo
Tư Vấn Miễn Phí