Inno Setup 安装时每个section调用顺序

Installation Order

Once the actual installation process begins, this is the order in which the various installation tasks are performed:

  • [InstallDelete] is processed.
  • The entries in [UninstallDelete] are stored in the uninstall log (which, at this stage, is stored in memory).
  • The application directory is created, if necessary.
  • [Dirs] is processed.
  • A filename for the uninstall log is reserved, if necessary.
  • [Files] is processed. (File registration does not happen yet.)
  • [Icons] is processed.
  • [INI] is processed.
  • [Registry] is processed.
  • Files that needed to be registered are now registered, unless the system needs to be restarted, in which case no files are registered until the system is restarted.
  • The Add/Remove Programs entry for the program is created, if necessary.
  • The entries in [UninstallRun] are stored in the uninstall log.
  • The uninstaller EXE and log are finalized and saved to disk. After this is done, the user is forbidden from cancelling the install, and any subsequent errors will not cause what was installed before to be rolled back.
  • [Run] is processed, except for entries with the postinstall flag, which get processed after the Setup Completed wizard page is shown.
  • If ChangesAssociations was set to yes, file associations are refreshed now.
  • If ChangesEnvironment was set to yes, other applications are notified at this point.

All entries are processed by the installer in the order they appear in a section.

Changes are undone by the uninstaller in the opposite order in which the installer made them. This is because the uninstall log is parsed from end to beginning.

In this example:

[INI]
Filename: "{win}\MYPROG.INI"; Section: "InstallSettings"; Flags: uninsdeletesectionifempty
Filename: "{win}\MYPROG.INI"; Section: "InstallSettings"; Key: "InstallPath"; String: "{app}"; Flags: uninsdeleteentry

the installer will first record the data for first entry's uninsdeletesectionifempty flag in the uninstall log, create the key of the second entry, and then record the data for the uninsdeleteentry flag in the uninstall log. When the program is uninstalled, the uninstaller will first process the uninsdeleteentry flag, deleting the entry, and then the uninsdeletesectionifempty flag, deleting the section.

Note that the uninstaller processes [UninstallRun] and [UninstallDelete] entries in the same order they appear in the script (not in reverse order).

### 关于 Inno Setup 的中文文档和教程 #### 中文语言包的支持 为了使 Inno Setup 支持简体中文,可以通过加载 `ChineseSimplified.isl` 文件来实现这一功能。该文件包含了简体中文的语言定义,确保安装程序能够正确显示对应的本地化内容[^1]。 #### 官方示例与测试方法 如果需要验证翻译效果或者学习如何配置多语言支持,可以直接利用官方提供的 `.iss` 示例脚本。通过将其中的 `Language` 参数设置为 `ChineseSimplified` 并使用命令行工具 `ISCC` 进行编译,即可生成带有简体中文界面的安装包[^3]。 ```batch "C:\Program Files\Inno Setup 6\iscc" Example.iss ``` 上述命令会调用 Inno Setup Compiler (`ISCC`) 来处理指定路径下的脚本文件,并最终输出可执行的安装程序。 #### 自定义 INI 配置项 对于更复杂的场景需求,比如向目标系统写入特定的初始化文件条目,则可以在 `[INI]` 节点下声明相关内容。例如下面的例子展示了如何创建名为 `SoundIDorServer.ini` 的配置文件及其内部结构: ```ini [INI] Filename: "SoundIDorServer.ini"; Section: "InstallSettings"; Key: "DateDir"; String: "{app}\data" Filename: "SoundIDorServer.ini"; Section: "InstallSettings"; Key: "InstallPath"; String: "{app}" ``` 此部分允许开发者灵活控制应用程序的行为模式以及存储位置等细节设定[^4]。 #### 综合性教程资源推荐 除了基础的操作指南外,《Inno Setup 安装包制作教程全》提供了详尽的学习材料,涵盖了从基本概念到高级特性的方方面面。它不仅讲解了怎样添加新的语言选项至项目当中,同也深入探讨了一些实用技巧——像是调整默认图标样式、优化用户体验交互流程等等[^2]。 如果您正在寻找更加全面系统的指导手册,那么这份综合型文档将是不错的选择之一;另外还可以关注社区论坛中的讨论帖或是第三方博客文章获取额外帮助信息。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值