Added !define /intfmt

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7173 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2020-04-22 21:14:55 +00:00
parent dd117d4ba7
commit e1141d9277
6 changed files with 44 additions and 6 deletions

View file

@ -10,15 +10,17 @@ Define/conditional compilation related commands:
\S1{define} !define
\c [/ifndef | /redef] ([/date|/utcdate] gflag [value]) | (/math gflag val1 OP val2) | (/file gflag filename.txt)
\c [/ifndef | /redef] ([/date|/utcdate] gflag [value]) | (/file gflag filename.txt) | (/intfmt gflag fmtstr value) | (/math gflag val1 OP val2)
This command will add \e{gflag} to the global define list. This will have a similar effect as using the /D switch on the command line (the define only becomes effective after the !define command).
If \e{/date} or \e{/utcdate} are used, \e{value} will be passed to strftime() and the result will be used as the value of \e{gflag}. strftime converts special symbols into certain parts of the current time or date. For example, %H will be converted into the current hour in 24-hour format. For a complete list of available symbols, search for strftime on \W{http://msdn.microsoft.com/}{MSDN}. On POSIX, you can get the list by using \c{man strftime}.
If \e{/math} is used, the result of 'val1 OP val2', where OP may be +,-,*,/,%,<<,>>,>>>,&,|,^,~,!,&& or ||, will be used as the value of \e{gflag}. Note that val1 AND val2 MUST be integer values!
If \e{/file} is used, the entire text file specified (including whitespace and newlines) will be read and placed into \e{gflag}.
If \e{/file} is used, the entire text file specified (including whitespace and newlines) will be read and stuffed into \e{gflag}.
If \e{/intfmt} is used, \e{value} is interpreted as a integer and formated using the same syntax as \R{intfmt}{IntFmt}.
If \e{/math} is used, the result of 'val1 OP val2', where OP may be +,-,*,/,%,<<,>>,>>>,&,|,^,~,!,&& or ||, will be used as the value of \e{gflag}. Note that val1 AND val2 MUST be integer values!
\c !define USE_SOMETHING
\c !define VERSION 1.2
@ -27,6 +29,7 @@ If \e{/file} is used, the entire text file specified (including whitespace and n
\c !define /math REST 15 % ${RESULT}
\c !define /file BunchaStuff somesourcefile.cpp
\c !define /redef USE_SOMETHING ${RESULT} ;redefine USE_SOMETHING
\c !define /intfmt HEX "0x%X" 3133078222
\S1{undef} !undef

View file

@ -22,6 +22,8 @@ Released on ? ?th, 2020
\# Undocumented: \b Added GetShellVarContext, IfAltRegView and GetRegView | Documenting these would require documenting the parameter name to number mapping
\b Added \cw{!define /intfmt}
\b MultiUser: Fixed INSTALLMODE_FUNCTION and added INSTALLMODEPAGE_SHOWUSERNAME
\S2{} Translations