Original text
Rate this translation
Your feedback will be used to help improve Google Translate

Cookie Consent

By clicking “Accept Cookies”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage and assist in our marketing efforts. More info

General Published on: Fri Feb 10 2023

Setup Project using Microsoft Visual Studio Installer Projects Extension

This blog will guide you through a step-by-step tutorial on how we can set up the project using Microsoft Visual Studio Installer Projects Extension.

Step 1: Install the Microsoft Visual Studio Installer Projects Extension.

 

– go to Extensions->Manage Extensions in the visual studio toolbar.


 


– download Microsoft Visual Studio Installer Projects from the online tab menu.



– close all the windows of the visual studio after downloading the extension, then the extension will be installed, and modification will begin.

-Open the visual studio after installation of the extension.

Step 2: Create the Setup Project


-open visual studio and open the project you want to create a setup of. Right-click on the solution and go to Add -> new project, and select Setup Project. 



-After creating the setup project Right-click on the setup project, go to Add->ProjectOutput.



-Primary Output of the selected project and all required dependencies would be added in the setup project. Now right, click on the primary output and click on Find an Editor.



-Primary Output of the selected project and all required dependencies would be added in the setup project. Now right click on the primary output and click on Find in Editor



-you will get the following screen.



Now go to the User’s Desktop folder to add a shortcut to the desktop after installation. Then Right-click on the window and click on Create New Shortcut.

Then Select the Application Folder in the popup window below.


Then select Primary Output of the project and click ok.


 – Using the same steps, you can also create a shortcut in the User’s Program Menu and Application Folder. The shortcut of the project would be added; you can rename the shortcut’s name. Here I named it as ProjectShortcut.

 

– you can also change the icon of the shortcut in ProjectShortcut properties


you can also do the modifications such as:

 

 -Adding Files or Assembly to Your Setup Project

 

 -Creating the Key Hierarchy

 

 -Defining Launching Conditions

 

 -Define custom actions

 

 -Modify User Interface

 

 -Adding file type

 

-Merge Module

 

 for this, right-click on the setup project and select View. You will get the following options 


Registry:- Here you can create the key hierarchy. Click on the registry:- 

-The registry for the project opens. Next, you must create a key 

hierarchy as detailed in the following steps. 

1. Under Registry on Target Machine, right-click on any folders and select New Key. The new key appears in editable mode. 

2. Enter the name for the new key. 

3. Repeat the above step to build the key hierarchy as per your requirement.

FileType:- Here, you can add file type, 

 -Right-click the File Types on the Target Machine node to add a new file type 

 -In the Properties window, you may specify the properties of the file type: 

Enter the extension, a description, and the command to open a file of this type 

User Interface:- Here, you can modify the user interface of the setup that will be visible to the user while installing the project.  

Launch Conditions: Here, you can define the application’s conditions. E.g., Create launching conditions to check if Outlook and Microsoft .NET Framework applications are present before starting the installation. 

Custom Actions:- Custom actions are for adding code that is needed to be executed during installation. You can add custom actions for install, commit, rollback, and uninstall to execute that action while performing any of these actions. 

For adding files, Assembly, or merging modules, right-click on the project and then go to Add. 

 

Select File to add any file 

-Select Assembly to add Assembly .

-Select merge module to merge any module in the setup. 

Step 3: Build the Project


-Change the configuration of the project you are creating setup to release and build the Setup project.

-check the release folder of the setup project to get the final setup(.msi File)

-You can install the .msi File and run the project.


final setup file is shown below.