Our installation process includes a Windows Service which is installed if our software is configured to be installed as a server (vs. a client installation). I added a service l
There is currently no direct way to exclude a file from checking if it's in use. You can disable this control globally (by setting CloseApplications directive value to no
), which I wouldn't recommend. Or you can set a filter for files, which will be checked (in the CloseApplicationsFilter directive), which for you might require e.g. to list all the files except your service executable, which is hard to maintain.
You may also list all the files to be checked by specifying a filter which won't match any of your files and adding them from the RegisterExtraCloseApplicationsResources event method is the same as doing this from the mentioned directive.
What I would suggest is to stop your service from the PrepareToInstall event method. Its reference explicitly suggests this (emphasized by me):
You can use this event function to detect and install missing prerequisites and/or to shutdown any application which is about to be updated.
This event method is executed before all the file in use checks are performed and allows you to say that you need a system restart for cases when stopping of your service fails for some reason. If you wouldn't require restart, you may just return a string with some sensible message what happened to the user.
For your script it would just mean to move the code from your BeforeServiceInstall
procedure to the PrepareToInstall event method and remove the BeforeInstall
parameter from the entry.