检查命令行输入并使用 inno setup 中止安装
我正在尝试使用 Inno Setup 来创建一个 Windows 安装程序,它调用外部命令行应用程序。如果外部应用程序失败,我希望 Inno Setup 中止并显示一条消息,说明应卸载该应用程序并再次安装。或者更好:回滚安装。
我计划执行此操作的方式(如果您有更好的想法请告诉我)是,如果发生任何错误,则从外部应用程序写入日志文件。 Inno setup 应该在调用外部应用程序后检查日志文件是否包含字符串“ok”。
我这样调用我的外部应用程序:
[Run]
Filename: "{app}\exec.exe"; Parameters: "{app}"; AfterInstall: checkLog
我打算有类似的东西:
[Code]
procedure checkLog;
begin
end;
所以我的问题是: 如何从日志中检索字符串并检查它是否包含字符串“ok”? (路径可以是过程的参数)如何通过消息中止安装或回滚安装?
I'm trying to make a windows installer using Inno Setup which calls an external command line application. If the external application fails I want Inno Setup to either abort with a message saying that the app should be uninstalled and installed again. Or even better: rollback the installation.
The way I was planning to do this (let me know if you got better ideas) was to write to a log file from the external application if any errors occurs. Inno setup should after calling the external app check if the log file contains the string "ok" or not.
I call my external app like this:
[Run]
Filename: "{app}\exec.exe"; Parameters: "{app}"; AfterInstall: checkLog
And I was planning to have something like:
[Code]
procedure checkLog;
begin
end;
So my question is: How do i retrieve the string from the log and check whether it contains the string "ok" or not? (The path can be a argument to the procedure) And how do I abort the installation with a message or rollback the installation?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用
并验证从文件中读取的字符串是否
OK
http://www.jrsoftware .org/ishelp/
Use
and verify if the string read from the file has
OK
http://www.jrsoftware.org/ishelp/