Skip to content
⌘ NSIS Forum Archive

MUI_FINISHPAGE_RUN default drectory

7 posts

sjcomp#

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.
sjcomp#
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
Anders#
I was talking about MUI_FINISHPAGE_RUN_FUNCTION, your hack relies on undefined behavior (MUI could call SetOutPath after MUI_PAGE_CUSTOMFUNCTION_SHOW )
sjcomp#
Sorry Anders, I'm new to NSIS could you explain your solution in a little more detail.

Thank you.