Exec BeforeUpdate runs in the middle of the update

I have a update which includes a file in the temporary folder which is marked to execute 'before updating has begun' and 'wait for execution to finish before continuing' , but this sometimes seems to run in the middle of the update procedure.

The program I'm executing is a simple program that checks if a service is installed and if so, it issues a stop command and waits for the service to stop before exiting. But the wyupdate is complaining because the service is still running.

(I'm not using the built in `Update Actions` to stop and start the service because that only works if the service exists beforehand, which isn't always the case).

Are there any options that output a verbose log about what wyUpdate is doing that I could use to try and track this issue down?

Ignore this.

Totally forget that the wyUpdate source is available, so I can see what is going on.

Turns out the system is checking that all the processes are closed before it calls the PreExecute routine, so my program is running too late.

But now that I remember that the source is available, I can patch it so I can use the Update Actions to stop the service if it exists,