Force installer to silently shutdown?

69 views
Skip to first unread message

Patrick Curry

unread,
Jun 13, 2025, 11:36:53 PM6/13/25
to innosetup
Hello Inno Setup community!

I'd like to issue a command in the [Code] section of our .iss installer program to make the installer instantly quit without any pop-ups or confirmations shown to the user.

Is there an official or best way to do this?

Thank you in advance!
Patrick


Eivind Bakkestuen

unread,
Jun 15, 2025, 5:17:45 AM6/15/25
to inno...@googlegroups.com
In the docs, look for 

Pascal Scripting: Event Functions

and

function InitializeSetup(): Boolean;


--
You received this message because you are subscribed to the Google Groups "innosetup" group.
To unsubscribe from this group and stop receiving emails from it, send an email to innosetup+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/innosetup/2ca77060-cc11-492f-a86d-777f437b88ccn%40googlegroups.com.

Jernej Simončič

unread,
Jun 15, 2025, 7:00:32 AM6/15/25
to Patrick Curry on [innosetup]

On Friday, June 13, 2025, 23:01:11, Patrick Curry wrote:


Is there an official or best way to do this?

There's Abort procedure, but it needs to be called from appropriate event function. Otherwise you'll probably have to import ExitProcess Win32 API.

 

-- 
< Jernej Simončič ><><><><>< https://eternallybored.org/ >


The light at the end of the tunnel is the headlamp of an oncoming train.
       -- Lyndons principal

Gavin Lambert

unread,
Jun 15, 2025, 7:15:36 PM6/15/25
to innosetup
On Sunday, June 15, 2025 at 11:00:32 PM UTC+12 Jernej Simončič wrote:

There's Abort procedure, but it needs to be called from appropriate event function. Otherwise you'll probably have to import ExitProcess Win32 API.

It's not recommended to use ExitProcess, as this will skip some cleanup logic that normally runs on exit.

For conditions that you can detect during startup, the best way to do things is to return False from InitializeSetup.

If you're not able to detect the problem until during the wizard, the best thing to do is to disable the Next button (perhaps on a dedicated error page to show a detailed message) and require the user to Cancel (or go Back and correct something, if possible).

If you're not able to detect the problem until after the wizard, return an error message from PrepareToInstall.

You're not allowed to fail after that.  You should continue as best you can and optionally display an error message or page afterwards.

Patrick Curry

unread,
Jun 18, 2025, 7:17:46 PM6/18/25
to innosetup
Thank you for the replies. I will investigate these options!
Reply all
Reply to author
Forward
0 new messages