InnoSetup - 不创建任何图标?

时间:2018-03-15 17:08:55

标签: windows windows-10 inno-setup

我希望我的安装程序能够在桌面上创建快捷方式图标。

它创建了一个图标:

only one icon created but without shortcut keys

但不是其他两个。我在这里做错了什么?

#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;

编译日志

*** 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]

运行日志

[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

1 个答案:

答案 0 :(得分:2)

正如您在日志中看到的,只创建了一个图标:

[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.

{group}常量与开始菜单相关。在你的评论中你问:

  

看起来我的代码创建了一个快捷方式图标,但没有热键

这是正确的。有问题的图标是:

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

它没有热键。 其他两个任务相关联。具体来说是desktopicontasks州的帮助:

  

此部分是可选的。它定义了安装期间安装程序将执行的所有用户可自定义任务。 这些任务在“选择其他任务”向导页面上显示为复选框和单选按钮

     

任务本身没有任何作用:它需要被联系起来'到其他安装条目。

您已关联它。所以我假设您在安装过程中没有勾选窗口上的任务,这就是为什么不创建这两个图标的原因。例如:

Tasks Window

作为旁注,您是否看到了有关安装人员姓名的警告?