9

I am using visual studio 2010 and I have a .net desktop app (winform). I want to create a setup for project. I have added a setup wizard project to the solution. Now I want to add a shortcut to Programs menu and desktop. With right click on "User's Program menu" and selecting Add, I have only these options: Folder, File, Project output and Assembly. How can I add shortcuts? Another question: Is it possible to add .net 4.0 to setup project and install it if necessary? Thank you in advance.

Ali Behzadian Nejad
  • 8,804
  • 8
  • 56
  • 106
  • 1
    possible duplicate of [Visual Studio Deployment Project - Create shortcut to deployed executable](http://stackoverflow.com/questions/3303962/visual-studio-deployment-project-create-shortcut-to-deployed-executable) – stuartd Aug 15 '12 at 12:20
  • Your deployment project has a 'Detected Dependencies' folder, the .Net framework should be in there. – stuartd Aug 15 '12 at 12:21
  • .. and it should also be in 'Launch Conditions' (right-click on project, view, launch conditions) – stuartd Aug 15 '12 at 12:23
  • This worked greate: http://stackoverflow.com/a/4333203/1152549 – Ali Behzadian Nejad Aug 16 '12 at 18:13

4 Answers4

17

if you're looking to add shortcut to your desktop while installing your windows app you should follow these steps

  1. From Solution Explorer click your setup project.
  2. Click File System Editor (on top of Solution Explorer).
  3. When File System Editor has opened, on left tab you can see "File System on Target Machine". Click Application Folder.
  4. Then on the right tab the "Primary output from MyApp (Active)" appears. Right click it and select "Create shortcut to Primary output from MyApp (Active)". You should now see the shortcut appear below the primary output, which is your application executable.
  5. Drag & Drop that shortcut from right tab to left tabs File System on Target Machine - User's Desktop folder.
  6. Now the shortcut to your .exe will appear on the desktop after install.
  7. You can click the shortcut in File System Editor and edit the Name property from Properties grid to change the text that appears on the icon.
LightLabyrinth
  • 362
  • 3
  • 14
Adarsh Ravi
  • 893
  • 1
  • 16
  • 39
  • Hello. I followed the steps, but when trying to open the app using the desktop icon, it tries to open the .dll, not the executable. Any thoughts on what am I doing wrong? It's a WPF app with .NET Core. Thanks. – Marius Popa Apr 22 '20 at 03:51
  • Nevermind. I just found an answer. Apparently for my issue, I needed to include the application's executable in the Application Folder section, and then create the shortcuts from that. This helped https://www.technical-recipes.com/2011/how-to-create-an-installer-in-microsoft-visual-studio/ – Marius Popa Apr 22 '20 at 04:12
0

here the explanation to add a shortcut in your project: http://support.microsoft.com/kb/837220

Hassan Boutougha
  • 3,871
  • 1
  • 17
  • 17
  • 2
    Isn't that outdated since VS2008? http://thinksimpleshirin.wordpress.com/2012/02/13/creating-desktop-shortcuts-in-deployment-projects/ is better and has screenshots.. – stuartd Aug 15 '12 at 12:39
  • link only answers tend to move after time. – BlackICE Jun 21 '23 at 18:13
0

Here is a good visual This explains the entire setup and deployment in vs2010.

A short note from my answer:

(1) File -> New Project -> Other Project Types -> Setup and Deployment -> Visual Studio Installer

(2) Add a name to your setup project.

(3) Right click Application Folder -> Add -> project output

(4) ****Select your respective project's solution "primary output from yours.."****

(5) ****Add the respective 3rd party dlls.**** // Never forget this one.

(6) Right click setup project in solution explorer and BUILD it.

(7) Find the respective setup in debug folder(by default)

You will get the .exe and .msi in the folder.

Community
  • 1
  • 1
Praveen
  • 55,303
  • 33
  • 133
  • 164
  • Hi @Praveen, After completing installation of window form MSI setup, my raw files(Design and coding) are also showing at installation location. I've developed this application using visual studio 2010. Setup created successfully, but after installation that MSI this problem is happening. Please help me. Thanks in advance. – dilipkumar1007 Aug 02 '17 at 07:12
0

In order to include .net framework as part of the installation package, select your installer project from solution explorer, right click -> properties.

In the opened window, press "prerequisites" button. Another window opens and select your desired .Net Framework version and then from the radio buttons choose "Download prerequisites from the same location as my application".

AleX_
  • 508
  • 1
  • 6
  • 20