Link-date/time

Post Reply
Marc Vanzegbroeck
Posts: 1163
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium
Contact:

Link-date/time

Post 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
User avatar
Rick Lipkin
Posts: 2668
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Post 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]
Marc Vanzegbroeck
Posts: 1163
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium
Contact:

Post 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
User avatar
Antonio Linares
Site Admin
Posts: 42537
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 77 times
Contact:

Post 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
regards, saludos

Antonio Linares
www.fivetechsoft.com
Marc Vanzegbroeck
Posts: 1163
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium
Contact:

Post 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
Post Reply