I am working on an updater. I need to know directly the current application version. So I want to initialize a variable that would contain the current version.
But where must I place this code? Actually, because I use ReadRegStr I have to put this code inside a function or a section.
;Current version variable
ReadRegStr $CURRENT_VERSION HKLM Software\MySoftware "Version"
I have tried to initialize my variable in the function .onInit, straight after !insertmacro MUI_LANGDLL_DISPLAY but I have the warning "unknown variable" during compilation.
Thanks in advance for your help
Var CURRENT_VERSION
!define MUI_WELCOMEPAGE_TITLE " Updater: ${CURRENT_VERSION} to ${LAST_VERSION}"
!insertmacro MUI_PAGE_WELCOME
Function .onInit
;display multilanguage list
!insertmacro MUI_LANGDLL_DISPLAY
ReadRegStr $CURRENT_VERSION HKLM Software\MySoftware "Version"
...
FunctionEnd
...