Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to compare exe file versions via agetfileversion()
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01034790
Message ID:
01034800
Vues:
14
>Hi All,
>in my app i've a 'check for updates' section and i am downloading new exe file from ftp server to the newversion folder. after this i want to compare default .exe file between newversion folders exe. and if user confirm the update i'll copy newest exe file to the current dir.
>
>How can i do this via agetfileversion() or another method ?
>
>TIA

Hi Soykan,

first thing that comes to my mind:
lcNewExeFile = NewVersionFolder+"YourExe.EXE"
lcOldExeFile = SYS(16,1)

aGetFileVersion(aNewFile, m.lcNewExeFile)
aGetFileVersion(aOldFile, m.lcOldExeFile)

IF aNewFile[4] > aOldFile[4]
**   do copy here
ENDIF
But I'll do that different way (I am not saying that this is the best way), instead download whole EXE because it is too big, in FTP server i'll put some small TXT file with just version of EXE there, then I download this file read it and coppare with the EXE that is on the local computer. Something like that (after you download the file)
lcNewExeFileVersionFile = NewVersionFolder+"YourExeVersioTXTFile.TXT"
lcOldExeFile = SYS(16,1)

aNewVersion = FILETOSTR(lcNewExeFileVersionFile)
aNewVersion = CHRTRAN(aNewVersion, CHRTRAN(aNewVersion,"01234567890.",""),"") && Remove all unneccesasary chars
aGetFileVersion(aOldFile, m.lcOldExeFile)

IF m.aNewVersion > aOldFile[4]
**   do copy here
ENDIF
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform