I have two programs running. Program1.exe and Program2.exe.
Program1 is written in C# .Net4.8 and is used to upload/download transaction from the web, check for updates and handle various other tasks that Program2 cannot.
Program2 is written in VB6. Yeah, VB6... It's set for a rewrite but we aren't at that stage yet due to it's complexities. It is more of a use interface application.
When Program1 checks for updates and determines if there is one available. When Program2 shuts down, Program1 need to prompt the users that there is an update available and attempt to install it.
My issue is, how do I determine that Program2 has shut down to immediately prompt the user before they shut down the computer. I was thinking that Program2 creates a flag file and I watch for it with a filewatcher or I can put up a timer that checks if Program2 is running. I'm assuming I'll have to put the timer on 1 second intervals to catch it correctly.
Which is more efficient or is there a better way to handle this?
Any suggestions would be greatly appreciated.