在启动设置而不是结束时提取文件
我正在使用最新版本的 inno,它在安装过程中执行以下操作:
- 执行依赖项检查以查看安装的内容
- 安装尚未安装的依赖项(.net、sql server、directx 等)
- 安装应用程序并[Files] 部分中的文件 (wpReady)
- 检查 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:
- Perform dependency check to see what is installed
- Installs dependencies that are not already installed (.net, sql server, directx etc)
- Install the application and the files from the [Files] section (wpReady)
- 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用
PrepareToInstall
事件函数中的ExtractTemporaryFile()
函数将[Files]
部分中的任何文件提取到{tmp }
较早,安装完成后它将被删除。 加上脚本和各种钩子,Inno Setup 为您提供了几乎所有可以实现的功能。查看 Inno Setup 帮助的“Pascal Scripting”部分,特别是“Support Functions Reference”。 在那里您可以找到有关
ExtractTemporaryFile()
等的文档。You can use the
ExtractTemporaryFile()
function in thePrepareToInstall
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.{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.