在启动 inno setup 之前解压数据文件

发布于 2024-11-07 19:18:11 字数 116 浏览 6 评论 0原文

我正在开发一个使用非常大的数据文件的应用程序。我的客户希望将这些数据文件与安装 exe 分开压缩,然后安装程序应在开始安装之前解压缩它们。 inno 可以吗?我在 Pascal 方面没有太多经验,因此非常感谢任何帮助。

I am working on an application which uses a very large size of data files. My client wants to zip those data files separately from the setup exe then the installer should unzip them before starting the installation. Is that possible by inno? I don't have much experience in Pascal so any help will be much appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

凉宸 2024-11-14 19:18:11

没有内置的 Pascal 脚本支持解压缩

尽管 Inno Setup 内部有 许多解压缩例程 支持在编译过程中压缩文件的各种方式。这些都没有发布到 Pascal 脚本语言。

仍然可以这样做,但您必须构建一个 DLL 来执行解压缩步骤。然后在卸载中使用此 DLL。

如果您不压缩,则可以使用此方法:

在 Inno Setup 脚本的 [Files] 中,您可以使用 external 来引用安装程序中未包含的文件。代码> 标志。

[Files]
Source: "data1.dat" DestDir: "{app}" Flags: external;

这会将与 Setup.exe 位于同一目录中的 data1.dat 复制到应用程序安装目录。

另一种方法是考虑

为数据文件构建单独的 Inno 安装脚本。将此脚本提供给您的客户,以便他们可以使用编译器(而不是 Zip 程序)运行此脚本。

它会像 ZIP 一样压缩数据,尽管默认值为 lzma2/max。然后可以通过 [Run] 部分链接此安装,以便在安装应用程序后直接安装。

考虑的第二种选择

根据您的评论,我更好地理解您的问题了。

您可以将所有 MP3 文件构建到单个安装设置中。您可以使用 [Components] 部分对 MP3 文件进行分组。这允许用户选择他们想要安装的文件组。 [Files] 部分支持通配符,因此您可以指定单个目录中的所有文件,以使脚本更易于维护。

InnoSetup 旨在通过设置分解方式来处理大型安装
setup.exe 分成多个文件。

[Setup]
DiskSpanning=Yes
DiskSliceSize=XXX
SlicesPerDisk=XXX
SolidCompression=no (Default but it not recommended to be set 'YES' with Huge installs)

No built in Pascal scripting support for uncompression

Although Inno Setup internally has many uncompress routines to support the various ways it can compress the files during compiling. None of these are published to the Pascal Scripting language.

It is still possible to do this, but you must build a DLL to perform the unzipping step. Then use this DLL in your uninstall.

If you don't compress you could use this method:

In the [Files] of your Inno Setup script you can reference files that are not contained in your setup, by using the external flag.

[Files]
Source: "data1.dat" DestDir: "{app}" Flags: external;

This would copy data1.dat located in the same directory as your Setup.exe to your application installation directory.

An alternative to consider

Build a separate Inno Setup Script for the Data Files. Give this script to your clients so they can run this using the Compiler, instead of a Zip program.

It will compress the data like ZIP would, although the default is lzma2/max. This install could then be chained through the [Run] section to install directly after the application was installed.

2nd Alternative to consider

Based on your comment I understand your problem a bit better.

You could build all the MP3 files into a single installation setup. You could group the MP3 files using the [Components] section. This allows the user to select which group of files they want to install. The [Files] Section supports wild cards so you can specify all the files in a single directory to make the script easier to maintain.

InnoSetup is built to handle large installations by setting up ways to break up the
setup.exe into multiple files.

[Setup]
DiskSpanning=Yes
DiskSliceSize=XXX
SlicesPerDisk=XXX
SolidCompression=no (Default but it not recommended to be set 'YES' with Huge installs)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文