Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Input a string (http://forums.winamp.com/showthread.php?t=300591)

barx 3rd December 2008 09:57

Input a string
 
Hello,

Is there a way to make an "InputBox" to ask user his name for example ? (As MessageBox but with a TextBox inside)

Or a page in the installer with a textBox ?

thanks

Animaether 3rd December 2008 17:44

yes - look at the documentation for InstallOptions2, InstallOptionsEx, or NSDialogs (preferred). Any of those 3 let you create your own installer dialog with controls - among which is a simple text edit field where you can ask the user for a username.

There is also the PassDialog plugin:
http://nsis.sourceforge.net/PassDialog_plug-in

And Dialogs plugin:
http://nsis.sourceforge.net/Dialogs_plug-in

barx 4th December 2008 10:11

Hi

Thanks for your reply, that's exactly what i'm looking for.

I want to prompt the user for username and password in order to store a scheduled task.

I tried PassDialog plugin and Dialogs plugin and this is not what i want exactly (because i want it in modern ui, and i don't need to verify a password, juste write it in the scheduled task)

Anyway, i tried the NSDialogs plugin. It works, except maybe a little bug: if i put the custom page before MUI_PAGE_INSTFILES, the custom page doesn't display a "next" button, but a "install" button :s

in this order:
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
Page custom nsDialogsPage
!insertmacro MUI_PAGE_FINISH

the nsDialogsPage shows a "next" button (ok)

but in this order:
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_DIRECTORY
Page custom nsDialogsPage
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH

it shows a "install" button, instead of a "next".
And i have to use this order ...

Do you have any idea to show a "next" button in the custom page ?

Animaether 4th December 2008 11:39

It's not a bug, actually... any page directly before the InstFiles page (where files actually get installed) will have the 'Next' button relabeled to 'Install'.

This is for good installer logic reasons... 'Next' tells the user they will go to the next page of settings / information. 'Install' tells the user they will actually be installing the files.

That said.. you can easily change the text on the button - see: http://nsis.sourceforge.net/Buttons_Header

Or just the code you need:
code:

GetDlgItem $0 $HWNDPARENT 1 ; Next/Install button
SendMessage $0 ${WM_SETTEXT} 0 "STR:Next"



You'll want to put that code in after you initialize the dialog, before you show it, if I recall correctly.

barx 4th December 2008 12:17

perfect !

thanks a lot Animaether

barx 4th December 2008 17:12

Can we use your solution to change the text right to the icon ? Because in my custom page, there is still:
"Choose install location
Choose the folder in which to install etc"

which com from the previous page (MUI_PAGE_DIRECTORY)

i tried the code above with several item_id without success, any idea again ? :D

(and i swear it's my last question !!)

Animaether 4th December 2008 17:25

You mean in the top? You can change that via the MUI macros;
code:

!insertmacro MUI_HEADER_TEXT "Title" "Description"


Do this before you open your custom dialog

barx 5th December 2008 07:48

nice !

thanks :)

Animaether 5th December 2008 12:15

no prob :)


All times are GMT. The time now is 04:42.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.