String manipulation outside of sections or functions ?
Working with NSIS 2.21, I am trying to inject the FileVersion into the generated installer.
If I add code like this
<code>
!ifndef CHANGELIST
!define CHANGELIST 0 ; expect string like 98765
!endif
!ifndef FILEVERSIONDOT
!define FILEVERSIONDOT 0.0.0.0 ; expect string like 9.87.65
!endif
!ifndef FILEVERSIONCOMMA
!define FILEVERSIONCOMMA 0,0,0,0 ; expect string like 9,87,65
!endif
VIProductVersion "${FILEVERSIONDOT}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "MauiInstallExamples${PLT}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "Comments" "CHANGELIST ${CHANGELIST}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "LeCroy Corp"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${FILEVERSIONCOMMA}"
</code>
early on in my .nsi script, before any section or function,
it does what I want, provided that I generate strings FILEVERSIONCOMMA and FILEVERSIONDOT from CHANGELIST number with some external program, and that I inject them into the .nsi script with "/D<string>" arguments to makensis.
Questions : could I generate strings FILEVERSIONCOMMA and FILEVERSIONDOT in my .nsi script, and how?
My understanding is that VIProductVersion and VIAddVersionKey can only be used outside sections and functions, and that commands like IntOp and StrCpy can not be used outside sections and functions.
TIA
Rudif