powershell - 在 Inno Setup 编译器中运行 [Code] 或 PowerShell 脚本

标签 powershell inno-setup pascalscript

有没有办法运行 [Code]在生成安装可执行文件之前,Inno Setup 编译器中的程序或 PowerShell 脚本?

最佳答案

如果您解释运行代码的目的,您可能会得到更好的答案。反正...

一种方法是compile the script on command-line从批处理文件:

powershell -file precompile.ps1

ISCC.exe setup.iss

powershell -file postcompile.ps1

(或者您可以从 PowerShell 脚本本身调用 ISCC.exe)

在编译之前运行一些脚本的另一种方法是使用 Exec preprocessor function .

#expr Exec("precompile.bat")

或者

#expr Exec("powershell -file precompile.ps1")

另见 Is it possible to call a batch file while compiling an Inno Setup script?

如果您需要 GUI 解决方案,请访问 ISTool ,一个 Inno Setup 扩展,它直接支持预编译和编译后“步骤”。但不幸的是,该项目已不再维护。您可以将其更新到最新的 Inno Setup 版本,因为它是开源的。

关于powershell - 在 Inno Setup 编译器中运行 [Code] 或 PowerShell 脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48772183/

相关文章:

powershell - Winrm 在 Windows Azure Windows VM 上不可用

powershell - 递归计数文件夹树的文件

Powershell:使用参数集重载 C# 风格的函数?

recursion - 使用 Inno Setup PreProcessor 获取源路径及其子目录的文件和大小

installation - 创新设置: Load file edited during installation for wpInfoAfter

powershell - 如何找出当前安装的 webdeploy/msdeploy 版本?

inno-setup - 从 {userdocs} 更改为 {commondocs}

.net - 从 Inno Setup 将程序集添加到 GAC

inno-setup - 是否可以在不编译安装程序的情况下测试 Pascal Script 函数?

inno-setup - 如何在单个 Inno Setup 安装程序中添加 x86 和 x64 VC++ 2019 Redistributables?