我有一个正常执行的应用程序。但是当我使用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
你知道什么是错的吗?
答案 0 :(得分:7)
我知道这是一个老帖子。但也许这会对某人有所帮助。
使用inno,使用类似下面的内容,我能够将图标与桌面快捷方式(desktop.ico)相关联,从start(start.ico)启动的应用程序,从start(uninst.ico)启动的卸载,和setup.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"
答案 1 :(得分:2)
查看您的脚本我可以说缺少[Icons]部分。您已为[桌面图标]添加了[任务]复选框。
您应该在脚本中添加以下内容:
[Icons]
Name: "{commondesktop}\MyAppName"; Filename: "{app}\MyAppExeName.EXE";
WorkingDir: "{app}"; Tasks: desktopicon
如果EXE文件不包含Icon,或者如果要设置自定义图标,则还应使用标记:IconFileName: "{app}\CustomIconFile.ico"
答案 2 :(得分:1)
如果您在配置面板的添加/删除程序部分下的列表中专门查找列出安装时使用的图标,请使用UninstallDisplayIcon
设置。