@hobo-sapiens
There isn’t a way in Windows 7 or Windows 10 to intercept a pending sleep state to run code before entering sleep mode. You can configure a scheduled task to run on the detection of a sleep event but the action to perform (Veyon update) happens not prior to entering a sleep state but actually occurs immediately after the computer wakes. So there could be a significant time delay between when the update is queued and when the update is actually performed.
I’ve not attempted to update Veyon with the master open but once the master computer exits sleep mode veyon-master.exe would likely still be in memory so it might be necessary to end the process. You could do this by the scheduled task I mentioned or as part of another update procedure.
The command would be:
"C:\Windows\System32\taskkill.exe" /f /im veyon-master.exe
Or remotely,
"C:\Windows\System32\taskkill.exe" /S computername /f /im veyon-master.exe