Inno安装程序不会生成桌面图标

时间:2018-01-06 09:02:25

标签: python-3.x inno-setup

我使用Inno设置为我的EXE包生成安装程序。我的主EXE文件由批处理文件驱动。当我按照下面给出的脚本安装程序创建快捷方式。但是我在Inno脚本中给出的图标没有显示为图标,而是出现默认批处理图标。该应用程序工作得非常好。提前致谢。 我的Inno脚本文件:

由Inno安装脚本向导生成的脚本。 ;有关创建创新设置脚本文件的详细信息,请参阅文档!

#define MyAppName "cookie_crumbs_tableau"
#define MyAppVersion "2.0"
#define MyAppExeName "cookie_crumbs_tableau.bat"    
[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={{EF731CE0-43E4-4C87-B33C-8F16C2529E77}
    AppName={#MyAppName}
    AppVersion={#MyAppVersion}
    ;AppVerName={#MyAppName} {#MyAppVersion}
    AppPublisher={#MyAppPublisher}
    AppPublisherURL={#MyAppURL}
    AppSupportURL={#MyAppURL}
    AppUpdatesURL={#MyAppURL}
    DefaultDirName=C:\{#MyAppName}
    DisableDirPage=yes
    DisableProgramGroupPage=yes
    OutputDir=C:\Users\Cookie1\Desktop\EXEFINAL
    OutputBaseFilename=cookie_crumbs_tableau_setup
    ;SetupIconFile=C:\Dev\EXE\prod\crumbs_tableau\dist\cookie_crumbs_tableau\crumbs.ico
    SetupIconFile=C:\Users\Cookie5\Documents\Crumbs.ico
    Compression=lzma
    SolidCompression=yes

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

    [Tasks]
    Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
    Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1


    [Files]
    Source: "C:\Dev\EXE\prod\crumbs_tableau\dist\cookie_crumbs_tableau\cookie_crumbs_tableau.bat"; DestDir: "{app}"; Flags: ignoreversion
    Source: "C:\Dev\EXE\prod\crumbs_tableau\dist\cookie_crumbs_tableau\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
    ;Source: "C:\Dev\EXE\prod\crumbs_tableau\dist\cookie_crumbs_tableau\cookie_crumbs_tableau.bat"; DestDir: "{app}"; Flags: ignoreversion
    ; NOTE: Don't use "Flags: ignoreversion" on any shared system files

    [Icons]
    Name: "{commonprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
    Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
    Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon

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

1 个答案:

答案 0 :(得分:0)

你正在使用蝙蝠图标,因为给了Innosetup" cookie_crumbs_tableau.bat"没有使用IconFilename因此它默认为bat图标。如果您想要自定义图标,请使用IconFilename在[Icons]部分设置图标。

[Icons]
Name: "{commonprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}\program.exe" 
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon; IconFilename: "{app}\program.exe"
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon; IconFilename: "{app}\program.exe"