Gene,
How you launched the 2nd executable from the 1st executable may have been a cause. The VFP RUN command will block if you don't use the /N clause with it. The ShellExec API should have returned control allowing you to exit the 1st executable. There are a couple of API's that will wait for the 2nd executable to return before continuing.
The VFP RUN command the CMD window to run the 2nd executable. ShellExec will not.
HTH, Tracy
-----Original Message----- From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of Gene Wirchenko Sent: Friday, October 04, 2019 7:03 PM To: ProFox Email List Subject: VFP App Startup Program
Hello:
I have seen discussions about this at various times, but I have not ever seen details.
You have an app which might be updated and want to have that happen automatically.
In my case, it is a VFP .exe, and I wrote a program to handle that years ago.
What about if the startup program needs to be updated? Since there is a change (the first since) in that, I wanted to write a version that would update the update program, too. Somehow, it did not work. And since there is less debugging information available when debugging a .exe, I ended up giving up on it after some trouble.
My thought was to have two programs:
cbs2run.exe would check cbs2run2.exe if it needed updating (and maybe update), check cbs2.exe (the app) if it needed updating (and maybe update), then run cbs2run2.exe.
cbs2run2.exe would check cbs2run.exe if it needed updating (and maybe update), then run cbs2.exe.
The reason that I had two programs is so that cbs2run.exe would quit running and be overwritable. Even inserting a 5-second pause before trying to overwrite cbs2run.exe in cbs2run2.exe did not work. I got some very inconsistent and confusing results.
Was I overlooking something? If so, what?
Sincerely,
Gene Wirchenko
[excessive quoting removed by server]