Inno Setup 通用脚本及简要说明( 一般情况够用了)

;以下脚本主要完成创建开始菜单和桌面的快捷方式,目录安装。



#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

;安装完成后启动程序

 

你可能感兴趣的:(Inno Setup)