The instructions in the manual are: Defined as the function name, without any prefixes, in function scope.
The ${FUNCTION} in . * and un.* have different values, I think the value with “.” prefix is the wrong value, please correct it to the same result.
Example:
Function .onInit
!echo "${__FUNCTION__}" # ${__FUNCTION__}=.onInit
FunctionEnd
Function un.onInit
!echo "${__FUNCTION__}" # ${__FUNCTION__}=onInit
FunctionEnd
Do you have an actual need for
${__FUNCTION__}other than printing debug output?Your bug report is valid but it will break compatibility if we change it. The current handling matches the documentation for normal uninstaller functions unfortunately.
I really use it because I'm developing an NSIS UI header, and certain functions have macros that need to be restricted in their usage, for example one of the macros is to only allow them to be used within a specific callback function, and that's where using
${__FUNCTION__}would be perfect.Currently
!searchreplacehas been used to remove the “.” from the result. , temporarily defining a symbol and comparing it. Of course, I could also write an extra judgment statement not to modify the result.As for compatibility, the general commercial applications, and will not be the first time to use a new version of the development language, whether NSIS or Python, there are still a lot of now in use 2.x, perhaps until this product is phased out, he will not be upgraded. In this respect, the fix will hardly affect compatibility.
Last edit: nttwqz 2024-10-18