Checking if the file to replace is currently in use

201 views
Skip to first unread message

Andrzej Miechowicz

unread,
Mar 9, 2021, 6:46:17 AM3/9/21
to innosetup
Hi, 

I use idp.iss module (FindModule function) to check, if the files to replace are currently in use. It uses IssProc.dll library.

Some of users notify the error "Cannot Import dll [...] IssProc.dll"
The solution is described in the article (dll should be loaded with a delay): 

So I added clause delayload:

[Code]
function IssFindModule(hWnd: Integer; Modulename: PAnsiChar; Language: PAnsiChar; Silent: Boolean; CanIgnore: Boolean ): Integer;
   external 'IssFindModule@files:IssProc.dll stdcall delayload';

But after this change another group of users notify the error: 

Runtime error (at 141:625).
Could not call proc. 

How do you check, if the programs (.exe and .dll) are in use?
Do you use another solutions? 
Maybe I should call or load it another way?



Martijn Laan

unread,
Mar 9, 2021, 6:55:29 AM3/9/21
to inno...@googlegroups.com
Hi,

> Op 9 mrt. 2021 om 12:46 heeft Andrzej Miechowicz <andrzejm...@gmail.com> het volgende geschreven:
>
> How do you check, if the programs (.exe and .dll) are in use?

It does this automatically by default, using Windows RestartManager. See https://jrsoftware.org/ishelp/index.php?topic=setup_closeapplications

Greetings,
Martijn

Andrzej Miechowicz

unread,
Mar 11, 2021, 7:49:56 PM3/11/21
to innosetup
Thank you Martijn! 
It was exactly what I was looking for!

Reply all
Reply to author
Forward
0 new messages