代码之家  ›  专栏  ›  技术社区  ›  frank hk

Inno安装程序未生成桌面图标

  •  2
  • frank hk  · 技术社区  · 7 年前

    我正在使用Inno安装程序为我的EXE包生成安装程序。我的主EXE文件由批处理文件驱动。当我遵循下面给定的脚本时,安装程序正在创建快捷方式。但是我在Inno脚本中给出的图标没有显示为图标,而是显示默认的批处理图标。应用程序运行得很好。提前谢谢。 我的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 回复  |  直到 7 年前
        1
  •  0
  •   michael_heath    7 年前

    您使用的是bat图标,因为Innosetup被赋予了“cookie\u crumps\u 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"