c# - 如何为使用 visual studio Installer 创建的安装项目的桌面快捷方式设置图标?

标签 c# visual-studio installation visual-studio-setup-proje

我已经从 Visual Studio Installer 创建了一个 Setup Project
我安装了 MSI 并且能够安装该应用程序。我想为我在桌面上创建的快捷方式添加一个图标。为此,我尝试了以下步骤:

  • 1) Selected the desktop shortcut from the FileSystem view.
  • 2) Press F4 for properties.
  • 3) For the Icon Field selected Browse option.
  • 4) Clicked on Browse button.
  • 5) Set File of type to Executable(.exe)
  • 6) Press OK and OK again.
  • 7) Then build my C# application and then the Setup Project.
  • 8) Then ran the MSI from the debug location.
  • 9) Then a shortcut created and as well as .exe file got installed on the desktop.
  • 10) ICON size is 16*16.

The .exe file shows the ICON , where as the desktop shortcut for the same executable is not showing ICON and it showing as below.
enter image description here

我不明白为什么它不显示图标。

有人可以帮我解决这个问题吗?

最佳答案

终于解决了。解决方案是将图标大小从 16*16 更改为 48*48 像素。我已将我的应用程序图标大小设置为 48*48 像素,并且在设置项目中为桌面快捷方式设置图标时选择了相同的大小。 即使是大小为 24*24 的 ICON 也能正常工作。希望这有助于寻找类似问题的人。

关于c# - 如何为使用 visual studio Installer 创建的安装项目的桌面快捷方式设置图标?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48079144/

相关文章:

visual-studio - 如何仅在外部硬盘驱动器上安装 Visual Studio Express 2013(根本不在 C 上)?

c# - 使用反射调用 DLL,但所需的另一个 DLL 抛出异常

c# - GRPC 的 SSL 认证

windows - 如何在 NSIS 安装程序的完成页面上添加桌面快捷方式选项?

c++ - 具有三元运算符的函数类型

visual-studio - 在 Visual Studio 2017 或 2019 中最大化当前拆分选项卡组

android - 如何在 Android 设备上安装受信任的 CA 证书?

c# - 比较 LINQ to SQL 中的两个日期

c# - 有没有更好的方法在不使用 Add 方法的情况下在 .NET 中初始化哈希表?

visual-studio - 如何在 Visual Studio Team Services 中添加完成任务或故事的实际时间?