News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Retrieving the version of EXEs and DLLs

Started by Vortex, January 19, 2025, 05:26:52 AM

Previous topic - Next topic

Vortex

Here is a command line tool to get the version of the an exe\dll.

Tested on Windows 7 Sp1 :

GetFileVersion.exe C:\Windows\System32\ntdll.dll
6.1.7601.24545

NoCforMe

Here's my GUI file version display app. (Code available to those interested.)
Assembly language programming should be fun. That's why I do it.

Vortex


NoCforMe

Assembly language programming should be fun. That's why I do it.

NoCforMe

Hey, you should expand your version to show all the other interesting stuff that GetFileVersionInfo() gives you.

My source attached.
Assembly language programming should be fun. That's why I do it.

sinsi

Quotefatal error A1000:cannot open file : WhatVer_bitmaps.inc

NoCforMe

Aaargh. Sorry 'bout that; guess I didn't think anyone would actually want to download this.
Attached here. (This is my "poor man's resource file", an assembler include file that has the bitmaps as DB statements. Avoids use of the resource compiler.)
Assembly language programming should be fun. That's why I do it.

greenozon

#7
@NoCforMe
thanks for nice piece of code!

some questions raised after building it up/ using on the field:

1) Unicode file names support?  -> https://prnt.sc/XOrFOk6JHm2j

jj2007

Quote from: Vortex on January 19, 2025, 05:26:52 AMTested on Windows 7 Sp1 :

Tested on Windows 10 - works like a charm:
GetFileVersion.exe \Masm32\bin\ml.exe
14.29.30154.0

Similar but with GetFileProps:
  GetFileProps CL$() ; get the props of the file passed in the commandline
  For_ ecx=0 To FileProp$(?)-1
Print Str$("%_i  ", ecx), FilePropName$(ecx) ; show the predefined names
wPrintLine At(30) wRec$(FileProp$(ecx)) ; descriptions may be Utf8
  Next

0  Lang                      040904B0
 1  Comments                  ?
 2  InternalName              POASM
 3  ProductName               Pelles C for Windows
 4  CompanyName               Pelle Orinius
 5  LegalCopyright            Copyright © Pelle Orinius 2005-2011
 6  ProductVersion            6.50
 7  FileDescription           Pelles Macro Assembler
 8  LegalTrademarks           ?
 9  PrivateBuild              ?
10  FileVersion               6.50.0
11  OriginalFilename          POASM.EXE
12  SpecialBuild              ?
13  Lang                      041D04B0
14  Comments                  ?
15  InternalName              POASM
16  ProductName               Pelles C för Windows
17  CompanyName               Pelle Orinius
18  LegalCopyright            Copyright © Pelle Orinius 2005-2011
19  ProductVersion            6.50
20  FileDescription           Pelles makro-assemblator
21  LegalTrademarks           ?
22  PrivateBuild              ?
23  FileVersion               6.50.0
24  OriginalFilename          POASM.EXE
25  SpecialBuild              ?

No. 16 looks interesting ;-)

NoCforMe

Quote from: greenozon on January 22, 2025, 07:42:43 PM@NoCforMe
thanks for nice piece of code!

some questions raised after building it up/ using on the field:

1) Unicode file names support?  -> https://prnt.sc/XOrFOk6JHm2j


Looks like I've got some more work to do on this.
You could start with my code and add Unicode capability. (I guess you'd need to use the ___W() versions of functions here.)
Assembly language programming should be fun. That's why I do it.

greenozon

@NoCforMe
I'm reading the code of your sources
how about this small refactoring?
reading 2 goals:
1) less lines to code
2) more clear to understand as well as #3:
more ready to migrate to x64 masm (as you are omitting direct ref to eax CPU reg)

; Create brush to set background color:
   INVOKE   GetSysColor, COLOR_BTNFACE      ;Color to match dialog bkground.
   MOV   BkColor, EAX
   INVOKE   CreateSolidBrush, EAX
   MOV   BkBrush, EAX            ;Store in a global (needed for subclassed statics).


--->


   MOV   BkColor, rv(GetSysColor, COLOR_BTNFACE) ;Color to match dialog bkground.
   MOV   BkBrush, rv(CreateSolidBrush, EAX)      ;Store in a global (needed for subclassed statics).


NoCforMe

Yeah, thanks, but:
1. I don't care--at all--about 64-bit operability for my own code. I only write 32-bit code.
2. Don't like to use macros like rv(xxx) for my own code.

However, for other coders here, good suggestion.
Assembly language programming should be fun. That's why I do it.

jj2007

Quote from: NoCforMe on January 27, 2025, 08:14:11 AM2. Don't like to use macros like rv(xxx) for my own code.

You shouldn't use invoke, really :cool:

TimoVJL

May the source be with you

jj2007