Need a file in PrepareToInstall

28 views
Skip to first unread message

Otomatic

unread,
Mar 1, 2026, 9:55:43 AM (9 days ago) Mar 1
to innosetup
Hi,

In Files section:
Source: "ServMan.exe"; DestDir: "{app}"; Flags: ignoreversion deleteafterinstall

However, I need this file in the PrepareToInstall function, and it seems that Files is executed after PrepareToInstall.

What should I do?

Thank you.

Martijn Laan

unread,
Mar 1, 2026, 10:12:05 AM (9 days ago) Mar 1
to innosetup
Hi,

Op 1-3-2026 om 15:55 schreef Otomatic:
Source: "ServMan.exe"; DestDir: "{app}"; Flags: ignoreversion deleteafterinstall

However, I need this file in the PrepareToInstall function, and it seems that Files is executed after PrepareToInstall.


Move the entry to the top of the [Files] section and change it to:

Source: "ServMan.exe"; DestDir: "{tmp}"; Flags: dontcopy noencryption

Then, In PrepareToInstall use ExtractTemporaryFile to extract it.

Afterwards you can use  ExpandConstant('{tmp}\ServMan.exe'); to get the full file name.

Also see example script CodePrepareToInstall.iss.

Greetings,
Martijn

Otomatic

unread,
Mar 1, 2026, 10:50:26 AM (9 days ago) Mar 1
to innosetup
Super-fast response, even on a Sunday!
Thank you.
Reply all
Reply to author
Forward
0 new messages