Archive: text input


text input
Before installing a program NSIS needs to know a username, how can I do this?

I am looking for a simple way, like "write your username here"

Thanks


Use InstallOptions.


nice help, but...
Thanks for the help, but I can't make it work. Maybe with a week of reading and testing I would succeed but if you can lend me a hand...;)

Here's what I think should have to work, but it doesn't:

========= Uber.ini ==========

[Settings]
NumFields=1
BackEnabled=1
Title=Getting your Username

[Field 1]
Type=textbox
text=Tell me your Username
left=30
right=300
top=30
bottom=15

==============================
I tried with "textbox" and "text"

========= Uber.nsi ===========

Section "Get Username"
SetOutPath $TEMP
File Uber.ini
File "C:\Program Files\NSIS\InstallOptions.dll"
Push $TEMP\Uber.ini
CallInstDLL $TEMP\InstallOptions.dll dialog
Pop $0
ReadINIStr $1 $TEMP\inst.ini "Field 1" State
Delete $TEMP\Uber.nsi
Delete $TEMP\InstallOptions.dll
SectionEnd
==============================

Another problem is that the "back" button doesn't work and NSIS starts to install.
I am using v1.98


You shouldn't put it in a section. Have a look at the example in <NSISDIR>\Contrib\InstallOptions.


I am lost
If I write "#Section "Get Username" and "#SectionEnd" NSIS brokes, so i don't understand.


It should be in the .onNextPage and .onPrevPage function. Have a look at the example and you will see.


well...
I have to thank you, kichik, for the help you are giving me, but I am not succeeding with this problem. I changed what you said (section for function) and is not working.

I am not a programmer, then I need more orientation to make nsis work with installoptions. When I read the exemple I don't understand *a* thing, nothing, rien de rien. I just understood the installoptions.html but is not working.

Anyway, I want to thank you for the previous answers you gave me.


In this stage I suggest you just copy the InstallOptions example and start changing it according to your NSIS. While changing read in the docs about every function and try to understand better. Use message boxes to see what's coming where. You will have to understand what you are doing or else you won't succeed.

If you don't understand a specific command or function I will gladly explain, but I can't explain the whole thing as one piece.

Basically, .onNextPage and .onPrevPage are called when the user moves from page to page. That's where the script checks to see if the user moves to the page we want to display the IO page before/after and shows the IO page if needed. After it shows the IO page it examines the output and goes to the next or previous page depending on the output.


I'll take your suggested approach.

I'll post again in a few days:)


Thanks for your help.

Now, the InstallOptions are beginning to work.

I can not work with the password input, but I'll manage.

I think in the html file there's a mistake because it talks about the "textbox" type, but not in the list of types where lists a "text" type.


I haven't found the way to make the section which works with InstallOptions choosable , it is always selected. There's a way?

Thanks:)


What's not working with password input?
What do you mean by the section which works with InstallOptions? InstallOptions is called from .onNextPage/.onPrevPage, both functions and not sections. If you don't want to show the IO page just skip the CallInstDLL command using StrCmp, IntCmp or just Jump.


What happens with the password input is that it doesn't show. What really happens is that I can not make two fields appear in the window.

What I wanted to do is to make the inputs an option, if the section is selected in the components it appears, if not it doesn't.

(I attached an exemple of what I am doing, you can modify it and post it again I will check the differences and learn).


Change

NumFields=1

to

NumFields=2

to show the password input


Oh damm, what a stupid error.

God, forgive me.