Hi Carl,
agetfileversion() sometimes doesn't work for some exe's, cause undetermined. So when I get back an empty result from that, I resort to WMI:
IF EMPTY(lcRet)
loWMISvc = GETOBJECT("winmgmts:\\localhost\root\cimv2")
loFileCollection = loWMISvc.ExecQuery("select * from CIM_Datafile where Name = '" + STRTRAN(tcPathedFile,"\","\\") + "'")
IF loFileCollection.COUNT = 1
FOR EACH loFileObj IN loFileCollection
lcRet = loFileObj.VERSION
ENDFOR
ENDIF
STORE NULL TO loFileObj,loFileCollection,loWMISvc
ENDIF
hth,
Hank
>Hi Tamar,
>
>I'm using the Visual MaxFrame framework which has a project hook but there's nothing in it that is stripping out the version info. Just a few minutes ago, the version info finally stuck. I made a backup copy of the EXE and compiled again with no changes and the version info was not retained in the EXE. 4 more attempts after that - version info not retained. Every once in a while it sticks but most of the time it does not.
>
>I'm doing the same thing I always did with VFP6 and never saw this with VFP6. Even if I could find out how to add the version info afterwards (if that's possible), I can get by.
>
>
>>>Hi All,
>>>
>>>I have recently updated a VFP6 app to VFP9 and now the version info is not being stored consistently in the EXE file. Sometimes it does but usually it does not.
>>>The File Description, File Version, Product Name, Product Version, Copyright and Language are all blank even though they are defined in the project.
>>>
>>>Is there anything I can do to ensure that this info is retained or is there a way to assign these file attributes after compilation in cases where they are blank?
>>
>>Are you sure you're not doing something (maybe in a projecthook) that clears this info? I've never had a problem having it stick in VFP 9.
>>
>>Tamar