doniking
19th March 2010 05:49 UTC
${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!
MSG
19th March 2010 06:08 UTC
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.
doniking
19th March 2010 21:25 UTC
"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.
MSG
20th March 2010 09:21 UTC
"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.
doniking
20th March 2010 09:46 UTC
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?
pengyou
20th March 2010 15:27 UTC
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.
doniking
20th March 2010 18:06 UTC
@pengyou: yes i used installoptions before but i forgot if it saves the states. does it support event handler onchange onkeypress, etc ?
Animaether
21st March 2010 11:47 UTC
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.