当运行命令失败时,如何强制Inno Setup安装程序失败? [英] How to force Inno Setup setup to fail when Run command fails?

查看:120
本文介绍了当运行命令失败时,如何强制Inno Setup安装程序失败?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Inno Setup脚本的[Run]部分中有一些命令.现在,如果其中任何一个返回失败代码(返回值非零),则安装将继续进行,而不会向用户发出任何警告.所需的行为是使安装失败并回滚.

I have some commands in the [Run] section of my Inno Setup script. Right now, if any of them returns a failure code (non-zero return value), the setup continues without any warning to the user. The desired behavior is to have the setup fail and roll back.

如何启用此功能?我找不到Run条目的任何标志来强制执行此行为.我想念什么吗?

How do I enable this? I couldn't find any flag for the Run entry that would force this behavior. Am I missing something?

推荐答案

就我而言,您必须使用[Code]部分,使用Exec函数运行文件,然后在ResultCode返回并运行您的卸载脚本.

As far as I'm concerned, you have to use [Code] section for that, run the files with Exec function, check ResultCode upon return and run your uninstall script.

这篇关于当运行命令失败时,如何强制Inno Setup安装程序失败?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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