PRODUCTVERSION in string?

Started by Igor, September 25, 2006, 04:30:45 PM

Previous topic - Next topic

Igor

How can i insert some items from PRODUCTVERSION structure in strings? I need it for aboutbox?

for example:
var_blabla db "I'm a string version: ", PRODUCTVERSION.version, ". Some other info...", 0

trodon

hi igor, you dont need to make code for this, just add new statistic and in propertis panel as caption enter what you want  :U

P1

Igor,

Welcome Aboard        :U

The forum 'Search' and your favorite seach engine will answer many questions before we can and save you time.    :dance:

Use GetFileVersionInfo, if you are interested in specific data for your about box.

But the flip side to this is, it should be know at assembly time as well.

Regards,  P1  :8)

KetilO

Hi Igor

You could have a look at RadASM's AddinMana sources.
The GetInfo proc extracts some info from the versioninfo.

KetilO

Igor

OK thanks for your replys.

@P1
I tried forum search but i could not find anything...

Shantanu Gadgil

To Igor,
Is it working?

I think what trodon is saying is, keep a static contol in the About box and just set it in the code.

This I think can be done by either having a predefined version/build number, etc or by using GetFileVersionInfo on the EXE itself. (I have not checked this, but should work) :)

Cheers,
Shantanu

To ret is human, to jmp divine!

Igor

I guess I will have to use GetFileVersionInfo, but it would involve some unnecessary code because what I really need is to join product version string in some other string at assembly time and not at runtime. Why I need this to be done in this way, it's because I have Version Updating turned on in RadASM and I need my aboutbox to reflect version changes automatically.

@trodon
I don't know what is statistic, did you meant static? If I'm not mistaken you suggested that I should just manually fill in caption of static control, that is not what I need.

@KetilO
Is GetInfo proc something like GetFileVersionInfo that P1 mentioned? I'll try to find AddinMana source and take a look.

P.S.
I don't have internet at home (where I'm programming in masm) so I can't test right away, things that you suggest. That is way I was so stingy with information in my last post, sorry about that.

trodon

Quote@trodon
I don't know what is statistic, did you meant static? If I'm not mistaken you suggested that I should just manually fill in caption of static control, that is not what I need.

yes, i was meen that, this is easy solution  :wink

PBrennick

Igor,
An important note.  you will probably not know the size of the buffer you need to create when calling GetFileVersionInfo so use MAX_PATH.  If you specify to small a buffer, GetFileVersionInfo will just truncate the information to fit your buffer and not tell you that there was a problem.

Oh, and GetInfo must be a radasm macro or addin so it probably also calls GetFileVersionInfo, so the same warning applies here also unless Ketilo says differently.

Paul
The GeneSys Project is available from:
The Repository or My crappy website

drizz

Quote from: PBrennick on September 28, 2006, 06:31:03 PM
An important note.  you will probably not know the size of the buffer you need to create when calling GetFileVersionInfo so use MAX_PATH.  If you specify to small a buffer, GetFileVersionInfo will just truncate the information to fit your buffer and not tell you that there was a problem.
GetFileVersionInfoSize

Igor, heres portion of code from one of my programs, hope it helps

:::
invoke GetFileVersionInfoSize,addr tmpi.szExePath,addr dwHandle
mov ebx,eax
.if eax
invoke GetMem,ebx
mov edi,eax
invoke GetFileVersionInfo,addr tmpi.szExePath,dwHandle,ebx,edi
mov pLen,ebx
invoke VerQueryValue,edi,T('\VarFileInfo\Translation\'),addr pBuf,addr pLen
invoke strcpy,addr tbuf,T('\StringFileInfo\')
invoke strlen,addr tbuf
mov edx,pBuf
lea eax,tbuf[eax]
mov edx,[edx]
rol edx,16
invoke DwToHex,edx,eax
;-
invoke strcpy,addr tbuf2,addr tbuf
invoke strcat,addr tbuf2,T('\FileDescription\')
invoke VerQueryValue,edi,addr tbuf2,addr pBuf,addr pLen
invoke AddLinef,T('FileDescription: %s'),pBuf
;-
invoke strcpy,addr tbuf2,addr tbuf
invoke strcat,addr tbuf2,T('\FileVersion\')
invoke VerQueryValue,edi,addr tbuf2,addr pBuf,addr pLen
invoke AddLinef,T('FileVersion: %s'),pBuf
;-
invoke strcpy,addr tbuf2,addr tbuf
invoke strcat,addr tbuf2,T('\LegalCopyright\')
invoke VerQueryValue,edi,addr tbuf2,addr pBuf,addr pLen
invoke AddLinef,T('LegalCopyright: %s'),pBuf
;-
invoke FreeMem,edi
.endif
:::

The truth cannot be learned ... it can only be recognized.

P1

Quote from: drizz on September 28, 2006, 10:27:43 PMIgor, heres portion of code from one of my programs, hope it helps
drizz, please help him with letting him know which support files to include.  Plus the T macro with AddLinef too.

Regards,  P1  :8)

PBrennick

drizz,
He will also need the data specifications for plen, tbuf, pbuf and tbuf2.  I think I got them all.

Paul
The GeneSys Project is available from:
The Repository or My crappy website

drizz

of course. i wrapped it up in this project, no dependencies.

[attachment deleted by admin]
The truth cannot be learned ... it can only be recognized.

PBrennick

drizz,
You did not include the RES folder in your zip so verinfdlg.res is missing.

Paul
The GeneSys Project is available from:
The Repository or My crappy website

drizz

Quote from: PBrennick on September 29, 2006, 02:36:43 PM
drizz,
You did not include the RES folder in your zip so verinfdlg.res is missing.

Hi Paul, are you 100% certain? i've downl. it again, made separate radasm config. on my drive E:
to recheck the project and it builds ok..., and all is fine. ::)

?!?
The truth cannot be learned ... it can only be recognized.