Search code examples
c#visual-studioinstallationvisual-studio-2022publish

How to make your app create a shortcut in the startup folder on install Visual Studio 2022


I am struggling to find guides or explanations online on how to make a shortcut for my app to appear in the startup folder upon the installation of the app.

I am using Visual Studio 2022 and the app is written in C#.


Solution

  • Visual Studio Installer Projects Extension and .NET comes with this function, when you After following a normal procedure to create a Setup Project, you can put the program's shortcut into the startup folder through the following methods:

    1. Right-click File System on Target Machine => Add Special Folder => User’s Startup Folder

      enter image description here

    2. Right-click your primary output in the Application Folder, click Create Shortcut to Primary..., create a shortcut to the primary output and pull the shortcut into User’s Startup Folder

      enter image description here

    3. After building the project, open the installer installer and remember to click Install this program for everyone

      enter image description here

    4. After the installation is complete, open the Startup folder and you will find the shortcut to the program inside.

      enter image description here

    If you already know how to create setup projects, this will go smoothly. If you have any questions, please let me know.