Using GetDLLVersion to set $APPVERSION
I would like to set the $APPVERSION by getting the version from the main program build version.
I have got the following at the top of my Nsis script file:
; define root variable relative to installer
!define PATH_ROOT "..\..\..\"
GetDLLVersionLocal "${PATH_ROOT}ReleasePNG\ttd.exe" $R0 $R1
IntOp $R2 $R0 / 0x00010000 ; $R2 now contains major version
IntOp $R3 $R0 & 0x0000FFFF ; $R3 now contains minor version
IntOp $R4 $R1 / 0x00010000 ; $R4 now contains release
IntOp $R5 $R1 & 0x0000FFFF ; $R5 now contains build
StrCpy $0 "$R2.$R3.$R4.$R5" ; $0 now contains string like "1.2.0.192"
!define APPVERSION "${0}"
!define APPNAMEANDVERSION "${APPNAME} ${APPVERSION}"
But it gives me the following error:
Error: command GetDLLVersionLocal not valid outside section or functionI am getting this because it is not in a section? If so is there a way around this?
Error in script "C:\cygwin\home\Luca Spiller\ottd\trunk\os\win32\installer\install.nsi" on line 7 -- aborting creation process
Thanks,
Luca Spiller