Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
A strange thing happend to me...
Message
De
10/02/2002 00:30:40
Max Chen
Yx Software
Shunde, Chine
 
 
À
09/02/2002 22:19:11
Calvin Smith
Wayne Reaves Computer Systems
Macon, Georgie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00617954
Message ID:
00617975
Vues:
18
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
********************************************************
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform