Inno Setup指南 —— 教程索引

标签: Inno Setup, Inno, 安装包

博客分类: 信息整合, 教程

鉴于VSCode都用inno setup打包了,个人就学习一下用inno做安装包的简易操作

用Inno做一个最简单的安装包

  • 下载官方编译工具:https://jrsoftware.org/download.php/is.exe
  • 新建安装包制作脚本文件SimplestSetup.iss
  • 添加以下内容至.iss文件中:

``` ini

[Setup]
AppName=HelloWorld
AppVersion=1.0.0.0
WizardStyle=modern
DefaultDirName={autopf}\HelloWorld
DefaultGroupName=HelloWorld
UninstallDisplayIcon={app}\HelloWorld.exe
Compression=lzma2
SolidCompression=yes
OutputDir=userdocs:Inno Setup Examples Output
OutputBaseFilename=HelloWorldSetup

[Files]
Source: "HelloWorld.exe"; DestDir: "{app}"

```

  • Inno Setup Compiler打开.iss文件,若安装时,关联了.iss文件,可以直接双击打开
  • 点击编译 Compile 按钮,HelloWorldSetup.exe安装包将生成到用户文档目录下的Inno Setup Examples Output目录中

其他常用标记说明

  • 快捷方式[Icons]:https://gitee.com/huaxia283611/WiXToolsetDoc/tree/master/samples/Jess.Sample.InnoSetup/ShortcutSetup.iss

``` ini

[Icons]
Name: "{group}\HelloWorld"; Filename: "{app}\HelloWorld.exe"
Name: "{commondesktop}\HelloWorld"; Filename: "{app}\HelloWorld.exe"
Name: "{group}\卸载HelloWorld"; Filename: "{uninstallexe}"   

```

  • 安装部件控制[Components & Types]:https://gitee.com/huaxia283611/WiXToolsetDoc/tree/master/samples/Jess.Sample.InnoSetup/OptionSetup.iss

``` ini

[Files]
Source: "HelloWorld.exe"; DestDir: "{app}";Components:main

[Types]
Name: "full"; Description: "完全安装"
Name: "compact"; Description: "最小安装"
Name:"custom";Description:"自定义安装"; Flags:iscustom

[Components]
Name:main;Description:"主程序";Types:full

```

命令行执行打包

cmd命令行:

``` bash

"C:\Program Files (x86)\Inno Setup 6\ISCC.exe" SimplestSetup.iss

```

powershell脚本[SimplestSetup.ps1]

``` powershell

$isccexe='C:\Program Files (x86)\Inno Setup 6\ISCC.exe'
&$isccexe $PSScriptRoot'\SimplestSetup.iss'

```

更多

Inno Setup官方内容

个人试验整理


掘:奇葩史