Announcement

Collapse
No announcement yet.

Default Checkbox state not being applied

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Default Checkbox state not being applied

    I'm trying to do a Reboot screen, and am using the one that comes with SUF. The checkbox for 'Yes, restart my computer now', has a visible and enabled checkbox and I have set the default state to checked.
    If I do a preview on the screen, it appears correct but when i build it and run it shows as unchecked??


    Interestingly enough, if I set the default box to unchecked, it appears as checked in the preview!!

    Am I missing somethign here ???

  • #2
    Re: Default Checkbox state not being applied

    I understand the confusion in this case and others have experienced the same, however the current method was done for convenience if you were not to modify it's default settings.

    Let me explain why this occurs:


    The default state option on the CUSTOM tab of that screen will affect a variable that currently doesn't have any value assigned to it.

    The default variable in the "Store checkbox state in variable" field is %DoReboot%. This variable directly controls whether or not the system will be rebooted after the install. At the beginning of the install, %DoReboot% is set to FALSE. There's also a variable called %NeedsReboot%. This variable is set if for example there was a file that was in use during the install that requires a reboot in order for it to be replaced. That variable in turn sets the variable %DoReboot% to either TRUE or FALSE.

    The reason that the default state has no effect is due to the fact that %DoReboot% already has a value going into that screen, therefore since that is the variable used to store the state of the checkbox, it will reflect it's value.

    So there are two possible solutions:

    1) You could use another variable in the "Store checkbox state in variable" field and then on the AFTER actions tab, set the variable %DoReboot% based on the value of your variable used for the checkbox.

    2) You could simply create an ASSIGN VALUE action on the BEFORE actions tab of the Reboot System screen to set the variable %DoReboot% to TRUE. That value will then be reflected in the checkbox.

    Hope that helps.

    Comment


    • #3
      Re: Default Checkbox state not being applied

      Thanks for this Darryl. Apologies for not coming back sooner.
      Your option 2 worked a treat..

      '2) You could simply create an ASSIGN VALUE action on the BEFORE actions tab of the Reboot System screen to set the variable %DoReboot% to TRUE. That value will then be reflected in the checkbox. '

      regards
      Chris

      Comment

      Working...
      X