Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
A strange thing happend to me...
Message
From
10/02/2002 00:30:40
Max Chen
Yx Software
Shunde, China
 
 
To
09/02/2002 22:19:11
Calvin Smith
Wayne Reaves Computer Systems
Macon, Georgia, United States
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00617954
Message ID:
00617975
Views:
17
You can use a ADIR and AGetFileVersion to determine exe-file which have same product-name is the newest to LOAD, copy is not nessarry.

exe in the same directory with same product-name (or empty), i compare them with internal version,modify date and modify time.

the following is the Loader's code.
on shutdown quit
PUBLIC guTag,gcINIFile

gcINIFile=full(curdir())+'config.ini'
set proc to gProc,pProc
pvSETs()
*-
pvWorking()

**************************************************
FUNCTION pvWorking
local  cProdName,aFile(1),aFileInfo(1),cFile,nVer,cTmp

cProdName=upper(allt(gcGetINIStr(gcINIFile,'Loader','ProductName') ))
cPath=allt(gcGetINIStr(gcINIFile,'Loader','Path') )
if empty(cPath)
	cPath='.'
Endif
cPath=addbs(cPath)	
if not directory(cPath)
	messagebox("Path not found",16,'LOADER',1000*10)
	return
endif	

CREATE CURSOR csExe ( FileName c(100),Version i,ModifyDate d,ModifyTime c(10) )
For i=1 to Adir(aFile,cPath+'*.exe')
	cFile=aFile(i,1)
	AGetFileVersion(aFileInfo,cPath+cFile)
	If not cProdName==allt(upper(aFileInfo(10))) &&product name	
		loop
	endif	
	
	nVer=10^8+val( getwordnum(aFileInfo(4),1,'.') )+ ;
		  10^4+val( getwordnum(aFileInfo(4),2,'.') )+ ;
				 val( getwordnum(aFileInfo(4),3,'.') )
	append blank
	replace filename with aFile(i,1),;
			  version with nVer,;
			  ModifyDate with aFile(i,3),;
			  ModifyTime with aFile(i,4)
Next 

select * ;
	from csExe ;
	order by version desc ,ModifyDate desc,ModifyTime desc,fileName desc;
	into cursor csTmp
	
if _tally=0
	messagebox("There isn't any executable files that have a matched internal product name",;
					16,'LOADER of Yxsoft',1000*10)
	RETURN
ENDIF
	
cTmp="run /n1 "+cPath+allt(filename)
SET DEFAULT TO (cPath)
ExecScript(cTmp)

RETURN
********************************************************
Previous
Reply
Map
View

Click here to load this message in the networking platform