Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 19th July 2010, 20:20   #1
KMyers
Junior Member
 
Join Date: Jul 2010
Posts: 1
Simple NSIS Question

Hello All,
I am trying to build an installer to automate several installation packages. One of the packages needs an ini file to be placed at c:\config\aconfig.ini . I need to prompt the user to enter a specific value to add to this file. I have spent 6 hours trying to figure this out but everything I try seems to fail.

Can anyone code up a simple example on the best way to do this?
KMyers is offline   Reply With Quote
Old 19th July 2010, 21:22   #2
Animaether
Major Dude
 
Join Date: Jun 2001
Posts: 1,173
You could use one of the user input plugins that generate a pop-up:
http://nsis.sourceforge.net/Dialogs_plug-in
http://nsis.sourceforge.net/PassDialog_plug-in

Or you can create a field on a custom page.. e.g.
code:

!include "nsDialogs.nsh"

OutFile "test.exe"

Section
SectionEnd

Var dialog
Var hwnd
Var null

Var ui_ini_keyvalue

Page Custom page.custom.create page.custom.leave
Function page.custom.create
nsDialogs::Create 1018
Pop $dialog
${NSD_CreateGroupBox} 0 0 100% 20% "Please enter the INI key value"
Pop $null
${NSD_CreateText} 5% 8% 90% 8% "Default Value"
; Default values should be handled differently.
; http://forums.winamp.com/showthread.php?t=305165
Pop $ui_ini_keyvalue
${NSD_OnChange} $ui_ini_keyvalue cb_ini_keyvalue.onchange
nsDialogs::Show
FunctionEnd

Function cb_ini_keyvalue.onchange
Pop $hwnd
${NSD_GetText} $hwnd $0
MessageBox MB_OK "User changed: [$0]"
FunctionEnd

Function page.custom.leave
${NSD_GetText} $ui_ini_keyvalue $0
MessageBox MB_OK "User entered: [$0]"
FunctionEnd


Last edited by Animaether; 19th July 2010 at 21:46. Reason: somebody's filtering a certain brand of shoes, it seems - renamed variables
Animaether is offline   Reply With Quote
Old 20th July 2010, 06:58   #3
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,840
Hah. ini-key shoes, only $40 a pair. Get them while they're hot!
MSG is offline   Reply With Quote
Reply
Go Back   Winamp 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