Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Upgrade a running Program (EXE)
Message
From
12/04/1998 02:02:22
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00091367
Message ID:
00091372
Views:
26
>Hi Everyone,
>
>A program(EXE) is running under Windows NT Workstation
>shell (Local Machine).
>If I want to upgrade it over the network, so that next
>time the program will replace with the new one while
>the computer is shutdown and turn on again.
>What should I do?
>
>Thank you.
>
>Charles


Here's what we do.

START.PRG
*---------------
PRIVATE ln_numfiles, la_dir, lc_updatedir, la_exefile
lc_updatedir = 'F:\UPDATE\'
ln_numfiles=ADIR(la_dir,lc_updatedir+'{program name}')
*&& is the file there?
IF ln_numfiles > 0
=ADIR(la_exefile,'{program name}'
DO CASE
*&& check date
CASE la_dir[1,3] > la_exefile[1,3]
COPY FILE (lc_updatedir+'{program name}' TO '{program name}'
*&& check size
CASE la_dir[1,2] <> la_exefile[1,2]
COPY FILE (lc_updatedir+'{program name}' TO '{program name}'
ENDCASE
ENDIF

RUN /n ('{program name}')

*---------
This checks to see if there is an update each times the program is lanched
You can even check times - but in Fox2.6 that's a little more difficult. If VFP just make the date and time into a datetime var and check that way. Then this separate program calls the main program you want to run. We do the run because that way in the other program you could change the 'Start' program.

Charles
Charles

"The code knows no master." - Chuck Mautz
"Everybody is ignorant, only on different subjects." - Will Rogers
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform