Exit from Inno Setup installation from [Code]

Matheus picture Matheus · Dec 14, 2010 · Viewed 18k times · Source

Is it possible to exit the installation from a function in the [Code] section of an installer created with Inno Setup?

I'm not interested in setting the exit code, what I want to do is perform a custom check for a requirement, and exit the installation if that requirement was not previously installed.

Answer

lepe picture lepe · Aug 11, 2011

You can use Abort() if you are in these events:

InitializeSetup
InitializeWizard
CurStepChanged(ssInstall)
InitializeUninstall
CurUninstallStepChanged(usAppMutexCheck)
CurUninstallStepChanged(usUninstall)