1

I have an Inno Setup installer with some code in the DeinitilizeSetup() procedure. Importantly, this procedure includes calls to create/start a service (that it just installed) that hosts a localhost REST API, and then calls to that API to 'finish' the install (that's sort of a misleading name, but that's not important).

Here's the deal: If the installation aborted for any reason (current test case is if the application was open, so the installer couldn't overwrite the exe/etc), it aborts because it's running in /verysilent mode. But I want to KNOW that it is aborting (vs a happy path ending) and call the RESTAPI with a querystring parameter as true vs false.

I'm all set with a conditional like this:

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('');

But I can't figure out how to define the conditional itself...how do I know if the install was cancelled?

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Keith
  • 777
  • 8
  • 27

1 Answers1

1

Check for ssDone in CurStepChanged event.

To distinguish if installation was canceled or aborted, test if CancelButtonClick event was triggered.

For similar questions, see:

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
  • @Niki If you have a question, please [post a question](https://stackoverflow.com/questions/ask) with all details you have. Why do you need that? What would it be good for? – Martin Prikryl Apr 20 '23 at 04:56
  • Here is the quesiton https://stackoverflow.com/questions/76090304/is-there-a-way-to-known-innosetup-installation-abort-failure-reason-within-delph – Niki Apr 24 '23 at 09:09