简体   繁体   English

Inno Setup-不显示桌面上的图标

[英]Inno Setup - the icon on a desktop is not presented

I had been project in Inno Setup. 我曾经在Inno Setup中进行过项目。 All is installed perfectly, but the icon on a desktop is not presented - white color of icon. 所有设备均已完美安装,但未显示桌面上的图标-白色的图标。

#define MyAppName "My Program"
#define MyAppVersion "3.2.0"
#define MyAppVersionName "My Program 3 (64-bit)"
#define MyAppExeName "myprogram.exe"

..................

[Setup]
SetupIconFile=C:\Users\path_to_my_program\myprogram_Icon.ico

................

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#MyAppVersionName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

If I had been write section [Icons]: 如果我曾经写过[Icons]部分:

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

then I get icon on desktop perfectly after installed. 然后安装后我会在桌面上得到完美的图标。

How can I solve it problem? 我该如何解决呢?

Thank you very much. 非常感谢你。

If the EXE does not have a default application icon, then you should copy/install the Icon File along with the EXE and use the IconFileName parameter from [Icons] section to specify the path to it: 如果EXE没有默认的应用程序图标,则应与EXE一起复制/安装Icon File ,并使用[Icons]部分中的IconFileName参数指定其路径:

[Files]
Source: "C:\Users\path_to_my_program\myprogram_Icon.ico"; DestDir: "{app}" 

[Icons]
Name: "{commondesktop}\{#MyAppVersionName}"; Filename: "{app}\{#MyAppExeName}"; 
  IconFileName: "{app}\myprogram_Icon.ico"; Tasks: desktopicon

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

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