Page 1 of 1
Link-date/time
Posted: Mon Oct 06, 2008 10:33 am
by Marc Vanzegbroeck
Hello,
Is there a possibility to retrieve the date/time of the exe when it was created. I know I can retrieve the date of a file with the lfndirectory() function, but I was wondering if there is an internal function to retrieve this.
Thanks,
Marc
Posted: Mon Oct 06, 2008 12:57 pm
by Rick Lipkin
Mark
I use directory() .. you will have to look at the documentation to see what element represents the time ..
Code: Select all | Expand
//-- get date stamp on .exe //
cFILE := GetModuleFileName( GetInstance() )
aDIR := DIRECTORY( cFILE )
dEXE := aDIR[1] [3]
Posted: Mon Oct 06, 2008 5:21 pm
by Marc Vanzegbroeck
Rick,
That's how I also do it now, but I was wondering if there was other function because sometime Windows change the Date/time after copying the file...
Marc
Posted: Mon Oct 06, 2008 6:54 pm
by Antonio Linares
Marc,
I was recently reviewing how to set a build number into the EXE, in an automatic way.
You could use a FILEVERSION resource information (please review FWH\samples\FileVer.prg). There you could write down the date and time of the build.
Another interesting way is to call a batch file that creates a file with the date and time and such file is included from the main RC file (#include ... ) so you can retrieve them at runtime using LoadString(). Please review fwh\samples\TestStr3.prg
Posted: Mon Oct 06, 2008 8:34 pm
by Marc Vanzegbroeck
Thanks Antonio,
That's a good solution. I already do something like that to create a setup-file for INNOSETUP.
Regards,
Marc