在Inno Setup编译器中运行[Code]或PowerShell脚本 [英] Run a [Code] or PowerShell script in Inno Setup compiler

查看:125
本文介绍了在Inno Setup编译器中运行[Code]或PowerShell脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在生成安装可执行文件之前,是否可以在Inno Setup编译器中运行[Code]过程或PowerShell脚本?

Is there a way to run a [Code] procedure or PowerShell script in the Inno Setup compiler before the installation executable is generated?

推荐答案

如果您解释了运行代码所需要的内容,则可能会得到更好的答案.无论如何...

一种方法是从命令行编译脚本.批处理文件:

One way is to compile the script on command-line from a batch file:

powershell -file precompile.ps1

ISCC.exe setup.iss

powershell -file postcompile.ps1

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

(or you can call ISCC.exe from the PowerShell script itself)

在编译之前运行某些脚本的另一种方法是使用 Exec预处理器功能.

Another way to run some script before compilation is using Exec preprocessor function.

#expr Exec("precompile.bat")

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

另请参阅是否可以在编译Inno Setup脚本时调用批处理文件?

如果您需要GUI解决方案,则可以使用 ISTool ,它是Inno Setup扩展,可​​以直接支持预编译和后编译步骤".但是不幸的是,该项目不再维护.您可以将其更新到最新的Inno Setup版本,因为它是开源的.

If you need a GUI solution, there's ISTool, an Inno Setup extension, that has direct support for Pre Compilation and Post Compilation "Steps". But this project is unfortunately no longer maintained. You might be able to update it to the latest Inno Setup version, as it is open source.

这篇关于在Inno Setup编译器中运行[Code]或PowerShell脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆