Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Version info not retained in EXE
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows NT
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01606128
Message ID:
01606142
Views:
56
Hi,

what is the code you use to retrieve this information? And also the latest update date+time are they blank?

Regards,

Koen


>Hi Hank,
>
>Thanks for your reply.
>The problem I am having is not getting the version info from the EXE but rather that the version info in the VFP project is not retained in the EXE. Looking at the file properties in Windows Explorer shows the version info is blank. This is a problem when installing updates where the file should only be installed if it is a newer version than what is already on the user's system.
>
>
>>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:
>>
>>
>>** ... snippit
>>IF EMPTY(lcRet)
>>	*** we may be against the WinAPI bug that seems to crop up unexpectedly, so try WMI
>>	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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform