编译Inno Setup脚本时可以调用批处理文件吗? [英] Is it possible to call a batch file while compiling an Inno Setup script?

查看:219
本文介绍了编译Inno Setup脚本时可以调用批处理文件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Inno Setup编译过程开始时调用一个批处理文件。即在开始编译之前,请先执行外部操作。这是可能的还是我的外部活动应该包装Inno Setup的编译过程?

I'd like to call a batch file at the start of an Inno Setup compile process. i.e. before it starts compiling, perform an external operation. Is this possible or should my external activity be wrapping the Inno Setup compile process?

推荐答案

如果您在Inno上安装了ISPP(现在内置),则可以使用 Exec() 预处理程序功能来运行您的批处理文件。编译将暂停直到返回为止(将其放置在文件的开头)。

If you have ISPP installed with Inno (It's built in now) then you can use the Exec() preprocessor function to run your batch file. The compile will be paused until it returns (place it at the beginning of your file).

#expr Exec("c:\file.bat")

如果您的命令带有参数,则必须将其写为:

If your command takes arguments, you have to write it as:

#expr Exec('c:\my_cmd.exe','some_argument') 

您还可以从批处理文件运行它,然后调用安装程序编译器。

You can also run it from a batch file that then calls the setup compiler.

这篇关于编译Inno Setup脚本时可以调用批处理文件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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