inno setup介绍

Inno Setup 是一个免费的 Windows 安装程序制作软件。
关键功能:
1、 支持现在所有正在使用的 32 位 Windows 版本: Windows 95,98,2000,Server 2003,XP,Me,NT 4.0 (不需要服务包)。
2、支持创建单个 EXE 格式的安装程序,使你的程序可以很方便地在网络上发表。同时也支持磁盘延伸。
3、 标准的 Windows 2000/XP 样式向导界面。
4、定制安装类型,例如:完整安装,最小安装,自定义安装。

5、 完整的卸载功能。


代码案例:


#define MyAppName "资料管理系统"
#define MyAppVersion "1.0"
#define MyAppPublisher "资料管理系统"
#define MyAppURL "http://www.web.com/"
#define MyAppExeName "Info.exe"

#define MyHelp "help.chm"
 
[Setup]
; 注: AppId的值为单独标识该应用程序。
; 不要为其他安装程序使用相同的AppId值。
; (生成新的GUID,点击 工具|在IDE中生成GUID。)
AppId={{B3D1E975-6666-4F44-BFAE-A9942FBE3410}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes


[code]
function InitializeSetup: Boolean;
var Path:string ;
  ResultCode: Integer;
  dotNetV35PackFile:string;
  src: string;

begin
  if RegKeyExists(HKLM, 'SOFTWARE\Microsoft\.NETFramework\policy\v2.0')
  then
  begin
  Result := true;
  end
  else if RegKeyExists(HKLM, 'SOFTWARE\Microsoft\.NETFramework\policy\v3.5')
  then
  begin
  Result := true;
  end
  else if RegKeyExists(HKLM, 'SOFTWARE\Microsoft\.NETFramework\policy\v4.0')
  then
  begin
  Result := true;
  end
  else
  begin
  MsgBox('系统检测到您的计算机没有安装.Net Framework,请先安装.Net Framework2.0或以上版本,本安装程序即将退出!', mbConfirmation, MB_OK);
  Result := false;
  end
end;

[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

[Files]
Source: "D:\Release\Info.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; 注意: 不要在任何共享系统文件上使用“Flags: ignoreversion”

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
Name: "{group}\帮助文档"; Filename: "{app}\help.chm"  
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon

[Run]
;执行bat文件
Filename: "{app}\dsoframe.bat";   Description:   "Setup";   Flags:   skipifsilent   shellexec   
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

[UninstallRun]
Filename: "{app}\undsoframe.bat"; Flags: skipifdoesntexist



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值