Sergey, I'm refactoring this today and I wonder if you could give me your opinion on something.
In the psuedocode scenario below, I'm concerned about the timing, when the Main.exe automatically closes upon receiving an update file from the server, and the Loader.exe fires up again and tries to call the Main.exe. I suppose it'd be best to put a loop in the loader that checks to see if the main.exe is open and waits a certain time for it to close. Do you see any problems with doing it this way?
Thanks,
-m@
[Loader.exe ]
If Update File Exists
rename main.exe to main.old
rename main.updt to main.exe
endif
ShellExec("main.exe")
Loade.exe exits
[Main.exe]
An updt file is received from the server
Prompt user about restart, wait 10 seconds or for user to click OK.
ShellExec("Loader.exe")
QUIT is issued
main.exe closes