Archive: MUI_FINISHPAGE_RUN default drectory


MUI_FINISHPAGE_RUN default drectory
Hello,

My installation creates a bin drectory in the $INSTDIR and places an executable there. I'd like to run this program using MUI_FINISHPAGE_RUN, but I want the current directory to be $INSTDIR/bin. How do I change the directory?

Thanks.


use a function as the run "item", then use SetOutPath + Exec


Thanks Anders, this is what I did:
!define MUI_PAGE_CUSTOMFUNCTION_PRE ChangeCurDirectory
!define MUI_PAGE_CUSTOMFUNCTION_SHOW ChangeCurDirectory
!define MUI_FINISHPAGE_RUN "$INSTDIR\bin\my.exe"
!insertmacro MUI_PAGE_FINISH
Function ChangeCurDirectory
SetOutPath "$INSTDIR\bin"
FunctionEnd


I was talking about MUI_FINISHPAGE_RUN_FUNCTION, your hack relies on undefined behavior (MUI could call SetOutPath after MUI_PAGE_CUSTOMFUNCTION_SHOW )


Sorry Anders, I'm new to NSIS could you explain your solution in a little more detail.

Thank you.


It (MUI_FINISHPAGE_RUN_FUNCTION) is in the Modern UI documentation.

Stu


Thanks Afrow UK! I got it.