简体   繁体   中英

Adding shortcut to setup project in visual studio 2010

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.

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.

这里是在项目中添加快捷方式的说明: http//support.microsoft.com/kb/837220

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.

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".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM