2013-05-20 206 views
3

我有一個正常執行的應用程序。但是,當我使用Inno Setup創建設置文件時,不顯示圖標。設置腳本是:沒有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 

你知道最新的錯嗎?

+3

因爲您的腳本缺少[圖標]部分。桌面快捷方式示例'[圖標] 名稱:「{commondesktop} \ MyAppName」;文件名:「{app} \ MyAppExeName.EXE」; WorkingDir:「{app}」;任務:desktopicon'(使用'; IconFileName:「{app} \ MyAppIconFile.ico」'如果需要的話) – RobeN

+0

只是澄清一下,您實際上在談論哪個圖標? – Deanna

+0

@Deanna - 從代碼你可以預測它是關於'[任務] 名稱:「desktopicon」 - sheykholeslam檢查任務頁上的複選框,但沒有圖標創建在桌面上作爲'[圖標]從腳本。 – RobeN

回答

2

尋找您的腳本我可以說有[圖標]節丟失。您只爲桌面圖標添加了[任務]複選框。

你應該添加到您的腳本是這樣的:

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

如果EXE文件不包含圖標,或者您想設置你的自定義圖標,你應該還使用標誌:IconFileName: "{app}\CustomIconFile.ico"

6

我知道這是一箇舊帖子。但也許這會幫助某人。

使用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

如果你是專門尋找使用上市時根據列表中的安裝圖標添加/刪除程序配置面板部分,使用UninstallDisplayIcon設置。