Custom desktop icon with inno setup

天大地大妈咪最大 提交于 2019-12-10 12:56:52

问题


I have the following in my inno setup file which creates a desktop icon no problem:

Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"

However, the main file that launches the program is a VBS file rather than an EXE. I'd like to have a nice icon on the shortcut rather than the VBScript one, but can't find an option to change the icon.

Is there such an option available to set a custom icon??


回答1:


The Inno-Setup help about the [Icons] section says:

IconFilename

The filename of a custom icon (located on the user's system) to be displayed. This can be an executable image (.exe, .dll) containing icons or a .ico file. If this parameter is not specified or is blank, Windows will use the file's default icon. This parameter can include constants.

Example: IconFilename: "{app}\myicon.ico"

(source)

Hope that helps.




回答2:


You pasted the [Task] entry whereas the [Icons] entry is what creates the actual icon. For that, you want to install a custom icon file, and set the IconFilename (and optionally IconIndex) parameter.




回答3:


Before you use Inno setup, change the .exe icon with windows platform. After you change it then use Inno, and your .exe file becomes the icon that you have changed before using Inno.

In other words: Inno setup uses default icon to launch as a .exe icon, so you can change the icon before use Inno. It works for me.



来源:https://stackoverflow.com/questions/7485355/custom-desktop-icon-with-inno-setup

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!