sjcomp
18th April 2008 00:53 UTC
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.
Anders
18th April 2008 02:03 UTC
use a function as the run "item", then use SetOutPath + Exec
sjcomp
18th April 2008 02:45 UTC
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
18th April 2008 07:57 UTC
I was talking about MUI_FINISHPAGE_RUN_FUNCTION, your hack relies on undefined behavior (MUI could call SetOutPath after MUI_PAGE_CUSTOMFUNCTION_SHOW )
sjcomp
18th April 2008 14:07 UTC
Sorry Anders, I'm new to NSIS could you explain your solution in a little more detail.
Thank you.
Afrow UK
18th April 2008 16:13 UTC
It (MUI_FINISHPAGE_RUN_FUNCTION) is in the Modern UI documentation.
Stu
sjcomp
18th April 2008 17:04 UTC
Thanks Afrow UK! I got it.