3

我有一个正常执行的应用程序。但是当我使用 Inno Setup 制作安装文件时,没有显示图标。设置脚本是:

; Script generated by the Inno Setup Script Wizard.

; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName       "MyApp"
#define MyAppVersion    "1.0"
#define MyAppExeName    "MyApp.exe"

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{C1DD3B91-BDCD-45CC-BFCA-C52DD39A6631}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
DefaultDirName=C:\Inno Setup Studio\{#MyAppName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
OutputDir=C:\Inno Setup Studio\MyApp
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "Do you want to create desktop icon?"; Flags: checkablealone

[Files]
Source: "C:\MyApp.exe"; DestDir: "{app}"; Flags: ignoreversion

Source: "Requirements\msvcp100.dll"; DestDir: "{app}"
Source: "Requirements\msvcp100d.dll"; DestDir: "{app}"
Source: "Requirements\msvcr100.dll"; DestDir: "{app}"
Source: "Requirements\msvcr100d.dll"; DestDir: "{app}"
Source: "Requirements\PocoFoundation.dll"; DestDir: "{app}"
Source: "Requirements\PocoFoundationd.dll"; DestDir: "{app}"
Source: "Requirements\QtCore4.dll"; DestDir: "{app}"
Source: "Requirements\QtCored4.dll"; DestDir: "{app}"
Source: "Requirements\QtGui4.dll"; DestDir: "{app}"
Source: "Requirements\QtGuid4.dll"; DestDir: "{app}"
Source: "Requirements\QtNetwork4.dll"; DestDir: "{app}"
Source: "Requirements\QtNetworkd4.dll"; DestDir: "{app}"
Source: "Requirements\QtService.dll"; DestDir: "{app}"


[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram, #StringChange(MyAppName, '&','&&')}}"; Flags: nowait postinstall skipifsilent 

你知道有什么问题吗?

4

3 回答 3

9

我知道这是一个旧帖子。但也许这会对某人有所帮助。

使用 inno,使用以下类似的东西,我能够将图标与桌面快捷方式(desktop.ico)、从 start 启动的应用程序(start.ico)、从 start 启动的卸载(uninst.ico)和设置相关联.exe(setup.ico)。

将您的图标路径\名称替换为例如 C:\Temp\setup.ico。用您的应用代替 MyApp。

在 [设置] 部分:

SetupIconFile=C:\Temp\setup.ico

在 [图标] 部分:

Name: "{group}\MyApp"; Filename: "{app}\MyApp.exe"; IconFilename: "C:\Temp\start.ico"

Name: "{group}\{cm:UninstallProgram,MyApp}"; Filename: "{uninstallexe}"; IconFilename: "C:\Temp\uninst.ico"

Name: "{commondesktop}\MyApp"; Filename: "{app}\MyApp.exe"; Tasks: desktopicon; IconFilename: "C:\Temp\desktop.ico"
于 2014-04-13T01:19:35.917 回答
3

查看您的脚本,我可以说缺少 [Icons] 部分。您仅添加了带有复选框的 [任务] 桌面图标。

您应该在脚本中添加如下内容:

[Icons] 
Name: "{commondesktop}\MyAppName"; Filename: "{app}\MyAppExeName.EXE";
 WorkingDir: "{app}"; Tasks: desktopicon

如果 EXE 文件不包含 Icon 或者如果您想设置自定义图标,您应该另外使用标志:IconFileName: "{app}\CustomIconFile.ico"

于 2013-05-20T14:18:59.307 回答
1

如果您专门寻找在配置面板的“添加/删除程序”部分下的列表中列出安装时使用的图标,请使用该UninstallDisplayIcon设置。

于 2016-03-24T18:26:06.853 回答