In SEC001, my-plugin::dosomething fails ONLY when the SetOutPath statement is being executed in the function backupdatabase. I don't know if I'm doing something stupid, if there's a known issue (or unknown issue), or a quick fix. Any help would be appreciated because I currently have a workaround.
Function .onInit
...
Call CheckForPreviousInstall
${If} $PreviousInstall == "true"
Call backupdatabase
Call UninstallPrevious
${EndIf}
FunctionEnd
Function backupdatabase
...
; R1 contains the previous install directory
StrCpy $R0 $WINDIR 2 0
SetOutPath "$R1\bin"
; Extract files
; Execute script
FunctionEnd
...
Section SEC001
ClearErrors
my-plugin::dosomething
${If} ${Errors}
MessageBox MB_OK "Error"
${EndIf}
SectionEnd
Thanks in advance!