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
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message: https://leafe.com/archives/byMID/
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Hi Gene,
normally your Starter programm just runs the main program, after checking
for updates, and then quits itself. The starter cannot update himself, thus
another program / task has to do this. The easiest way would be to first
install a new main program, which checks the starter for version, and
optionally does the update for the starter program. Thus the two can update
each other :)
wOOdy
-----Ursprüngliche Nachricht-----
Von: ProFox <profox-bounces@leafe.com> Im Auftrag von Gene Wirchenko
Gesendet: Samstag, 5. Oktober 2019 01:03
An: ProFox Email List <profox@leafe.com>
Betreff: 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]
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message: https://leafe.com/archives/byMID/002701d57ce2$72d236d0$5876a470$@wondzinski.de
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Gene,
Please study also the articles which I pointed you in Foxite.
https://www.foxite.com/archives/0000469049.htm
Regards,
Koen
Op ma 7 okt. 2019 om 09:40 schreef <juergen@wondzinski.de>:
> Hi Gene,
>
> normally your Starter programm just runs the main program, after checking
> for updates, and then quits itself. The starter cannot update himself, thus
> another program / task has to do this. The easiest way would be to first
> install a new main program, which checks the starter for version, and
> optionally does the update for the starter program. Thus the two can
> update
> each other :)
>
> wOOdy
>
>
> -----Ursprüngliche Nachricht-----
> Von: ProFox <profox-bounces@leafe.com> Im Auftrag von Gene Wirchenko
> Gesendet: Samstag, 5. Oktober 2019 01:03
> An: ProFox Email List <profox@leafe.com>
> Betreff: 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]
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message: https://leafe.com/archives/byMID/CACUu1SuJoFj7D6ArAxFyiu=N8dKZTGJjbYeDLjoJzZ7F1cQsZQ@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
+1
On 07-Oct-2019 1:10 PM, juergen@wondzinski.de wrote:
> Hi Gene,
>
> normally your Starter programm just runs the main program, after checking
> for updates, and then quits itself. The starter cannot update himself, thus
> another program / task has to do this. The easiest way would be to first
> install a new main program, which checks the starter for version, and
> optionally does the update for the starter program. Thus the two can update
> each other :)
>
> wOOdy
>
>
> -----Ursprüngliche Nachricht-----
> Von: ProFox <profox-bounces@leafe.com> Im Auftrag von Gene Wirchenko
> Gesendet: Samstag, 5. Oktober 2019 01:03
> An: ProFox Email List <profox@leafe.com>
> Betreff: 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]
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message: https://leafe.com/archives/byMID/fe0140ce-eef2-7efb-9e45-0986916e4d0c@hawthorncottage.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
At 00:40 2019-10-07, <juergen@wondzinski.de> wrote:
>Hi Gene,
>
>normally your Starter programm just runs the main program, after checking
>for updates, and then quits itself. The starter cannot update himself, thus
>another program / task has to do this. The easiest way would be to first
>install a new main program, which checks the starter for version, and
>optionally does the update for the starter program. Thus the two can update
>each other :)
Look at my original post. That is exactly what I was trying to
do with cbs2run.exe and cbs2run2.exe. But there was trouble. I do
not know if I simply missed something or it is not possible in one
execution chain.
Sincerely,
Gene Wirchenko
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message: https://leafe.com/archives/byMID/
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
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]
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message: https://leafe.com/archives/byMID/001301d57d4b$75269660$5f73c320$@powerchurch.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
At 13:11 2019-10-07, "Tracy Pearson" <tracy@powerchurch.com> wrote:
>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.
I did use run /n. It works like a charm with my one-level loader.
>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.
So how does this make a difference?
It is bothersome trying to debug this, because I can not see
what is happening. Because the loaders are .exe programs, I do not
have the benefit of the debugger, etc.
I have been wondering if having two VFP .exes running at once
is an issue. (Is there a conflict between config files?)
[snipped previous]
Sincerely,
Gene Wirchenko
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message: https://leafe.com/archives/byMID/
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Unfortunately I do not have your original code Gene (if you showed it in an
earlier email).
If you know your config files differ between your startup and your main, it
might be an issue. I'm assuming you have tried compiling the config.fpw
into the .exes to see what happens (you can include it under the 'other'
files). But I cannot vouch for the situation as my config.fpw files pretty
much the same regardless of the app.
I have not used the RUN /N, I usually use WinExec. You need to register the
function, here is a block of code I use to declare it:
*-- Declare the Win API function for running other executables
*-- The uIntCmdShow can be:
*-- SW_HIDE - 0
*-- SW_FORE_AND_MAX - 3
*-- SW_MINIMIZE - 6
*-- SW_DEFAULT - 10
*-- ....???
*-- Make sure and put a CHR(0) on the end of the parameters
*-- cExecutable = 'f2pdfgen.exe'
*-- cParameters = ' 1 2000 c:\dev\form2\data\ f2newpdf' + CHR(0)
*-- cCommandString = cExecutable + cParameters
*-- x = WinExec(cCommandString, 0)
DECLARE INTEGER WinExec IN Win32API STRING @lpszCmdLine, INTEGER uintCmdShow
Anyway, I'm not sure why you would have a problem with the updater updating
the main .exe. If the update is failing the mainexe may still be running?
But if the only way to run your main .exe is by running the updater that
should not happen. I did put a piece of code in my updater app that would
write a 'special file' - the main exe looks for the existence of that
special file and if it is not found, it immediately exits. If it does exist
it erases it and continues on its merry way.
But one thing I had to do was not try to update the updater exe. I fixed
that by not trying to update the updater .exe until I exited the main .exe
- e.g. AFTER the CLEAR EVENTS in my main .exe.
I also download my updates to a holding folder, not directly to the .exe
files. I did that partly for testing/tracing at first, but then I saw the
'copy to update' process was so fast that there was no reason to change to
direct downloads. After I saw that, doing my above process (updating the
updater only when my main .exe exited) became very easy.
So, to sum up,
- my updater downloads (or copies from a server) all needed updates into
a holding folder.
- if the main .exe was part of those updates, it copies the .exe from the
holding folder over the main .exe and then deletes the main .exe from the
holding folder (for me, the holding folder is subfolder under the main .exe
folder).
- the updater app creates a 'special file' to show that it has been
executed
- then I run the main .exe and let the updater app exit out
- in the main.exe I check for the 'special file' - if it exists, it is
erased and the .exe continues, if it does not exit, the .exe immediately
exits (do not pass GO, do not collect $200)
- then in the main .exe I have code after the CLEAR EVENTS (e.g. aka in
the ON SHUTDOWN code, or whatever) that looks to see if there is a new
'updater.exe' waiting in the holding folder. If there is, I copy that,
delete it from the holding folder, and then continue on to let the main.exe
exit.
I have never had "timing update" problems with the above. I have a feeling
the above design would work using "RUN... /N" as well.
HTH,
-Charlie
On Mon, Oct 7, 2019 at 4:49 PM Gene Wirchenko <gene@shaw.ca> wrote:
> At 13:11 2019-10-07, "Tracy Pearson" <tracy@powerchurch.com> wrote:
> >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.
>
> I did use run /n. It works like a charm with my one-level loader.
>
> >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.
>
> So how does this make a difference?
>
>
> It is bothersome trying to debug this, because I can not see
> what is happening. Because the loaders are .exe programs, I do not
> have the benefit of the debugger, etc.
>
> I have been wondering if having two VFP .exes running at once
> is an issue. (Is there a conflict between config files?)
>
> [snipped previous]
>
> Sincerely,
>
> Gene Wirchenko
>
>
[excessive quoting removed by server]
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message: https://leafe.com/archives/byMID/CAJGvLx3AsESJZm2C_aMPRZik=2vg1BCv=eND+0goMSJiOhq8Gw@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.