Hi,
I am new to the forum and also NSIS. I am after some help please as I seem to be hitting a brick wall.
I am currently using nsdialogs whereby the user types in a url, this url is then used further down the script to create the shortcuts. However, the one part that isn't working is the NSD_GetText command. It is returning blank data. Please see below what I currently have. I would welcome any suggestions:
Function nsDialogsPage
nsDialogs::Create 1018
Pop $Dialog
!insertmacro MUI_HEADER_TEXT "Type in the customers Full URL" ""
${If} $Dialog == error
Abort
${EndIf}
${NSD_CreateLabel} 0 0 100% 25% "It should look similar to one of the following: $\r$\n$\r$\nhttp://www.url.co.uk"
Pop $Label
${NSD_CreateText} 0 25% 100% 13u ""
Pop $Text
#${NSD_OnChange} $Text nsDialogsPageTextChange
;...
;...
nsDialogs::Show
FunctionEnd
Function nsDialogsPageLeave
${NSD_GetText} $Text $COOKIEURL
MessageBox MB_OK "url entered is $COOKIEURL" #My test to see if I get the expected result
StrCpy $sURL $COOKIEURL
!define $COOKIEURL=$sURL
# MessageBox MB_OK "The URL entered is $\n$\n$sURL"
FunctionEnd
NSIS Get Text
6 posts
Are you saying $COOKIEURL in MessageBox is blank?
!define $COOKIEURL=$sURLis not valid or does not do what you think it does.
Hi Anders,
Thanks for the reply, Yes the $COOKIEURL is blank. $Text just returns a random number.
The Define part I thought that it then changes the COOKIE URL variable and what is in it to a different variable named $sURL. From what you are saying I may be wrong about that
Thanks for the reply, Yes the $COOKIEURL is blank. $Text just returns a random number.
The Define part I thought that it then changes the COOKIE URL variable and what is in it to a different variable named $sURL. From what you are saying I may be wrong about that
$Text is not a random number, it is the handle to the text control you created.
Ahh ok, thanks, as I say I'm new to this so sorry if I am asking silly questions :/ but is there any reason from the above that you can see as to why the Get Text would not return the text entered?
With
Page Custom nsDialogsPage nsDialogsPageLeave"url entered is $COOKIEURL" has the correct text when I use your code.