Developer Manual For Creating Installers For .NET Projects

To read the full guide with pictures, click here: Developer Manual For Creating Installers For .NET Projects

NOTE: This manual assumes that you already have a project in a solution ready.

1. Open your solution.

2. Open the “Extensions” menu from the top area of the window to display a dropdown menu of options, then click “Manage Extensions”.

3. On the “Manage Extensions” window, click “Online” on the left side.

4. In the search bar on the upper-left part of the “Manage Extensions” window, type in “visual studio installer projects”, then from the search results in the center of the window, click “Microsoft Visual Studio Installer Projects 2022”.

5. Click the “Download” button that appears next to the extension you just clicked.

6. Once the progress bar finishes, close “Microsoft Visual Studio”.

7. A window titled “VSIX Installer” will appear after a few seconds. Click the “Modify” button at the bottom of the window.

8. Wait for the extension installation to finish, then click “Close”.

9. Start “Microsoft Visual Studio” again and open your solution.

10. Navigate to the “Solution Explorer” at the right side of the window. NOTE: If the “Solution Explorer” is not visible at the right side of your window, open the “View” menu from the upper-left area of the window to display a dropdown menu of options, then click “Solution Explorer”.

11. Right-click your solution, which is named “Solution ‘ProjectName'”.

12. Hover over “Add”, then in the submenu that appears, click “New Project”.

13. In the “Add a new project” window, in the search bar, type in “setup”, then click “Setup Project” from the results and click “Next” at the bottom-right of the window.

14. Type in your installer’s name and set the location of the installer project’s folder, then click “Create” at the bottom-right of the window. NOTE: You do not need to change the installer project’s folder location, as it is set to the current project’s folder by default.

15. Navigate to the “Solution Explorer”, right-click your solution, then click “Build”.

16. Once the build is finished, navigate to the file system section of your installer. NOTE: This should show up on the main screen the moment you create your installer project. If not, you may right-click your installer project, hover over “View”, then click “File System” on the submenu that appears.

17. Click “Application Folder” on the left side of the file system section.

18. On the now empty area on the right side of the file system section, right-click anywhere, then hover over “Add” and click “Project Output” from the submenu that appears.

19. On the “Add Project Output Group” window that appears, choose the project you would like to add to your installer from the “Project” dropdown list.

20. From the list below, if your project runs on .NET Core 3.1, .NET 5.0, or .NET 6.0, click “Publish Items”, otherwise click “Primary output”, then click “OK” at the bottom of the window.

21. Right-click “Publish Items from ‘ProjectName’ (Active)” or “Primary output from ‘ProjectName’ (Active)”, then click “Create Shortcut to Publish Items from ‘ProjectName’ (Active)” or “Create Shortcut to Primary output from ‘ProjectName’ (Active)”.

22. When the shortcut appears next to “Publish Items from ‘ProjectName’ (Active)” or “Primary output from ‘ProjectName’ (Active)”, rename it to “‘ProjectName'”.

23. Drag the shortcut to “User’s Desktop” on the left side of the file system section. Repeat steps 21 to 23 for “User’s Programs Menu”.

24. Navigate to the “Solution Explorer”. Right-click your installer project, then click “Build”.

25. Open “Windows Explorer”.

26. Navigate to the installer project’s binary files. NOTE: By default, the path to your installer project’s binary files should be “C:\Users\[CurrentUser]\source\repos\[SolutionFolder]\[InstallerProjectFolder]”.

27. Depending on the build configuration you used when you clicked “Build”, the .MSI installer should be located in either the “Debug” or the “Release” folder. Open the appropriate folder.

28. You now have a .MSI installer for your project.