Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 11th October 2007, 22:13   #1
briangriffen
Junior Member
 
Join Date: Oct 2007
Posts: 2
MUI_PAGE_DIRECTORY, dynamicaly update the 'Destination Folder' text box

Is there a way to update the value of the 'Destination Folder' in the MUI_PAGE_DIRECTORY dialog when using MUI_PAGE_CUSTOMFUNCTION_LEAVE to validate $INSTDIR

If the folder exists I want to change it to a suggested name, doing a StrCpy $INSTIDR "blaaaa" in the validate function did not work.

Any ideas?

<snip>
; Directory page
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE dir_leave
!insertmacro MUI_PAGE_DIRECTORY

Function dir_leave
IfFileExists "$INSTDIR\*.*" folderExists
goto done

folderexists:
StrCpy $INSTDIR "$INSTDIR\[suggested_name]"
abort
done:
Functionend
briangriffen is offline   Reply With Quote
Old 12th October 2007, 07:38   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Use SendMessage with ${WM_SETTEXT}. Use Resource Hacker to determine the control ID in modern.exe.

Stu
Afrow UK is offline   Reply With Quote
Old 12th October 2007, 15:16   #3
briangriffen
Junior Member
 
Join Date: Oct 2007
Posts: 2
thanks for the info Afrow,
didn't know if there was a MUI macro... guess not :-)

for any one else interested there are numerous examples of SendMessage all over the web... but here is the code I ended using...

FindWindow $R0 "#32770" "" $HWNDPARENT
GetDlgItem $R1 $R0 1019
SendMessage $R1 ${WM_SETTEXT} 0 "STR:$INSTDIR\[blaaaaa]"

Last edited by briangriffen; 12th October 2007 at 16:32.
briangriffen 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