Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Update exe on local machines
Message
From
27/12/2002 22:22:03
Michael Ouellette
Australian Technical Services (VIC) Pty
Australia
 
 
To
27/12/2002 12:03:30
General information
Forum:
Visual FoxPro
Category:
Installation, Setup and Configuration
Miscellaneous
Thread ID:
00736113
Message ID:
00736246
Views:
15
Try this:
I just throw a new renamed exe on the server and run from the server
you could just compare dates with the server version, copy it
and run it.


* Abstract...: Checks for newer versions of an exe and runs it!

If right(justfname(sys(16)),3)='EXE'
ex=ADIR(executables,'*.exe') && change *.exe to stub name
* 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 executable' 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