Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Auto Updating your programs....
Message
From
25/04/2002 19:13:30
Michael Ouellette
Australian Technical Services (VIC) Pty
Australia
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00649222
Message ID:
00649418
Views:
21
Eric:

I just drop new exe's into the app directory with the same name + a letter/number ( original exe = myprog.exe, new exe = myprog1.exe)

I put this at the beginning of my startup program. The users shortcut always points to the original exe. It checks for a later version then
quits!

OR

use a batch file that checks for an updated version then copy's it to the users PC

I use both...

* Abstract...: Checks for newer versions of an exe and runs it!
If right(justfname(sys(16)),3)='EXE'
ex=ADIR(executables,exename*.exe')
* ex=0 if no files , but then that's impossible since this file is an exe!

* sort with latest file on top
=asort(executables,3,-1,1)
* returns -1 if not sorted

* this file running..
thisexe=upper(justfname(sys(16)))
newexe=upper(executables[1])
If newexe<>thisexe
Wait window 'Running latest exe' nowait

Local lcfilename,lcworkdir,lcoperation

tcoperation=""
tcworkdir=sys(5)+sys(2003)+"\"
tcfilename= newexe

If EMPTY(tcfilename)
Return -1
Endif
lcfilename=ALLTRIM(tcfilename)
lcworkdir=IIF(TYPE("tcWorkDir")="C",ALLTRIM(tcworkdir),"")
lcoperation=IIF(TYPE("tcOperation")="C" AND NOT EMPTY(tcoperation),ALLTRIM(tcoperation),"Open")

Declare INTEGER ShellExecute ;
IN SHELL32.DLL ;
INTEGER nWinHandle,;
STRING cOperation,;
STRING cFileName,;
STRING cParameters,;
STRING cDirectory,;
INTEGER nShowWindow
=shellexecute(0,lcoperation,lcfilename,"",lcworkdir,1)
Quit
Endif
****** end check for newest version
Endif right(justfname(sys(16)),3)
Previous
Reply
Map
View

Click here to load this message in the networking platform