Link-date/time

Link-date/time

Postby Marc Vanzegbroeck » Mon Oct 06, 2008 10:33 am

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

Postby Rick Lipkin » Mon Oct 06, 2008 12:57 pm

Mark

I use directory() .. you will have to look at the documentation to see what element represents the time ..

Code: Select all  Expand view
//-- get date stamp on .exe //

cFILE := GetModuleFileName( GetInstance() )
aDIR  := DIRECTORY( cFILE )
dEXE  := aDIR[1] [3]
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Postby Marc Vanzegbroeck » Mon Oct 06, 2008 5:21 pm

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

Postby Antonio Linares » Mon Oct 06, 2008 6:54 pm

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
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Marc Vanzegbroeck » Mon Oct 06, 2008 8:34 pm

Thanks Antonio,

That's a good solution. I already do something like that to create a setup-file for INNOSETUP.

Regards,
Marc
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 59 guests