Inno Setup指南 —— 教程索引

InnoSetup指南 —— 教程索引

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

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

[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目录中

其他常用标记说明

1
2
3
4
5
6

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

1
2
3
4
5
6
7
8
9
10
11
12

[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命令行:

1
2
3

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

powershell脚本[SimplestSetup.ps1]

1
2
3
4

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

更多

Inno Setup官方内容

个人试验整理


掘:奇葩史