在启动设置而不是结束时提取文件

发布于 2024-07-18 07:39:36 字数 787 浏览 5 评论 0原文

我正在使用最新版本的 inno,它在安装过程中执行以下操作:

  1. 执行依赖项检查以查看安装的内容
  2. 安装尚未安装的依赖项(.net、sql server、directx 等)
  3. 安装应用程序并[Files] 部分中的文件 (wpReady)
  4. 检查 SQL Server 是否有以前安装的数据库并创建/更新表等

步骤 [4] 创建数据库和表等,并且仅在已安装 SQL Server 的情况下才有效为什么要在步骤[2]中完成?

输出目录包含创建的 setup.exe,我手动放置包含上述步骤 [1,2 和 4] 所需文件的附加依赖项文件夹。

这很好用,但我想只创建一个包含所有依赖项的 exe,并在 wpReady 之前和上面的步骤 [1] 之前提取依赖项。

依赖项位于 [Files] 部分,但只有在安装程序完成所有表单并尝试安装文件后执行 wpReady 消息后,才会提取这些文件。

我使用以下命令将我需要的内容添加到 setup.exe 中,

[Files]
Source: Output\Dependencies\*; DestDir: {tmp}; Flags: deleteafterinstall

wpReady 之前将文件提取到临时目录的最佳方法是什么,或者我应该执行 wpReady 的操作> 首先然后安装依赖项(虽然并不理想)。

I am using the latest version of inno that does the following during setup:

  1. Perform dependency check to see what is installed
  2. Installs dependencies that are not already installed (.net, sql server, directx etc)
  3. Install the application and the files from the [Files] section (wpReady)
  4. Checks SQL Server for previously installed database and creates / updates the tables etc

Step [4] creates the database and tables etc and only works if SQL Server has already been installed which is why it is done in Step [2].

The output directory contains the created setup.exe and I manually place the additional dependencies folder containing the files required for steps [1,2 and 4] mentioned above.

This works great but I would like to create a single exe only that includes all the dependencies and extracts the dependencies BEFORE wpReady and before Step [1] above.

The dependencies are in the [Files] section but these files are not extracted until the setup executes wpReady message after the setup has gone through all the forms and attempts to install the files.

I use the following that adds what I need to the setup.exe

[Files]
Source: Output\Dependencies\*; DestDir: {tmp}; Flags: deleteafterinstall

What is the best way to extract the files to the temp directory before wpReady or should I perform the actions of wpReady first then go about installing the Dependencies (not ideal though).

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

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

发布评论

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

评论(2

新雨望断虹 2024-07-25 07:39:36

您可以使用 PrepareToInstall 事件函数中的 ExtractTemporaryFile() 函数将 [Files] 部分中的任何文件提取到 {tmp } 较早,安装完成后它将被删除。 加上脚本和各种钩子,Inno Setup 为您提供了几乎所有可以实现的功能。

查看 Inno Setup 帮助的“Pascal Scripting”部分,特别是“Support Functions Reference”。 在那里您可以找到有关 ExtractTemporaryFile() 等的文档。

You can use the ExtractTemporaryFile() function in the PrepareToInstall event function to extract any file from the [Files] section to {tmp} earlier, and it will be deleted when the setup finishes. Together with scripting and the various hooks Inno Setup gives you nearly everything can be achieved.

Have a look at the "Pascal Scripting" section of the Inno Setup help, specifically the "Support Functions Reference". There you will find documentation for ExtractTemporaryFile() and more.

只等公子 2024-07-25 07:39:36

{tmp}

安装或卸载使用的临时目录。 这不是用户的 TEMP 环境变量的值。 它是用户临时目录的子目录,由安装程序或卸载程序在启动时创建(名称类似于“C:\WINDOWS\TEMP\IS-xxxxx.tmp”)。 当安装程序或卸载程序退出时,该目录中的所有文件和子目录都将被删除。 在安装过程中,这主要用于提取要在 [Run] 部分中执行但安装后不需要的文件。

{tmp}

Temporary directory used by Setup or Uninstall. This is not the value of the user's TEMP environment variable. It is a subdirectory of the user's temporary directory which is created by Setup or Uninstall at startup (with a name like "C:\WINDOWS\TEMP\IS-xxxxx.tmp"). All files and subdirectories in this directory are deleted when Setup or Uninstall exits. During Setup, this is primarily useful for extracting files that are to be executed in the [Run] section but aren't needed after the installation.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文