visual-studio Visual Studio 部署项目 - 创建部署的可执行文件的快捷方式
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3303962/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Visual Studio Deployment Project - Create shortcut to deployed executable
提问by Fred Strauss
I realize there is likely a simple method to do this but how does one create a desktop shortcut to the executable deployed by an MSI built using a Visual Studio Deployment project?
我意识到可能有一种简单的方法可以做到这一点,但是如何为使用 Visual Studio 部署项目构建的 MSI 部署的可执行文件创建桌面快捷方式?
I imagine I need to use the Filesystem editor but when I create shortcut on the user's desktop I can't target the executable. I can only specify the target as the application folder not the specific executable.
我想我需要使用文件系统编辑器,但是当我在用户桌面上创建快捷方式时,我无法定位可执行文件。我只能将目标指定为应用程序文件夹,而不是特定的可执行文件。
回答by roman m
After wasting an hour, I got it done - VS 2010 ... VS 2017(this articlehelped):
浪费了一个小时后,我完成了 - VS 2010 ... VS 2017(这篇文章有帮助):
- In your Deployment Project go to File System Editor
- Click on "Application Folder" (I assume you have "Primary Output" from your projects there)
- Right click on "Primary Output" of the project you want to target with your shortcut - select "Create Shortcut to Primary Output ..."
- Rename shortcut
- Drag shortcut to Desktop / Programs Menu folder
- 在您的部署项目中,转到文件系统编辑器
- 单击“应用程序文件夹”(我假设您的项目中有“主要输出”)
- 右键单击要使用快捷方式定位的项目的“主输出” - 选择“创建主输出的快捷方式...”
- 重命名快捷方式
- 将快捷方式拖到桌面/程序菜单文件夹
That's it!
而已!
回答by Jeff Roe
I would add the following steps (to roman m's answer) to get the .exe's icon into the shortcut, because it seems that by default you will get an ugly generic document-shortcut icon.
我会添加以下步骤(到 roman m 的答案)以将 .exe 的图标添加到快捷方式中,因为默认情况下您似乎会得到一个丑陋的通用文档快捷方式图标。
Assuming you have already given your program the desired icon,
假设您已经为您的程序提供了所需的图标,
- right-click on the Deployment Project
- pick menu item View > File System
- in the File System window, find the shortuct whose icon you want to change (for example, under "Users's Programs Menu")
- go to the shortcut's Properties (right-click and pick "Properties Window")
- go to Icon
- Browse...
- change "Files of type" to *.exe
- browse to and select your "primary output"
- OK, OK
- 右键单击部署项目
- 选择菜单项查看 > 文件系统
- 在“文件系统”窗口中,找到要更改其图标的快捷方式(例如,在“用户程序菜单”下)
- 转到快捷方式的属性(右键单击并选择“属性窗口”)
- 转到图标
- 浏览...
- 将“文件类型”更改为 *.exe
- 浏览并选择您的“主要输出”
- 好的好的
回答by Stefan Egli
Should be quite simple:
应该很简单:
- Open FileSystem editor and go the User's Desktopfolder.
- Right click with the mouse and select Create New Shortcut.
- You will be presented with a dialog that allows you to select for instance the application folder (on the target machine). When you double click on this you see what is inside that folder.
- Now simply select the primary project output that "contains" your exe file.
- 打开文件系统编辑器并转到用户的桌面文件夹。
- 用鼠标右键单击并选择Create New Shortcut。
- 您将看到一个对话框,允许您选择例如应用程序文件夹(在目标机器上)。当您双击它时,您会看到该文件夹中的内容。
- 现在只需选择“包含”您的 exe 文件的主要项目输出。
Likewise you can set the icon of the shortcut. At least I believe so.
同样,您可以设置快捷方式的图标。至少我是这么相信的。
回答by Alexander Liberson
I resolved this error by using a 64 x 64 icon
我使用 64 x 64 图标解决了这个错误
回答by Kemal Duran
icon file size is important, 75 KB is not showed in shortcut exe file, but 15 KB is showed.
图标文件大小很重要,快捷方式exe文件中没有显示75 KB,但显示了15 KB。

