检测到安装已在Inno Setup中中止/取消

问题描述 投票:1回答:1

我有一个Inno Setup安装程序,在DeinitilizeSetup()过程中有一些代码。重要的是,此过程包括创建/启动承载本地REST API的服务(刚刚安装的服务)的调用,然后调用该API来“完成”安装(这是一种误导性的名称,但这并不重要) 。

这是交易:如果安装由于任何原因中止(当前测试用例是如果应用程序已打开,则安装程序无法覆盖exe / etc),它将中止,因为它以/verysilent模式运行。但是我想知道它正在中止(相对于一个快乐的路径结尾),并使用带有querystring参数的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('');

但是我不知道如何定义条件本身...我怎么知道安装是否被取消?

installer inno-setup
1个回答
1
投票

检查ssDone中的CurStepChanged event

有关类似问题,请参见:

© www.soinside.com 2019 - 2024. All rights reserved.