简体   繁体   English

InnoSetup-不创建任何图标吗?

[英]InnoSetup - Does not create any icon?

I am expecting my installer to create shortcut icons on the Desktop. 我希望安装程序在桌面上创建快捷方式图标。

It has created one of the icons: 它创建了图标之一:

仅创建了一个图标,但没有快捷键

But not the other two. 但是其他两个不是。 What am I doing wrong here? 我在这里做错了什么?

#define MyAppName "Stackoverflow.Camera"
#define MyAppVersion "20"
#define MyAppPublisher "Stackoverflow"
#define MyAppURL "https://www.stackoverflow.com/"
#define MyAppExeName "cam.exe"
#define SerialNumber "1234"

[Setup]
AppId={{C4CB10EA-7599-4A1C-BE0C-5A560FD9EE23}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DisableDirPage=yes
DefaultGroupName={#MyAppName}
DisableProgramGroupPage=yes
OutputDir=C:\Users\tpt\Desktop
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes
;SignTool=signtool
PrivilegesRequired=admin
UserInfoPage=yes

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


[Files]
Source: "C:\test\cam\Samples\cam\bin\Release\*"; DestDir: "{app}\"; Flags: ignoreversion; Permissions: users-full

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
Name: "{userdesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; HotKey:"ctrl+alt+c";Tasks: desktopicon

[Run]
Filename: "{app}\{#MyAppExeName}"; 


[Code]

function CheckSerial(Serial: String): Boolean;
begin
  Result := Serial = '{#SerialNumber}';
end;

Compile Log 编译日志

*** Starting compile.  [9:57:55 PM]

[ISPP] Preprocessing.
[ISPP] Preprocessed.

Parsing [Setup] section, line 10
Parsing [Setup] section, line 11
Parsing [Setup] section, line 12
Parsing [Setup] section, line 14
Parsing [Setup] section, line 15
Parsing [Setup] section, line 16
Parsing [Setup] section, line 17
Parsing [Setup] section, line 18
Parsing [Setup] section, line 19
Parsing [Setup] section, line 20
Parsing [Setup] section, line 21
Parsing [Setup] section, line 22
Parsing [Setup] section, line 23
Parsing [Setup] section, line 24
Parsing [Setup] section, line 25
Parsing [Setup] section, line 27
Parsing [Setup] section, line 28
Reading file (WizardImageFile)
   File: C:\Program Files (x86)\Inno Setup 5\WIZMODERNIMAGE.BMP
Reading file (WizardSmallImageFile)
   File: C:\Program Files (x86)\Inno Setup 5\WIZMODERNSMALLIMAGE.BMP
Preparing Setup program executable
Reading default messages from Default.isl
Parsing [Languages] section, line 31
   File: C:\Program Files (x86)\Inno Setup 5\Default.isl
Parsing [LangOptions], [Messages], and [CustomMessages] sections
   Messages in script file
Reading [Code] section
Parsing [Tasks] section, line 38
Parsing [Icons] section, line 41
Parsing [Icons] section, line 42
Parsing [Icons] section, line 43
Parsing [Run] section, line 46
Parsing [Files] section, line 35
Compiling [Code] section
Deleting setup.exe from output directory
Creating setup files
   Compressing: C:\test\cam\Samples\cam\bin\Release\cam.exe
   Compressing Setup program executable
   Updating version info

Warning: Setting the [Setup] section "OutputBaseFileName" to "setup" is not recommended, all executables named "setup.exe" are shimmed by Windows application compatibility to load additional DLLs, such as version.dll. These DLLs are loaded unsafely by Windows and can be hijacked. Use a different name, for example "mysetup".
*** Finished.  [9:57:56 PM, 00:00.797 elapsed]

Run Log 运行日志

[21:50:15.323]   *** Setup started
[21:50:17.630]   Setup version: Inno Setup version 5.5.9 (a)
[21:50:17.633]   Original Setup EXE: C:\Users\tpt\Desktop\setup.exe
[21:50:17.636]   Setup command line: /SL5="$12059C,84663,57856,C:\Users\tpt\Desktop\setup.exe" /SPAWNWND=$11066E /NOTIFYWND=$200720 /DEBUGWND=$706F2 
[21:50:17.638]   Windows version: 10.0.16299  (NT platform: Yes)
[21:50:17.640]   64-bit Windows: Yes
[21:50:17.642]   Processor architecture: x64
[21:50:17.644]   User privileges: Administrative
[21:50:17.648]   64-bit install mode: No
[21:50:17.656]   Created temporary directory: C:\Users\tpt\AppData\Local\Temp\is-DI6BO.tmp
[21:50:20.137]   Starting the installation process.
[21:50:20.146]   Directory for uninstall files: C:\Program Files (x86)\Stackoverflow.Camera
[21:50:20.150]   Will append to existing uninstall log: C:\Program Files (x86)\Stackoverflow.Camera\unins000.dat
[21:50:20.158]   -- File entry --
[21:50:20.163]   Dest filename: C:\Program Files (x86)\Stackoverflow.Camera\unins000.exe
[21:50:20.171]   Time stamp of our file: 2018-03-15 21:50:17.512
[21:50:20.176]   Dest file exists.
[21:50:20.184]   Time stamp of existing file: 2018-03-15 21:49:54.524
[21:50:20.190]   Version of our file: 51.52.0.0
[21:50:20.196]   Version of existing file: 51.52.0.0
[21:50:20.201]   Installing the file.
[21:50:20.230]   Uninstaller requires administrator: Yes
[21:50:20.236]   Leaving temporary file in place for now.
[21:50:20.247]   -- File entry --
[21:50:20.253]   Dest filename: C:\Program Files (x86)\Stackoverflow.Camera\cam.exe
[21:50:20.259]   Time stamp of our file: 2018-02-26 12:29:56.000
[21:50:20.264]   Installing the file.
[21:50:20.288]   Successfully installed the file.
[21:50:20.294]   Setting permissions on file: C:\Program Files (x86)\Stackoverflow.Camera\cam.exe
[21:50:20.308]   -- Icon entry --
[21:50:20.313]   Dest filename: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Stackoverflow.Camera\Stackoverflow.Camera.lnk
[21:50:20.321]   Creating the icon.
[21:50:20.382]   Successfully created the icon.
[21:50:20.441]   Installation process succeeded.
[21:50:20.461]   -- Run entry --
[21:50:20.467]   Run as: Current user
[21:50:20.472]   Type: Exec
[21:50:20.478]   Filename: C:\Program Files (x86)\Stackoverflow.Camera\cam.exe
[21:50:28.061]   Process exit code: 255
[21:50:28.077]   Need to restart Windows? No
[21:50:29.247]   Deinitializing Setup.
[21:50:29.368]   *** Setup exit code: 0

As you can see in your log, only one icon was created: 如您在日志中看到的,仅创建了一个图标:

[21:50:20.308]   -- Icon entry --
[21:50:20.313]   Dest filename: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Stackoverflow.Camera\Stackoverflow.Camera.lnk
[21:50:20.321]   Creating the icon.
[21:50:20.382]   Successfully created the icon.
[21:50:20.441]   Installation process succeeded.

The {group} constant relates to the Start Menu . {group}常量与“ 开始”菜单有关 In your comments you asked: 在您的评论中,您询问:

It looks like my code created a shortcut icon but without hotkey on it 看起来我的代码创建了快捷方式图标,但上面没有热键

That is correct. 那是对的。 The icon in question is: 有问题的图标是:

Name: "{group}\Stackoverflow.Camera"; Filename: "{app}\cam.exe"

It has no hot key. 它没有热键。 The other two are associated with a task . 另外两个任务相关。 Specifically desktopicon . 特别是desktopicon The help for tasks states: 任务帮助说明:

This section is optional. 本部分是可选的。 It defines all of the user-customizable tasks Setup will perform during installation. 它定义了安装程序将在安装过程中执行的所有用户可自定义任务。 These tasks appear as check boxes and radio buttons on the Select Additional Tasks wizard page . 这些任务在“选择其他任务”向导页上显示为复选框和单选按钮

By itself a task does nothing: it needs to be 'linked' to other installation entries. 一项任务本身不执行任何操作:它需要“链接”到其他安装条目。

You have linked it. 您已将其链接 So I am assuming that you are not ticking the task on the window during installation and that this is why those two icons are not created. 因此,我假设您在安装过程中未在窗口上打勾 ,这就是为什么未创建这两个图标的原因。 Example: 例:

任务窗口


As a side comment, did you see the warning about the name of your installer? 作为附带说明,您是否看到有关安装程序名称的警告?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM