constructor icon indicating copy to clipboard operation
constructor copied to clipboard

Improve variable and function names in NSIS templates

Open lrandersson opened this issue 1 month ago • 1 comments

Checklist

  • [x] I added a descriptive title
  • [x] I searched open requests and couldn't find a duplicate

What is the idea?

In the NSIS templates there are a lot of variables and functions such as Ana_* This looks like a legacy thing and doesn't really serve any purpose, it makes the code look less attractive. In the PR here some variables were renamed to improve readability. We should update the rest of the code base and improve it in a similar fashion to make it consistent.

Why is this needed?

This would mainly benefit developers of constructor and intends to improve code readability.

What should happen?

Variable and function names with the pattern *Ana* for example:

  1. Function mui_AnaCustomOptions_Show
  2. Var Ana_PreInstall_State to be renamed
  3. Fix inconsistencies in initialization of variables. For example, the following code can likely be moved into mui_AnaCustomOptions_InitDefaults:
    StrCpy $Ana_ClearPkgCache_State {{ '${BST_UNCHECKED}' if keep_pkgs else '${BST_CHECKED}' }}
    StrCpy $Ana_PreInstall_State {{ '${BST_CHECKED}' if pre_install_exists else '${BST_UNCHECKED}' }}
    StrCpy $Ana_PostInstall_State {{ '${BST_CHECKED}' if post_install_exists else '${BST_UNCHECKED}' }}

Additional Context

No response

lrandersson avatar Nov 14 '25 16:11 lrandersson

hey @lrandersson can i work on this?

aman-coder03 avatar Dec 03 '25 14:12 aman-coder03