Above you see the thing I'm really missing from NSIS. I know I could do it with a little *hard* coding (at least for me), but it would be much better if I could use this function like this:
IfFileInUse file_to_check_for jump_if_inuse [jump_otherwise]
Just like the IfFileExists function. Actually the two function should be combined. I imagine the code (the *real* code like this):
Sorry, but since I only know Delphi Pascal my imagination can't do better either 😉function IfFileInUse(F: PChar): Boolean;
begin
Result := False; //Initial result
if FileExists(F) then //Check if file exists, and if so, then check whether it's in use
Result := CreateFile(F, GENERIC_WRITE, 0, nil, OPEN_EXISTING, 0, 0) = INVALID_HANDLE_VALUE;
end;
Best regards,
gLes