Old 17th April 2008, 23:53   #1
sjcomp
Junior Member
 
Join Date: Apr 2008
Posts: 4
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 is offline   Reply With Quote
Old 18th April 2008, 01:03   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
use a function as the run "item", then use SetOutPath + Exec

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 18th April 2008, 01:45   #3
sjcomp
Junior Member
 
Join Date: Apr 2008
Posts: 4
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
sjcomp is offline   Reply With Quote
Old 18th April 2008, 06:57   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
I was talking about MUI_FINISHPAGE_RUN_FUNCTION, your hack relies on undefined behavior (MUI could call SetOutPath after MUI_PAGE_CUSTOMFUNCTION_SHOW )

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 18th April 2008, 13:07   #5
sjcomp
Junior Member
 
Join Date: Apr 2008
Posts: 4
Sorry Anders, I'm new to NSIS could you explain your solution in a little more detail.

Thank you.
sjcomp is offline   Reply With Quote
Old 18th April 2008, 15:13   #6
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
It (MUI_FINISHPAGE_RUN_FUNCTION) is in the Modern UI documentation.

Stu
Afrow UK is offline   Reply With Quote
Old 18th April 2008, 16:04   #7
sjcomp
Junior Member
 
Join Date: Apr 2008
Posts: 4
Thanks Afrow UK! I got it.
sjcomp is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump