!define PRODUCT_NAME "Bug_Demo"
Name "${PRODUCT_NAME}"
Caption "${PRODUCT_NAME}"
OutFile "${PRODUCT_NAME}.exe"
BrandingText " "
XPStyle on
ManifestDPIAware true
InstallColors /windows
ShowInstDetails show
SetFont "Microsoft YaHei" 9
RequestExecutionLevel user
Page instfiles
!macro macro_test id x y width height
; It has nothing to do with the system plugin operation stack, it's just what I actually need.
System::Store 'S'
StrCpy $6 "${x}" "" -1
DetailPrint "-$0_${id}-${x}-${y}-${width}-${height}-"
# If the first parameter of the macro is a variable and is the same as here, ${id} will be modified to the value of this variable.
StrCpy $0 `${x}` -1 # ${id} == $0
DetailPrint "+$0_${id}+${x}+${y}+${width}+${height}+"
System::Store 'L'
!macroend
Section
StrCpy $0 "000"
StrCpy $1 "111"
!insertmacro "macro_test" $0 10 20 50 10
DetailPrint "$0"
DetailPrint "$1"
SectionEnd
Is it possible to add slice support for variables, similar to Python, so that the following conditions no longer require defining another variable, which would be particularly convenient?
Macros are just simple text replacements happening early in the compilation process. You can work around this by forcing the caller to provide a temporary variable as a parameter.