;如下腳本主要完成建立開始菜單和桌面的快捷方式,目錄安裝。 #define MyAppName "個人軟件名" #define MyAppVersion "1.0" #define MyAppPublisher "軟件做者" #define MyAppURL "做者網址" #define MyAppExeName "MYEXE.exe" ;主程序 #define MyAppUninstallExeName "MYEXE.exe" ;卸載程序 #define InStallDir "Mydir" ;安裝目錄,最後是英文 [Setup] ; 注: AppId的值爲單獨標識該應用程序。 ; 不要爲其餘安裝程序使用相同的AppId值。 ; (生成新的GUID,點擊 工具|在IDE中生成GUID。) AppId={{FD6089FC-0774-4DBD-A1A6-8D23F728E9ED} AppName={#MyAppName} ;常量對應 #define MyAppName "個人軟件名" AppVersion={#MyAppVersion} ;AppVerName={#MyAppName} {#MyAppVersion} AppPublisher={#MyAppPublisher} AppPublisherURL={#MyAppURL} AppSupportURL={#MyAppURL} AppUpdatesURL={#MyAppURL} DefaultDirName={pf}\{#InStallDir} ;默認安裝目錄 DefaultGroupName={#MyAppName} ;默認程序組目錄 AllowNoIcons=yes OutputDir=C:\Users\Myexe\Documents\RAD Studio\Projects\published\isok ;輸出目錄 OutputBaseFilename=Setup Compression=lzma SolidCompression=yes [Languages] Name: "chinesesimp"; MessagesFile: "compiler:Default.isl" [Tasks] Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1 Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked Name: "DesktopIcon"; Description: "建立桌面快捷方式"; GroupDescription: "附加任務"; ;Name: "StartMenuIcon"; Description: "建立開始菜單圖標"; GroupDescription: "附加任務"; ;Name: "QuickLaunchIcon"; Description: "建立快速啓動圖標"; GroupDescription: "附加任務"; [Files] Source: "C:\Users\Myexe\Documents\RAD Studio\Projects\published\pro\Myexe.exe"; DestDir: "{app}"; Flags: ignoreversion ;主程序 Source: "C:\Users\Myexe\Documents\RAD Studio\Projects\published\pro\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs ;主程序文件夾 ; 注意: 不要在任何共享系統文件上使用「Flags: ignoreversion」 [Icons] Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" ;主程序圖標 Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}" ;卸載程序圖標 Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon ;桌面主程序圖標 Name: "{commondesktop}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}" ;桌面卸載程序圖標 Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon [Run] Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent ;安裝完成後啓動程序