Niharika1588
19th February 2013 15:48 UTC
Data in Textbox
Hi All,
I want to develop an installer, where the user selects an item from the list and in the next page the item the user selects should appear in one of the textboxes. But I was unable to program it that way.
So please have a look at my code :
!include MUI.nsh
!include LogicLib.nsh
!include WinMessages.nsh
!include FileFunc.nsh
!include nsDialogs.nsh
Page custom Trying2print
OutFile "Word.exe"
Var Text
Var Txt1
Var TextBox1
Var b
Function Trying2print
nsDialogs::Create /NOUNLOAD 1018
Pop $0
${NSD_CreateLabel} 1 0 100% 12u "Plz enter the following values.."
Pop $Text
${NSD_CreateLabel} 0 17u 23% 10u "gReleaseNo. : "
Pop $Txt1
${NSD_CreateText} 85 17u 28% 10u ""
Strcpy $b "abc"
Strcpy $TextBox1 $b
Pop $TextBox1
nsDialogs::Show
FunctionEnd
Section ""
SectionEnd
This code works as below :
Takes a textbox and displays the item in the Variable b i..e "abc". But here also the value is not showing in the Textbox but showing it in the Message box if we add the line
MessageBox MB_OK "TextBox1 = $TextBox1"
Yathosho
19th February 2013 17:08 UTC
you're mixing up the window handle with the actual text displayed:
${NSD_CreateText} 85 17u 28% 10u ""
Pop $TextBox1
Strcpy $b "abc"
${NSD_SetText} $TextBox1 $b
but if you want the text to be taken from a dropdown list, you will need an additional onChange function to set the text
Niharika1588
19th February 2013 21:15 UTC
Thanks that worked.
I need one more help. I need to get the description of the items that are extracted or copied like in the image https://encrypted-tbn1.gstatic.com/i...0BQfM4VOdp9Ksw
The below code does that :
# define installer name
outFile "installer.exe"
# set desktop as install directory
InstallDir $DESKTOP
# default section start
section
# define output path
setOutPath $INSTDIR
# specify file to go in output path
File forum.vbs
# define uninstaller name
writeUninstaller $INSTDIR\uninstaller.exe
#-------
# default section end
sectionEnd
# create a section to define what the uninstaller does.
# the section will always be named "Uninstall"
section "Uninstall"
# Always delete uninstaller first
delete $INSTDIR\uninstaller.exe
# now delete installed file
delete $INSTDIR\test.txt
sectionEnd
But I should use the below code, to get this done.
!include MUI.nsh
!include LogicLib.nsh
!include WinMessages.nsh
!include FileFunc.nsh
!include nsDialogs.nsh
installDir "C:\work\HUDSYSTEMS\"
Page custom show
Page instfiles
OutFile "POST.exe"
Function show
File forum.vbs
FunctionEnd
Section ""
SectionEnd
Can you please help me out??
Yathosho
19th February 2013 22:01 UTC
not sure if i fully understand what you're looking for, but if want full control over what's displayed in the details box take a look at DetailPrint and SetDetailsPrint
SetDetailsPrint none #hides each File instruction in this example
DetailPrint "Extracting a bunch of files"
File /r *.boring
SetDetailsPrint both #let's show the File instruction again
File /r *.interesting