1. 程式人生 > >InnoSetup 設定快捷方式、選單目錄的名稱顯示

InnoSetup 設定快捷方式、選單目錄的名稱顯示

1. 先定義一箇中文名稱變數

#define MyAppChineseName "磁碟清理工具"

2.設定預設快捷試的目錄名稱與安裝包輸出名稱

[Setup]

//設定預設資料夾的名稱,預設資料夾名稱與開始選單資料夾名稱、安裝目錄名稱對應。

DefaultGroupName={#MyAppChineseName}

//設定輸出路徑和安裝包名稱

OutputDir=C:\Users\10167\Desktop
OutputBaseFilename={#MyAppChineseName}

3. 設定快捷方式名稱

[Icons]

//設定開始選單中快捷方式名稱

Name: "{group}\{#MyAppChineseName

}"; Filename: "{app}\{#MyAppName}"
Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppChineseName}}"; Filename: "{#MyAppURL}"
Name: "{group}\{cm:UninstallProgram,{#MyAppChineseName}}"; Filename: "{uninstallexe}"

//設定桌面快捷方式名稱
Name: "{commondesktop}\{#MyAppChineseName}"; Filename: "{app}\{#MyAppName}"; Tasks: desktopicon

詳細設定:

 1 ; Script generated by the Inno Setup Script Wizard.
 2 ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
 3 
 4 #define MyAppName "CleanCacheTool"
 5 #define MyAppChineseName "磁碟清理工具"
 6 #define MyAppVersion "1.0"
 7 #define MyAppPublisher "Seewo"
 8
#define MyAppURL "http://www.seewo.com/" 9 #define MyAppExeName "CleanCacheTool.exe" 10 11 [Setup] 12 ; NOTE: The value of AppId uniquely identifies this application. 13 ; Do not use the same AppId value in installers for other applications. 14 ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) 15 AppId={{9C358EFE-5602-4EDC-9A40-0FA85EEDD604} 16 AppName={#MyAppName} 17 AppVersion={#MyAppVersion} 18 ;AppVerName={#MyAppName} {#MyAppVersion} 19 AppPublisher={#MyAppPublisher} 20 AppPublisherURL={#MyAppURL} 21 AppSupportURL={#MyAppURL} 22 AppUpdatesURL={#MyAppURL} 23 DefaultDirName={pf}\{#MyAppName} 24 DefaultGroupName={#MyAppChineseName} 25 OutputDir=C:\Users\10167\Desktop 26 OutputBaseFilename={#MyAppChineseName} 27 SetupIconFile=F:\Gitlab\CleanCacheTool\CleanCacheTool\bitbug_favicon.ico 28 Compression=lzma 29 SolidCompression=yes 30 31 [Languages] 32 Name: "english"; MessagesFile: "compiler:Default.isl" 33 34 [Tasks] 35 Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked 36 37 [Files] 38 Source: "F:\Gitlab\CleanCacheTool\CleanCacheTool\bin\Debug\CleanCacheTool.exe"; DestDir: "{app}"; Flags: ignoreversion 39 Source: "F:\Gitlab\CleanCacheTool\CleanCacheTool\bin\Debug\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs 40 ; NOTE: Don't use "Flags: ignoreversion" on any shared system files 41 42 [Icons] 43 Name: "{group}\{#MyAppChineseName}"; Filename: "{app}\{#MyAppName}" 44 Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppChineseName}}"; Filename: "{#MyAppURL}" 45 Name: "{group}\{cm:UninstallProgram,{#MyAppChineseName}}"; Filename: "{uninstallexe}" 46 Name: "{commondesktop}\{#MyAppChineseName}"; Filename: "{app}\{#MyAppName}"; Tasks: desktopicon 47 48 [Run] 49 ;Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
View Code

 

以下是截圖:

安裝目錄

開始選單顯示

桌面快捷方式: