It is very time-consuming to add check for files in use manually. Would it be possible to get this as built-in functionality?

At least I would like a function to check if any of the files that setup is ready to install are in use. The way it is now I have to check for every specific file that will be updated.

Folder check is not an option, since there might be files that are not updated in this installation, and having to unnecessary close an application just annoys the user. In our case we also have a critical service running that we will not close unless absolutely needed.