Old 6th June 2003, 20:59   #1
iamnutzy1975
Junior Member
 
Join Date: Jun 2003
Posts: 2
Unhappy Using user input

This is my first crack at NSIS. I'm using the modren interface. I created three custom dialog pages and I'm using them to capture data entered by the user (person installing). How do I store \ get \ access the values they entered?

My function looks like this so far:
--------------------------------------------------------------------
Function SetCustomAPPNAME
strcpy $1 "Choose APPNAME"
strcpy $2 "[PI]AppName value stored the INI file."
!insertmacro MUI_HEADER_TEXT $1 $2
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "ioAPPNAME.ini"
FunctionEnd
--------------------------------------------------------------------

ioAPPNAME.ini resembles:
--------------------------------------------------------------------
[Field 2]
Type=Text
MaxLen=4
MinLen=4
ValidateText=Must be 4 Characters in Length
Left=10
Right=-80
Top=65
Bottom=75
--------------------------------------------------------------------

Basically I want to capture what they enter and then use in another section like this:
-------------------------------------------------------------------
Section "INI File" SecINIFile ;Setup up INI file
WriteINIStr $INSTDIR\dat\rerout.ini "Files" "log" <USER INPUT>
SectionEnd ; end the section
iamnutzy1975 is offline   Reply With Quote
Old 6th June 2003, 21:53   #2
Joel
Debian user
(Forum King)
 
Joel's Avatar
 
Join Date: Jan 2003
Location: Arch land
Posts: 4,917
Use for read:
code:

ReadIniStr $0 $PLUGINSDIR\ioAPPNAME.ini "Field 2" State
MessageBox MB_OK "Hi $0"



* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE.
Joel is offline   Reply With Quote
Old 7th June 2003, 09:56   #3
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
To make the code clearer it would be better to use:

!insertmacro MUI_INSTALLOPTIONS_READ $0 "ioAPPNAME.ini" "Field 2" "State"

But Lobo's code should work too.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 9th June 2003, 14:34   #4
iamnutzy1975
Junior Member
 
Join Date: Jun 2003
Posts: 2
Both work. Thanks a bundle. Where's all the documentation for all the macros for the modern GUI ?
iamnutzy1975 is offline   Reply With Quote
Old 9th June 2003, 14:56   #5
Sunjammer
Major Dude
 
Join Date: Jun 2002
Location: Swindon, UK
Posts: 559
http://nsis.sourceforge.net/Docs/AppendixA.html#A
http://nsis.sourceforge.net/Contrib/...UI/Readme.html
Sunjammer 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