CurPageChanged(wpPreparing) event in Inno Setup 6.5

64 views
Skip to first unread message

mpri...@gmail.com

unread,
Oct 7, 2025, 6:43:54 AM (7 days ago) Oct 7
to innosetup
Hello,

Inno Setup 6.5 has this change:
  • Fix: Event function CurPageChanged is now always only triggered when the current page actually changes. Before it was called twice in a row for wpPreparing when the script had a PrepareToInstall event function which returned a non empty string to instruct Setup to stop.
But it seems that is has side effects:
  • In /SILENT mode, CurPageChanged(wpPreparing) is now never triggered (note that it was called twice even in the silent mode before 6.5)
  • Imo before, the second trigger was the right one. Because at that moment the page was set up completely. Particularly the PreparingMemo was populated already. While currently only the first of the previous two trigger is invoked. But at that moment the page is not setup completely yet.
Thanks in advance for looking into this.

Martin

Martijn Laan

unread,
Oct 7, 2025, 6:48:49 AM (7 days ago) Oct 7
to innosetup
Hi Martin,

Thanks for reporting, I will investigate.

Greetings,
Martijn

Op 7-10-2025 om 12:43 schreef mpri...@gmail.com:
--
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/bbf9ecfa-ddf2-4293-9c10-ac51011a7ba2n%40googlegroups.com.

mpri...@gmail.com

unread,
Oct 7, 2025, 7:27:55 AM (7 days ago) Oct 7
to innosetup
Thanks.
Also please note that my script does not have  PrepareToInstall , yet CurPageChanged used to be called twice. So it looks like the fixed problem description is not accurate.

Martijn Laan

unread,
Oct 7, 2025, 7:51:47 AM (7 days ago) Oct 7
to innosetup
Thanks for the extra info. Why are you expecting the CurPageChanged to be called if you have no PrepareToInstall? Do you mean when some files are in use?

Do you have a reproduction script illustrating the issue?

Greetings,
Martijn

Op 7-10-2025 om 13:27 schreef mpri...@gmail.com:

mpri...@gmail.com

unread,
Oct 8, 2025, 8:16:26 AM (6 days ago) Oct 8
to innosetup
I'm sorry, I cannot reproduce the /SILENT issue anymore. Maybe it was a false alarm.

Though the second issue is still a problem for me. Yes, it's when some files are in use.

I do not think you need any special script to reproduce that.
Anything simple as this will do:

[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={autopf}\My Program
PrivilegesRequired=lowest

[Files]
Source: "MyProg.exe"; DestDir: "{app}"; Flags: restartreplace

[Code]

procedure CurPageChanged(CurPageID: Integer);
begin
  if CurPageID = wpPreparing then
    Log('wpPreparing - ' + WizardForm.PreparingMemo.Text);
end;


If MyProg.exe is locked (running) while running the installer, in log you will see:

2025-10-08 14:09:13.472   wpPreparing - PreparingMemo

Expected is MyProg.exe instead of  PreparingMemo.

Thanks.

Martijn Laan

unread,
Oct 10, 2025, 5:27:08 AM (4 days ago) Oct 10
to innosetup
Hi Martin,

Thanks for the script, looked into it and I believe reverting the change is the best approach for now. However, I would appreciate it if you could clarify why this is a problem for you. Specifically, I do not understand why you need to access WizardForm.PreparingMemo.Text when a file is in use and what your goal is.

Is there an alternative I could provide so that you no longer need to rely on this kind of code, which depends on undocumented functionality?

Greetings,
Martijn
 
Op 8-10-2025 om 14:16 schreef mpri...@gmail.com:

Martin Prikryl

unread,
Oct 11, 2025, 9:11:37 AM (3 days ago) Oct 11
to 'Martijn Laan' via innosetup

Hello Martijn,

Thanks for looking into it.

In general, I have an impression that the point of CurPageChanged even function is to have a chance to modify the page just before it's shown to the user. To server that purpose, the page should be modified by Inno Setup before the CurPageChanged, not after. 

But to explain how I use it. My installer is installing a single shell extension DLL. I prefer not to bother the user with Windows Explorer restart (let only computer restart) on each upgrade. So in CurPageChanged(wpPreparing) I'm checking, what version of extension is installed currently – and if that version is still compatible with new version of the application and the extension update is not critical, I'm silently deferring its replacement to the next computer restart (by checking PreparingNoRadio and clicking NextButton, and later checking NoRadio). If the restart is needed immediately, I'm updating the too generic "Preparing" page to better explain to the user what it is about.

As the "Preparing" page is also used for the "installation/removal was not completed" scenario, I'm detecting that by checking PreparingMemo.Visible (what is rather hackish).

After the recent change, PreparingMemo.Visible is not set and my modifications of page are reset after the CurPageChanged.

Thanks.

Martin

You received this message because you are subscribed to a topic in the Google Groups "innosetup" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/innosetup/WGhOaOuMO4M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to innosetup+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/innosetup/176008842308.8.12969770521347385074.946581585%40innosetup.nl.

Martijn Laan

unread,
Oct 11, 2025, 9:50:10 AM (3 days ago) Oct 11
to 'Martijn Laan' via innosetup
Hi,

Thanks for the explanation.

I would recommend trying this instead:
  • Set [Setup] section directive CloseApplicationsFilterExcludes to the name of the DLL. This excludes it from Restart Manager checks by default.
  • Then call RegisterExtraCloseApplicationsResource from inside [Code] event function RegisterExtraCloseApplicationsResources to readd it if your check says it really must be updated.

This would avoid having to click things programmatically?

So something like this (untested)

[Setup]  
CloseApplicationsFilterExcludes=MyExtension.dll
[Code]
procedure RegisterExtraCloseApplicationsResources;  
var  
  FileName: String;  
begin  
  FileName := ExpandConstant('{app}\MyExtension.dll');  
  if CheckIfDllUpdateIsRequired(FileName) then  
    RegisterExtraCloseApplicationsResource(False, FileName);  
end;

Greetings,
Martijn


Op 11-10-2025 om 15:10 schreef 'Martin Prikryl' via innosetup:

mpri...@gmail.com

unread,
Oct 13, 2025, 1:58:23 PM (yesterday) Oct 13
to innosetup
Thanks. But if the  CheckIfDllUpdateIsRequired  is False, and the DLL is locked, the installer will error. Won't it? I want it to silently postpone the replacement to the next computer restart.

Martijn Laan

unread,
Oct 13, 2025, 3:08:52 PM (yesterday) Oct 13
to innosetup
It shouldn't error if you use the restartreplace flag on it. 

Greetings,
Martijn

-------- Original Message --------

mpri...@gmail.com

unread,
9:41 AM (6 hours ago) 9:41 AM
to innosetup
Oh, ok, I'll try that. Thanks!

And also thanks for reverting the change.

M.

Reply all
Reply to author
Forward
0 new messages