Old 14th January 2009, 16:05   #1
Fluffy_Penguin2
Junior Member
 
Join Date: Jan 2009
Posts: 3
Checkbox's / if command

Ive been trying to figure this out for a while and ive looked at the examples and documents and i cant work out how to do this so sorry .

Im trying to make it so that when checkbox's are ticked it downloads a file using the "NSISdl::download" command.
I cant for the life of me figure out how to do this. Ive looked at the IniRead thing but i cant work out how to do this at all.

The checkbox info is in the .ini and the commands are in the nsis file.

If anyone could give me an example of how to make a checkbox and then link it to a command when its checked. Thanks.

Fluffy_Penguin2
Fluffy_Penguin2 is offline   Reply With Quote
Old 14th January 2009, 16:45   #2
apparition
Junior Member
 
Join Date: Apr 2008
Location: Canada
Posts: 5
The way I know:
code:
!include LogicLib.nsh

Var CB_QUICKSET

${NSD_CreateCheckBox} 15u 58u 120u 12u "I'm a checkbox"
Pop $CB_QUICKSET

SendMessage $CB_QUICKSET ${BM_GETCHECK} 0 0 $0
${If} $0 == 1
Messagebox MB_OK "I'm checked!"
${Else}
Messagebox MB_OK "I'm unchecked!"
${EndIf}

apparition is offline   Reply With Quote
Old 14th January 2009, 18:39   #3
Fluffy_Penguin2
Junior Member
 
Join Date: Jan 2009
Posts: 3
Do you know how to do this by using fields? Then making it check the state of the checkbox e.g. 0 or 1.
Then run a macro to do the download or move on to the next checkbox to check.

Ive got macros done to do the downloads but i just need to know how to check for the state of the checkbox and how to tell it to do a command and then move on.

Ive been looking at trying to do it by this way.

ReadIniStr $PLUGINSDIR\test.ini "Field 5" "State" "NSISdl::download file.com/1.txt"

But im kinda failing

Last edited by Fluffy_Penguin2; 14th January 2009 at 19:06.
Fluffy_Penguin2 is offline   Reply With Quote
Old 14th January 2009, 20:21   #4
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
If you insist to run with InstallOptions you should read the documentation about the notify flag and checkout the included examples.

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 14th January 2009, 22:27   #5
Fluffy_Penguin2
Junior Member
 
Join Date: Jan 2009
Posts: 3
Thanks you Red Wine
Fluffy_Penguin2 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