文章目录
引言
Inno Setup 是一个免费的 Windows 安装程序制作软件,首次发布于 1997 年。经过多年发展,Inno Setup 在功能和稳定性方面已经超越了许多商业安装程序制作软件。它不仅支持多种语言,还能够执行复杂的安装任务,满足各种软件分发需求。
1. 功能概述
1.1 语言支持
Inno Setup 支持多语言安装,可以方便地翻译安装程序的文本内容。具体可以参考Translating Inno Setup’s Text。
1.2 多字节字符集
Inno Setup 目前支持多字节字符集 (MBCS),详细信息见Does it support MBCS?。
1.3 Windows Installer 支持
虽然 Inno Setup 目前不直接支持 Windows Installer,但它具有强大的功能,可以满足大部分安装需求。更多信息请参见Will it support Windows Installer in the future?。
1.4 自定义图标
用户可以轻松更改 Setup.exe 的图标,具体方法请参见How do I change the icon of Setup.exe?。
1.5 条件安装
Inno Setup 支持条件安装,例如仅在某个注册表项或文件存在时才进行安装。详情见Can Inno Setup do a conditional installation?。
1.6 静默安装
无需使用 /SILENT 或 /VERYSILENT 命令行参数即可进行静默安装。更多信息请参见Is it possible to do a silent install without using the /SILENT or /VERYSILENT command-line parameters?。
2. 常见问题解答
2.1 编译错误
编译时出现 “Mismatched or misplaced quotes on parameter” 错误时,解决方法详见Compiler says “Mismatched or misplaced quotes on parameter”。
2.2 应用程序无法找到文件
安装后的快捷方式启动应用程序时找不到文件,而从资源管理器中直接双击 EXE 文件可以正常运行。解决方案请参见My application can’t find any of its files when it is started from the shortcut created by Setup。
2.3 安装新版本时出现多个条目
安装新版本时不卸载旧版本,会在控制面板的 “添加/删除程序” 中出现多个条目。解决方案详见When I install a new version of my application without uninstalling the old version first, I get a second entry in Control Panel’s “Add/Remove Programs”。
2.4 安装文件损坏
在某些系统上显示 “安装文件已损坏” 错误信息。详细信息请参见Why is the error message “The setup files are corrupted” displayed on some systems?。
2.5 DLL/OCX 注册失败
安装时出现 “Unable to register the DLL/OCX: DllRegisterServer export not found” 错误信息。解决方法请参见Setup gives the message “Unable to register the DLL/OCX: DllRegisterServer export not found”。
3. 安装任务示例
3.1 创建互联网快捷方式
如何创建指向 URL 的快捷方式,请参见Creating Internet (URL) Shortcuts。
3.2 设置快捷方式的 “起始位置”
为快捷方式设置 “起始位置” 字段的方法详见Setting the “Start In” Field on a Shortcut。
3.3 文件关联
如何创建文件关联,请参见Creating File Associations。
3.4 设置环境变量
为安装设置环境变量的方法请参见Setting Environment Variables。
3.5 设置 MS-DOS 程序快捷方式的 “关闭退出”
为 MS-DOS 程序快捷方式设置 “关闭退出” 框的方法详见Setting the “Close on Exit” Box on a Shortcut to an MS-DOS Program。
3.6 根据 Windows 版本安装不同文件
如何根据 Windows 版本安装不同文件,请参见Installing Different Files Depending on Windows Version。
4. 进一步学习资源
- 互联网软件的安装包界面设计-Inno setup
- InternetFashionedInstaller
- innodependencyinstaller 及其译文
- 检测和安装 vcredist_x86.exe 和相关资源
- How to make vcredist_x86 reinstall only if not yet installed?
- How can I install .NET framework as a prerequisite using InnoSetup?
- Installing .NET Framework 4.5 automatically with Inno Setup
- Inno Setup MSVC vcredist without bothering your users
- 使用 Inno Setup 打包 .NET 程序, 并自动安装 .Net Framework