General information
Category:
Installation, Setup and Configuration
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only