Skip to content
⌘ NSIS Forum Archive

How to get an EXE version?

4 posts

habin#

How to get an EXE version?

I want to add version info from NSIS script,how to get an executable file version?
CancerFace#
NSIS manual E.1.8 GetFileVersion:
Get version information from executable file.
Syntax:

${GetFileVersion} "[Executable]" $var
"[Executable]" ; Executable file (*.exe *.dll ...)
$var ; Result: Version number
Note:
- Error flag if file doesn't exist
- Error flag if file doesn't contain version information

Example:

Section
${GetFileVersion} "C:\ftp\program.exe" $R0
; $R0="1.1.0.12"
SectionEnd
CF
Afrow UK#
If you wish to put the version from that executable into your NSIS installer, you need to create another installer which does it for you.

This page does exactly that:


-Stu