Lukas
Posts: 5
Joined: Wed Feb 26, 2020 2:31 pm

How to abort custom action which take long time to finish

Hi guys,

I want to run custom action which will send some http requests and will increment progress bar with proper action text. I implemented it according to this sample viewtopic.php?t=27535

This custom action will take long time to execute, so i want to be able to cancel it's execution with some cancel btn or by pressing X in top right corner and confirming that i want to cancel setup if user decided so. I tried to set that custom action will not 'wait for custom action to finish before proceeding' with option 'Wait for return code at the end of the sequence' but in this case custom action was not executed at all or just part of the custom action was executed. Is it possible to somehow send some cancellation token to custom action to stop it ? Or set some property ?

I attached sample project with code of custom action and aip project.

Can you please tell me how to achieve this ?

Best regards
Lukas
Attachments
TestProject.zip
(701.88 KiB) Downloaded 174 times
Catalin
Posts: 6586
Joined: Wed Jun 13, 2018 7:49 am

Re: How to abort custom action which take long time to finish

Hello Lukas,
Is it possible to somehow send some cancellation token to custom action to stop it ? Or set some property ?
Unfortunately, I am afraid that I am not aware of any method in which this can be achieved.

The only thing I can think of would be to use the "X" button from the top right corner to cancel the installation.

Please let me know if there is anything else I could help you with and I will be glad to assist.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Lukas
Posts: 5
Joined: Wed Feb 26, 2020 2:31 pm

Re: How to abort custom action which take long time to finish

Hello Catalin,

Using "X" button from the top right corner to cancel the installation could solve my issue.

Can you tell me how to achieve that ? Because if custom action is running and i am pressing X button in the top right corner installation is not canceled. I did not get that window asking if i want to cancel installation. I need to wait until custom action is finished.

Best regards,
Lukas
Lukas
Posts: 5
Joined: Wed Feb 26, 2020 2:31 pm

Re: How to abort custom action which take long time to finish

Hello Catalin,

Also can you pls explain how these options works for custom actions ? Because in my case the custom action was not executed at all when i called it from button. Maybe i am doing something wrong there.

wait for custom action to finish before proceeding' with option 'Wait for return code at the end of the sequence'

Best Regards,
Lukas
Catalin
Posts: 6586
Joined: Wed Jun 13, 2018 7:49 am

Re: How to abort custom action which take long time to finish

Hello Lukas,
Using "X" button from the top right corner to cancel the installation could solve my issue.

Can you tell me how to achieve that ? Because if custom action is running and i am pressing X button in the top right corner installation is not canceled. I did not get that window asking if i want to cancel installation. I need to wait until custom action is finished.
From what I could see with the project you have earlier provided, by pressing the "X" button, the custom action also stopped executing.
wait for custom action to finish before proceeding' with option 'Wait for return code at the end of the sequence'
If the "Wait for custom action to finish before proceeding" option is unchecked, the custom action will run asynchronously.

Wait for return code at the end of the sequence - determines if the current stage (Wizard Dialogs Stage or Install Execution Stage) will wait for the custom action return code after all actions have been executed. The actual return code is ignored by the installation.

You can find more information about these in the "Custom Action Properties" article.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”