Run [Code] after install but before RestartApplications

32 views
Skip to first unread message

David F.

unread,
Nov 28, 2021, 12:27:49 PM11/28/21
to innosetup
Hello,

How would I trigger a [code] procedure to run just after the install but before the restart manager will restart applications?   It appears ssPostInstall is too late and ssInstall is too early.

Gavin Lambert

unread,
Nov 28, 2021, 6:16:57 PM11/28/21
to inno...@googlegroups.com
Use BeforeInstall/AfterInstall on a (non-postinstall) [Run] entry.

David F.

unread,
Nov 28, 2021, 8:22:41 PM11/28/21
to innosetup
I was looking at [Run] section but didn't see a way to only run a code section, it wanted a filename.

Gavin Lambert

unread,
Nov 28, 2021, 9:33:13 PM11/28/21
to inno...@googlegroups.com
On 29/11/2021 14:22, David F. wrote:
> I was looking at [Run] section but didn't see a way to only run a code
> section, it wanted a filename.

Yes, you do need to give it something to run, but it could be some sort
of no-op, such as "{cmd} /c ver", if you don't currently have any [Run]
entries.

Another option might be to add an AfterInstall to your last [Files] or
[Registry] entry, but the timing of that is slightly different, and you
still might need to add a dummy entry to work around conditions on your
existing entries.

David F.

unread,
Nov 28, 2021, 10:28:01 PM11/28/21
to innosetup
Okay, I'll just add a check: myfunction; that always returns false but does what it needs to.

Gavin Lambert

unread,
Nov 28, 2021, 11:05:11 PM11/28/21
to inno...@googlegroups.com
On 29/11/2021 16:28, David F. wrote:
> Okay, I'll just add a check: myfunction; that always returns false but
> does what it needs to.

No, that's not at all what I was suggesting. Don't do that.

Jernej Simončič

unread,
Nov 29, 2021, 2:53:53 AM11/29/21
to David F. on [innosetup]

On Monday, November 29, 2021, 04:28:01, David F. wrote:


Okay, I'll just add a check: myfunction; that always returns false but does what it needs to.
Don't – check functions can run at any time (and often run before the install phase starts).


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


Build a system that any fool can use and only a fool will use it.
       -- Fifth Rule on Fools
Reply all
Reply to author
Forward
0 new messages