Afrow UK
Moderator
Registered: Nov 2002
From: Shropshire, England
|
You need to compile this: code: OutFile "GetVersion.exe"
!define File "C:\MyFile.exe"
Function .onInit
GetDllVersion "${File}" $R0 $R1
IntOp $R2 $R0 / 0x00010000
IntOp $R3 $R0 & 0x0000FFFF
IntOp $R4 $R1 / 0x00010000
IntOp $R5 $R1 & 0x0000FFFF
StrCpy $R1 "$R2.$R3.$R4.$R5"
FileOpen $R0 "$EXEDIR\Version.txt" w
FileWrite $R0 '!echo "${File} version: $R1"$\r$\n!define Version "$R1"'
FileClose $R0
Abort
FunctionEnd
Section
SectionEnd
Make sure you change the path of C:\MyFile.exe to your EXE's path.
Put the output installer in the same place as your script, then put this at the top of your script:
code: !system "GetVersion.exe"
!include "Version.txt"
You will then have the ${Version} define available.
-Stu
__________________
afrowuk.co.uk
Quick Link | Report this post to a moderator | IP: Logged
|