Stop and roll back an installation from Pascal code in very silent mode?

42 views
Skip to first unread message

E. Garrulo

unread,
Jul 15, 2021, 2:21:17 PM7/15/21
to innosetup
Is it possible to stop and roll back an installation from Pascal code in very silent mode? Even if that would require coding a custom rollback procedure.

It seems to me that after `CurStepChanged(ssInstall)`, the setup goes ahead until completion - generating an uninstaller and logging a successful installation - no matter what the Pascal code does (for example in an `AfterInstall` event).

If instead this is possible, then:
  1. can the installer undo any changes automatically?
  2. is any special handling required for installed files that have been scheduled for replacement after restart?

Thank you.

Gavin Lambert

unread,
Jul 15, 2021, 6:25:27 PM7/15/21
to inno...@googlegroups.com
On 16/07/2021 6:21 am, E. Garrulo wrote:
> Is it possible to stop and roll back an installation from Pascal code in
> very silent mode? Even if that would require coding a custom rollback
> procedure.
>
> It seems to me that after `CurStepChanged(ssInstall)`, the setup goes
> ahead until completion - generating an uninstaller and logging a
> successful installation - no matter what the Pascal code does (for
> example in an `AfterInstall` event).

The simplest option is to put your code into a PrepareToInstall handler
instead.

This happens before [Files] are extracted, but you can strategically
ExtractTemporaryFile(s) as needed.

E. Garrulo

unread,
Jul 15, 2021, 6:50:46 PM7/15/21
to innosetup
Isn't `PrepareToInstall` called before installing files?
Reply all
Reply to author
Forward
0 new messages