![](/img/trans.png)
[英]Inno Setup skips postinstall when 3rd party software installation was cancelled
[英]Detecting that installation was aborted/cancelled in Inno Setup
我有一个 Inno Setup 安装程序,在DeinitilizeSetup()
过程中有一些代码。 重要的是,此过程包括调用创建/启动托管本地主机 REST API 的服务(它刚刚安装),然后调用该 API 以“完成”安装(这是一个误导性的名称,但这并不重要) .
交易如下:如果安装因任何原因中止(当前测试用例是应用程序是否打开,因此安装程序无法覆盖 exe/etc),它会中止,因为它以/verysilent
模式运行。 但我想知道它正在中止(与快乐路径结束相比)并使用查询字符串参数调用 RESTAPI 作为 true 与 false。
我都设置了这样的条件:
if (InstallerCanceled = true) then begin
Log('Calling Service''s FinishInstall endpoint with errorOccurred=true')
WinHttpReq.Open('GET', 'http://localhost:5000/api/update/FinishInstall?errorOccurred=true', False)
end
else begin
Log('Calling Service''s FinishInstall endpoint with errorOccurred=false');
WinHttpReq.Open('GET', 'http://localhost:5000/api/update/FinishInstall?errorOccurred=false', False);
end
WinHttpReq.Send('');
但我不知道如何定义条件本身……我怎么知道安装是否被取消?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.