Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 19th March 2010, 04:49   #1
doniking
Junior Member
 
Join Date: Aug 2006
Location: Jakarta, Indonesia
Posts: 14
Send a message via Yahoo to doniking
${NSD_GetState}

hello,

are there another ways to save the control state without having to write ${NSD_GetState} like this:

code:

Function InstallTypePageLeave
${NSD_GetState} $rdoDev $rdoDev_State
${NSD_GetState} $rdoProd $rdoProd_State
FunctionEnd



can nsis autosave it when switching to another page like innosetup does?
im just curious if it will be possible in the next version of nsis.

thank you so much!
doniking is offline   Reply With Quote
Old 19th March 2010, 05:08   #2
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 555
NSIS does nearly nothing automatic. Not everyone will want the state to be saved automatically, after all. This can be done very easily manually, so there's no point in automating it.
MSG is offline   Reply With Quote
Old 19th March 2010, 20:25   #3
doniking
Junior Member
 
Join Date: Aug 2006
Location: Jakarta, Indonesia
Posts: 14
Send a message via Yahoo to doniking
"not everyone" means some of them do want it
so what's the point to not automating it?

I am creating an installer which requires a lot of custom forms (for now 2 and will increase to 5), each of them will have 2-4 text controls and 2 or 3 checkboxes which have their own event handlers.
imagine how long the codes will. i'm not lazy, i'm just thinking the codes will be harder to read and maintenance.

Last edited by doniking; 19th March 2010 at 21:24.
doniking is offline   Reply With Quote
Old 20th March 2010, 08:21   #4
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 555
Quote:
"not everyone" means some of them do want it
so what's the point to not automating it?
If you automate it, some people will not be very happy, because suddenly the installer is doing something without their asking for it!

Quote:
I am creating an installer which requires a lot of custom forms (for now 2 and will increase to 5), each of them will have 2-4 text controls and 2 or 3 checkboxes which have their own event handlers.
imagine how long the codes will. i'm not lazy, i'm just thinking the codes will be harder to read and maintenance.
Have you considered using macros or functions? They were invented for code simplification, you know.
MSG is offline   Reply With Quote
Old 20th March 2010, 08:46   #5
doniking
Junior Member
 
Join Date: Aug 2006
Location: Jakarta, Indonesia
Posts: 14
Send a message via Yahoo to doniking
Quote:
Originally Posted by MSG View Post
If you automate it, some people will not be very happy, because suddenly the installer is doing something without their asking for it!
i think it would better if the installer have an option whether you want to autosave the control's states or not. so everybody would be very happy

Quote:
Originally Posted by MSG View Post
Have you considered using macros or functions? They were invented for code simplification, you know.
i haven't learnt how to use macro.
is it possible to save all control's states using a macro so i can reuse it in another installation project?
doniking is offline   Reply With Quote
Old 20th March 2010, 14:27   #6
pengyou
Major Dude
 
Join Date: Mar 2003
Posts: 529
Using InstallOptions instead of nsDialogs may help because it makes it easier to retain the state. But if you have never used InstallOptions before then you'll have to learn how to use it, so it may not be the best solution for you.
pengyou is online now   Reply With Quote
Old 20th March 2010, 17:06   #7
doniking
Junior Member
 
Join Date: Aug 2006
Location: Jakarta, Indonesia
Posts: 14
Send a message via Yahoo to doniking
@pengyou: yes i used installoptions before but i forgot if it saves the states. does it support event handler onchange onkeypress, etc ?

Last edited by doniking; 20th March 2010 at 18:35.
doniking is offline   Reply With Quote
Old 21st March 2010, 10:47   #8
Animaether
Major Dude
 
Join Date: Jun 2001
Posts: 900
Quote:
Originally Posted by doniking View Post
i used installoptions before but i forgot if it saves the states. does it support event handler onchange onkeypress, etc ?
It supports some event handlers - but pretty limited. IntallOptions2 and InstallOptionsEx support more events; but still nowhere near as flexible as NSDialogs.. so it'd depend on your exact needs.

Personally I'd say setting up page leave/enter function to store/restore the settings isn't all that painful and makes you more aware of your custom pages' functionality.
Animaether 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


All times are GMT. The time now is 22:33.