简体   繁体   English

Windows安装项目问题(C#,Winforms)

[英]Problem with windows setup project (c#, winforms)

I've created a windows application in c# now i added a new setup project to this application and i build it. 我已经在C#中创建了一个Windows应用程序,现在我向该应用程序添加了一个新的安装项目并进行了构建。 It is executing successfully. 它执行成功。 When i try to add project output to user desktop. 当我尝试将项目输出添加到用户桌面时。 There are two files adding in the desktop one is exe file and another one is xml file (configuration file). 在桌面上添加了两个文件,一个是exe文件,另一个是xml文件(配置文件)。 Why it is happening. 为什么会这样。 How can i add only exe file to my desktop while running the setup file. 运行安装文件时,如何将exe文件仅添加到桌面。

Thank you, Nagu 谢谢你那古

You have to add a shortcut to project output, not the project output itself. 您必须为项目输出添加快捷方式,而不是项目输出本身。 You can do this by selecting the "User's desktop" folder, right click and select "Create new shortcut" and in the select item dialog go to "Application folder" and select "Primary output from your project". 您可以通过选择“用户的桌面”文件夹,右键单击并选择“创建新的快捷方式”,然后在选择项对话框中转到“应用程序文件夹”,然后选择“项目的主要输出”来执行此操作。

Is there a reason you're are trying to put the exe on the desktop? 您正试图将exe放在桌面上吗? Standard practice is to place it in a folder in Program Files (or somewhere the user designates) and place a shortcut on the desktop. 标准做法是将其放在“程序文件”中的文件夹中(或用户指定的位置),然后在桌面上放置快捷方式。

Assuming that you already have the exe file added to your setup: 假设您已经将exe文件添加到设置中:

  1. Right click your setup project, click view->file system; 右键单击您的安装项目,单击查看->文件系统;
  2. Right Click on User's Desktop->Create Shortcut to user's desktop 右键单击“用户桌面”->“创建用户桌面的快捷方式”

I think that would be it. 我想就是这样。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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