You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Inno Setup中设置自定义桌面图标?需修改哪些内容?

修改Inno Setup脚本设置自定义桌面图标

以下是你需要修改的几个关键部分:

1. 补全缺失的应用名称宏

你的脚本中使用了{#MyAppName}但未定义这个宏,编译会报错,需要在开头的宏定义区添加:

#define MyAppName "GIA"

完整的宏定义段变为:

#define MyAppVersion "1.0"
#define MyAppName "GIA"
#define MyAppPublisher "ABC"
#define MyAppURL ""
#define MyAppExeName "run.bat"
#define MyAppIcoName "gia.ico"

2. 为图标指定自定义ICO文件

找到[Icons]段,给每个图标条目添加IconFilename参数,指向你的gia.ico文件:

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}\{#MyAppIcoName}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}\{#MyAppIcoName}"; Tasks: desktopicon

必要前提

确保gia.ico文件和你的安装脚本(setup.iss)在同一目录下,或者在[Files]段的源文件范围内——你的[Files]段用了Source: "*",只要ICO文件在脚本所在目录,就会被自动复制到安装目录{app}中。

内容的提问来源于stack exchange,提问作者Cole Baril

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.02 04:15:20