Archive: ${NSD_GetState}


${NSD_GetState}
hello,

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


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!

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.


"not everyone" means some of them do want it :p
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.


"not everyone" means some of them do want it :p
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!

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.

Originally posted by MSG
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 :D

Originally posted by MSG
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?

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: yes i used installoptions before but i forgot if it saves the states. does it support event handler onchange onkeypress, etc ?


Originally posted by doniking
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.