参考博客:制作部署安装包:Inno Setup

参考资料:Inno Setup详细教程

参考资料:Innosetup使用详细全面教程

个人使用的 风铃夜思雨 的汉化版,版本:5.5.5

; 脚本由 Inno Setup 脚本向导 生成!
; 有关创建 Inno Setup 脚本文件的详细资料请查阅帮助文档!

#define MyAppName "xxxxxxxx"
#define MyAppName1 "xxxxxx"
#define MyAppName2 "xxxxxx"
#define MyAppVersion "1.00"
#define MyAppPublisher "xxx"
#define MyAppURL "http://www.xxx.com/"
#define MyAppExeName1 "xxxx.exe"
#define MyAppExeName2 "xxxx.exe"

;这个段包含用于安装程序和卸载程序的全局设置
[Setup]
; 注: AppId的值为单独标识该应用程序。
; 不要为其他安装程序使用相同的AppId值。
; (生成新的GUID,点击 工具|在IDE中生成GUID。)
AppId={{CF002CA5-9C74-491C-AF38-903CD91BF624}
;安装界面左上角程序名
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}

;默认安装目录、默认安装目录名
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
;选择是否创建图标
AllowNoIcons=
;是否进行选择安装模式
AlwaysShowComponentsList=
;设置开始菜单文件夹名
AlwaysShowGroupOnReadyPage=
AppCopyright=Copyright  xxx
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}

;可重新修复软件
;AppModifyPath="
;资源管理器更改环境变量
;ChangesEnvironment=
;提示输入用户信息
;UserInfoPage=
;默认序列号
;DefaultUserInfoSerial=serial
;密码
;Password=pwd
;许可文档
;LicenseFile=license.txt
;选择目标目录页签显示阅读文档
;InfoBeforeFile=infobefore.txt
;安装完成后显示阅读文档
;InfoAfterFile=infoafter.txt
;显示启动渐变背景
;WindowVisible=
;安装程序使用“3D”选择框
FlatComponentsList=
;安装程序指定新图标
SetupIconFile=F:\xxx\xxx.ico
;卸载图标
;UninstallDisplayIcon={app}\uninstall.ico

OutputDir=F:\xxx
OutputBaseFilename=xxx
Compression=lzma
SolidCompression=yes

;可选。用来定义安装程序向导在选择组件面时可供选择的所有安装类型
[Types]
Name:"communication";Description:xxxx
Name:"client";Description:xxxx

;可选。定义安装程序向导的选择组件页中显示的所有组件,以便于用户定制安装类型
[Components]
Name:"communication";Description:{#MyAppName1};Types:communication
Name:"client";Description:{#MyAppName2};Types:client

[Languages]
Name: "chinesesimp"; MessagesFile: "compiler:Default.isl"
Name:"en";MessagesFile:"compiler:English.isl"

;可选。定义安装程序在执行安装期间所有由用户定制的任务。
[Tasks]
Name: "desktopicon"; Description: ",6.1

;定义安装程序安装文件到用户系统中的可选文段
[Files]
Source: "F:\xxx\xxx\xxx.exe"; DestDir: "{app}"; Flags: ignoreversion;Components:communication
Source: "F:\xxx\xxx\xxx.exe.config"; DestDir: "{app}"; Flags: ignoreversion ;Components:communication
Source: "F:\xxx\xxx\xxx.exe"; DestDir: "{app}"; Flags: ignoreversion;Components:client
Source: "F:\xxx\xxx\xxx.exe.config"; DestDir: "{app}"; Flags: ignoreversion ;Components:client

; 注意: 不要在任何共享系统文件上使用“Flags: ignoreversion”

;定义所有创建在开始菜单和/或其他位置的快捷方式

; Add the ISSkin DLL used for skinning Inno Setup installations.
Source: compiler:ISSkin.dll; DestDir: {app}; Flags: dontcopy
; Add the Visual Style resource contains resources used for skinning,
; you can also use Microsoft Visual Styles (*.msstyles) resources.
Source: compiler:IsSkins\Codejock.cjstyles; DestDir: {tmp}; Flags: dontcopy

[Code]

// Importing LoadSkin API from ISSkin.DLL
procedure LoadSkin(lpszPath: AnsiString; lpszIniFileName: AnsiString);
external 'LoadSkin@files:isskin.dll stdcall';

// Importing UnloadSkin API from ISSkin.DLL
procedure UnloadSkin();
external 'UnloadSkin@files:isskin.dll stdcall';

// Importing ShowWindow Windows API from User32.DLL
function ShowWindow(hWnd: Integer; uType: Integer): Integer;
external 'ShowWindow@user32.dll stdcall';

function InitializeSetup(): Boolean;
var Path:string ;
    ResultCode: Integer;
    dotNetV4RegPath:string;
    dotNetV4PackFile:string;
begin
    ExtractTemporaryFile('Codejock.cjstyles');
    LoadSkin(AnsiString(ExpandConstant('{tmp}\Codejock.cjstyles')), '');
    //Result := True;

  dotNetV4RegPath:='SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full';
  dotNetV4PackFile:='{src}\dotNetFx40_Full_x86_x64.exe';

  if RegKeyExists(HKLM, dotNetV4RegPath) then
  begin
    Result := true;
  end
  else
  begin
      Path := ExpandConstant(dotNetV4PackFile);
      if(FileOrDirExists(Path)) then
      begin
        Exec(Path, '/qb', '', SW_SHOW, ewWaitUntilTerminated, ResultCode);
        if RegKeyExists(HKLM, dotNetV4RegPath) then
        begin
           Result := true;
        end
        else
        begin
           MsgBox('未能成功安装.Net Framework4.0运行环境,系统将无法运行,本安装程序即将退出!',mbInformation,MB_OK);
        end
      end
      else
      begin
          MsgBox('没有安装.Net Framework4.0运行环境,系统将无法运行,本安装程序即将退出!',mbInformation,MB_OK);
      end
  end;
end;

procedure DeinitializeSetup();
begin
    // Hide Window before unloading skin so user does not get
    // a glimse of an unskinned window before it is closed.
    ShowWindow(StrToInt(ExpandConstant();
    UnloadSkin();
end;

[Icons]
;{group}开始菜单文件夹路径,由用户在安装程序的选择开始菜单文件夹向导页中选定
Name: "{group}\{#MyAppName1}"; Filename: "{app}\{#MyAppExeName1}";Components:communication
;{group}开始菜单文件夹路径,由用户在安装程序的选择开始菜单文件夹向导页中选定
Name: "{group}\{#MyAppName2}"; Filename: "{app}\{#MyAppExeName2}";Components:client
;{commondesktop}&{userdesktop}桌面文件夹路径
Name: "{commondesktop}\{#MyAppName1}"; Filename: "{app}\{#MyAppExeName1}"; Tasks: desktopicon;Components:communication
;{commondesktop}&{userdesktop}桌面文件夹路径
Name: "{commondesktop}\{#MyAppName2}"; Filename: "{app}\{#MyAppExeName2}"; Tasks: desktopicon;Components:client
;{uninstallexe}由安装程序提取的卸载程序的完整路径名
Name:"{group}\卸载{#MyAppName1}" ;Filename:"{uninstallexe}";IconFilename:"{app}\uninstall.ico";Components:communication
;{uninstallexe}由安装程序提取的卸载程序的完整路径名
Name:"{group}\卸载{#MyAppName2}" ;Filename:"{uninstallexe}";IconFilename:"{app}\uninstall.ico";Components:client

;可选。用来定义一些想用安装在用户系统中创建、修改或删除的注册表键/值。
;按默认,用安装程序创建的注册表键和值在卸载时不删除。如果想让卸载程序删除键或值,必须包含
;uninsdelete* 标记中的一个
[Registry]
Root:HKLM;Subkey:"Software\xxx";Flags:uninsdeletekeyifempty
Root:HKLM;Subkey:"Software\xxx\communication";Flags:uninsdeletekey;Components:communication
Root:HKLM;Subkey:"Software\xxx\communication";ValueType:string;ValueName:"InstallPath";ValueData:"{app}";Components:communication
Root:HKLM;Subkey:"Software\xxx\client";Flags:uninsdeletekey;Components:client
Root:HKLM;Subkey:"Software\xxx\client";ValueType:string;ValueName:"InstallPath";ValueData:"{app}";Components:client

[UninstallDelete]
Type:filesandordirs;Name:"{app}\Log"
Type:filesandordirs;Name:"{app}\ErrorTrace.xml"
Type:filesandordirs;Name:"{app}\*.*"

;可选。指定程序完成安装后,在安装程序显示最终对话框之前要执行的程序数
[Run]
Filename: "{app}\{#MyAppExeName1}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName1, '&', '&&')}}"; Flags: nowait postinstall skipifsilent;Components:communication

Filename: "{app}\{#MyAppExeName2}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName2, '&', '&&')}}"; Flags: nowait postinstall skipifsilent;Components:client

Inno Setup 教程的更多相关文章

  1. [!!!!!]Inno Setup教程-常见问题解答

    [转]Inno Setup教程-常见问题解答 功能 * 翻译 Inno Setup 文字  * 它支持 MBCS (多字节字符集) 吗?  * 将来会支持 Windows Installer 吗?   ...

  2. inno setup教程解释脚本

    inno setup教程解释脚本 2007-04-08 21:31:36|  分类: 科技-> Inno Setu |  标签:inno   |举报 |字号 订阅     下载LOFTER客户端 ...

  3. Inno Setup教程

    一.简介 Inno Setup是一款免费的安装制作软件,小巧.简便.精美是其最大特点,支持pascal脚本,能快速制作出标准Windows2000风格的安装界面,足以完成一般安装任务.该软件用Delp ...

  4. inno setup详细使用教程

    前段时间我完成了几个软件的汉化,想把它们打包起来,可是苦于我是一个很菜的鸟,很笨的瓜,只好上网找关于安装程序制作的文章.不幸我没能找到:-( 没法只好自己去华军软件园里找找制作安装程序的软件,并一把下 ...

  5. 使用Inno Setup 制作软件安装包详细教程(与开发语言无关)

    前言:关于如何制作一个软件安装包的教程,与编程语言无关.以下,请看详情~ 1.下载Inno Setup,下载地址:https://jrsoftware.org/isinfo.php 2.下载最新版本即 ...

  6. Inno setup 简单打包教程

    转自:http://blog.csdn.net/ruifangcui7758/article/details/6662646 前段时间关注了VC6.0自带的Installshield打包的使用方法,感 ...

  7. 开源Inno Setup官网下载、安装、打包教程(官网安装向导中文语言包)

    安装Inno Setup篇 1.搜索Inno Setup 2.下载Inno Setup 3.选择下载最新 innosetup-5.5.9-unicode.exe 版本(innosetup-5.5.9. ...

  8. Inno Setup Compiler 中文使用教程

    一.概要 该文章主要解决,Inno Setup Compiler工具的使用问题. 如有什么建议欢迎提出,本人及时修改.[如有任何疑惑可以加Q群:580749909] 二.步骤 (1)下载地址:http ...

  9. Inno打包教程_百度经验

    Inno打包教程 Inno工具,是比较常用的打包软件.简简单单,一招叫你学会使用inno打包. 工具/原料 inno setup 软件 方法/步骤 双击桌面的:Inno setup compiler图 ...

随机推荐

  1. memcached与spring

    key的生成规则 update 与 query 的参数不一样,如何让其生成一样的key 列表缓存如何定义key及失效 最近同事推荐了一个开源项目:Simple-Spring-Memcached(简称s ...

  2. Java静态块学习

    静态块是类里面的构造器,对象有构造器那么类也有构造器,类里面的构造器叫做初始化方法.也就是new一个对象他会经过一个构造器.加载一个类,也有被初始化的一片代码,这个就称之为静态块.一个类里面可以有很多 ...

  3. HDU 3336 Count the string(KMP的Next数组应用+DP)

    Count the string Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) ...

  4. Hadoop2 实战系列之1 -- Hortonworks Sandbox的安装和使用

    欢迎转载,转载请注明出处,谢谢,徽沪一郎. 概要 本文主要讲述如何利用hortonworks sanbox来搭建hadoop2的学习环境.Hortonworks sanbox集成了hadoop2及其上 ...

  5. Javascript 统计复选框选中个数

    var checked = document.getElementsByName("checked_c[]"); var checked_counts = 0; for(var i ...

  6. 批量清除BOM头

    批量清除BOM头 (2012-03-05 13:28:30) 转载▼ 标签: 杂谈   有些php文件由于不小心保存成了含bom头的格式而导致出现一系列的问题.以下是批量清除bom头的代码,复制代码, ...

  7. Bootstrap页面布局13 - BS按钮

    bootstrap中的按钮类 一般可以作为按钮的标签有:<a></a>  <button></button>  <input type='butt ...

  8. 20145317彭垚《Java程序设计》实验二

    20145317<Java程序设计>实验二Java面向对象程序设计实验报告 实验内容 初步掌握单元测试和TDD 理解并掌握面向对象三要素:封装.继承.多态 初步掌握UML建模 熟悉S.O. ...

  9. Mysql Cluster配置基本篇

    一.下载mysql-cluster 从mysql官网下载对应的mysql-cluster 二.配置管理节点 1.解压mysql-cluster,找到解压文件中的ndb_mgm和ndb_mgmd 2.复 ...

  10. linux C gcc -lm

    使用math.h中声明的库函数还有一点特殊之处,gcc命令行必须加-lm选项,因为数学函数位于libm.so库文件中(这些库文件通常位于/lib目录下),-lm选项告诉编译器,我们程序中用到的数学函数 ...