Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

exe creation time on Title bar 1

Status
Not open for further replies.

coldan

Programmer
Oct 19, 2008
98
AU
I am currently putting the app name and version on the title bar - as one does.

<snip>

Agetfileversion(xinfo,lcExe)
swversion = Alltrim(xinfo[10]) + " ver. " + Alltrim(xinfo[11])+ ' '

</snip>

I want to add the time the exe was created.

Can anyone help with this plesae?

Colin
 
Hi,

try making use of ftime('myProject.pjx') and store that info in your application when building, would advise you make a project_hook for this and the applicationname and -version as well.

Regards,

Jockey2
 
how about ftime of the exe itself, don't make it too complicated.

Bye, Olaf.
 
Code:
FTIME(SYS(16))

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
This was an answer by Dragan Nedeljkovich on this question in another forum

------------------------------------
During the build you can set several properties of the project. Something like this

Code:
Modify Project my Noshow Nowait
loPjx=_vfp.Projects("my.pjx")
lcExe=Fullpath("my.exe")
Erase (lcExe)
With loPjx
	.VersionNumber=This.Version13    && first three segments of the version
	.VersionComments="My big exe, built on "+Ttoc(Datetime())
	.VersionCopyright="My  cut-copy-paste-left-right 1804-"+Transform(Year(Gomonth(Date(),6)))
	.versionlanguage="BrokenEnglish"
	.VersionDescription="Four part version "+This.VersionAll4
	.BUILD(lcExe,3,.T., .T.)
	.Close()
Endwith
This is, of course, a part of a class that I have, and the .version* properties contain the xx.xx.xxx.xxxx string with the full version number, or parts of it. VFP's project manager provides only three part numbers; for fourth you need tricks (probably can find them somewhere on Anatoliy's site), or you can use these string properties. Some of these are visible in the rightclick file property dialog, some on file's tooltip - easy enough to check. Most of these properties can be retrieved programmatically via aGetFileVersion(), so you actually have a safe channel of communication between your build process and your on-the-spot checking the exe. The datetime being unstable at the filesystem level, you can use any of these to insert your version number, timestamp or whatever you want into one of these strings.
 
In my experince the filetime isn't instable, it's staying the same when putting a file into a zip archive or into a setup. You can use things like foxtgouch to alter the filetime, true. But an embedded info isn't save to changes too- If the real question is about a kind of proof about what version an exe is, use a hash signature of the file. That way you not only have a version check but also a check against any manipulation.

Bye, Olaf.
 
I don't remember where I found this snippet but it does work well.

Code:
*:******************************************************************************
*:   getcodever
* Program....: GET_CODEVER.PRG
LPARAMETERS p_cCodefile
DIMENSION l_aReturn[9]
LOCAL l_nReturn,cAppPath, lcReturn
cAppPath=IIF(AT('\',p_cCodefile)#0,p_cCodefile,ADDBS(justpath(SYS(16,0)))+p_cCodefile)
l_nReturn = AGETFILEVERSION(l_aReturn, cAppPath)
lcReturn = 'Unknown Version Info'
DO CASE
CASE l_nReturn#0  && good request
  lcReturn = l_aReturn[4] && version Info
CASE FILE(cAppPath)
    =ADIR(appinfo,cAppPath)
    IF TYPE('appinfo(3)')='D'
      lcReturn = SUBSTR(DTOS(appinfo(3)),4,1)+'.'+ALLTRIM(STR(VAL(SUBSTR(DTOS(appinfo(3)),5,4))))+' EXE date'
    ENDIF
ENDCASE && l_nReturn = 0  && good request
RETURN lcReturn


Andy Snyder
SnyAc Software Services Hyperware Inc. a division of AmTech Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top