PDA

View Full Version : Custom Wizard Dialog



Manish Jhalani
05-14-2014, 03:00 AM
I am creating setup with my Custom Wizard Dialogs. I am creating Custom Wizard Dialogs for Welcome, License Agreement etc. I am facing problem with enable/disable of Next button on License Agreement dialog.

License Agreement has one check box to accept the License Agreement. First time when I do next from Welcome dialog and move to License Agreement dialog the Next button is disabled and check box is unchecked. Next button is getting enable/disable properly When I check/uncheck checkbox. Problem start when I do back from License Agreement dialog. When I do back from License Agreement and again next from Welcome dialog, the next button on License Agreement is always enable.

I am using this code:

Set Variable %LICENSE_ACCEPTED% to "0"

! The Wizard Loop displays the dialog screens that the user sees in the installation
Define Wizard Dialog "WELCOME" (Custom Wizard Dialog)
Define Wizard Dialog "LICENSE" (Custom Wizard Dialog)
Define Wizard Dialog "OPTIONS" (Custom Wizard Dialog)
Define Wizard Dialog "READYTOINSTALL" (Custom Wizard Dialog)

Loop Wizard (Abort Dialog Active)
If %_SB_DIALOGID% Equals "$LICENSE$" Then
If %LICENSE_ACCEPTED% Equals "1" Then
Enable ControlID "$NEXT_BUTTON$"
End
If %LICENSE_ACCEPTED% Equals "0" Then
Disable ControlID "$NEXT_BUTTON$"
End
End
End


Please help.

linder
05-14-2014, 03:22 AM
Hello,

Could you please create a simple demo .sb8 script with your code and upload it so we can exactly see what you are doing? I don't see the code to disable the NEXT button in your source.

Thanks,
Friedrich

linder
05-14-2014, 03:29 AM
Hello,

I have modified the License Agreement project from the Examples Package (makes use of radio buttons):

http://www.lindersoft.com/projects/LicenseAgreementCustomDialogDemo.zip

Does this help?

Friedrich

linder
05-14-2014, 03:39 AM
And it even works fine with a checkbox (I tested the Back/Next buttons). Here is a quick-and-dirty demo project:

http://www.lindersoft.com/projects/LicenseAgreementCustomDialogDemo2.zip

Does this help?

Friedrich

Unregistered
05-14-2014, 04:14 AM
And it even works fine with a checkbox (I tested the Back/Next buttons). Here is a quick-and-dirty demo project:

http://www.lindersoft.com/projects/LicenseAgreementCustomDialogDemo2.zip

Does this help?

Friedrich


Thanks for this. I am using Setup Builder 7.1 version. When I am trying to use $EVENT:ONREOPEN$, getting error.

If %_SB_EVENTID% Equals "$EVENT:ONREOPEN$" Then
If %LICENSE_ACCEPTED% Equals "0" Then
Disable ControlID "$NEXT_BUTTON$"
End
End


Error while compile is "error GEN1007: Reference to constant $EVENT:ONREOPEN$ has not been previously defined".

linder
05-14-2014, 04:32 AM
Hello,

Aha, okay. SetupBuilder 7.1 is an outdated version and reached end-of-life (EOL) 4 years ago ;)

http://www.lindersoft.com/support_eol.htm

I checked the release history and we added EVENT:ONREOPEN in SetupBuilder 7.2 Build 2939 (April 26, 2010)

IMPROVEMENT: Add new $EVENT:ONREOPEN$ event for custom wizard dialogs. This event is fired if a custom wizard dialog is "re-opened".

http://www.lindersoft.com/HISTORYSB7.TXT
http://www.lindersoft.com/HISTORYSB8.TXT

Unfortunately, it's not available in the old 7.1 :(

Friedrich

Manish Jhalani
05-14-2014, 05:11 AM
Hello,

Aha, okay. SetupBuilder 7.1 is an outdated version and reached end-of-life (EOL) 4 years ago ;)

http://www.lindersoft.com/support_eol.htm

I checked the release history and we added EVENT:ONREOPEN in SetupBuilder 7.2 Build 2939 (April 26, 2010)

IMPROVEMENT: Add new $EVENT:ONREOPEN$ event for custom wizard dialogs. This event is fired if a custom wizard dialog is "re-opened".

http://www.lindersoft.com/HISTORYSB7.TXT
http://www.lindersoft.com/HISTORYSB8.TXT

Unfortunately, it's not available in the old 7.1 :(

Friedrich

Is there any other way (other than EVENT:ONREOPEN) to control this situation in SB 7.1 ?


Both Welcome dialog and License dialog are custom dialog. Next button gets enabled in this scenario.

Next (Welcome) -> Check Accept checkbox (Licence) -> Next enabled (License) -> Un-Check Accept checkbox (Licence) -> Next disabled (License) -> Back (License) -> Next (Welcome) -> Next enabled (License) ------This is the problem.



Loop Wizard (Abort Dialog Active)
If %_SB_DIALOGID% Equals "$LICENSE$" Then
If %_SB_EVENTID% Equals "$EVENT:ONINIT$" Then
Disable ControlID "$NEXT_BUTTON$"
End

/* If %_SB_EVENTID% Equals "$EVENT:ONREOPEN$" Then */
/* If %LICENSE_ACCEPTED% Equals "0" Then */
/* Disable ControlID "$NEXT_BUTTON$" */
/* End */
/* End */

If %LICENSE_ACCEPTED% Equals "1" Then
Enable ControlID "$NEXT_BUTTON$"
End
If %LICENSE_ACCEPTED% Equals "0" Then
Disable ControlID "$NEXT_BUTTON$"
End
End
End

linder
05-14-2014, 05:19 AM
Hello,

I am afraid that there is no solution in 7.1 to handle this scenario. That's why we introduced the $EVENT:ONREOPEN$ event 4 years ago. You need this extra event to be fired to handle the disable/enable "Next" button.

Friedrich