Dialog Box with Buttons

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • dorkauf89
    New Member
    • May 2007
    • 144

    Dialog Box with Buttons

    I made a setup and at the end I want it to ask them if they want to restart their computer now or later. I want to do this by having a dialog box that says something like "Sorry, but you have to restart your computer" and then there will be two buttons, "restart now" and "restart later". How do I do this? I know how to do that they have a dialog box that says something with only one button and when they press it, it restarts their computer. How do I do two buttons? HELP! Thank you in advance.
  • pww
    Indigo Rose Customer
    • Jun 2005
    • 470

    #2
    most simple would be with a message box that asks '.... do you want to restart now?' and has Yes and No buttons.

    In case you need custom buttons text, modify some of the available screens.
    Add a new screen in the "After Installing" section, or simply modify the "Finished Install" screen , I think it's added by default - uncheck 'Visible' for the Cancel button, and change texts of Back and Finish buttons to Restart Now & Restart Later. Then edit the action associated with the Restart Now button.

    Comment

    • dorkauf89
      New Member
      • May 2007
      • 144

      #3
      Thank you very much but, how to I write the script so I tell it that if they press the yes button, it will restart? do I put:

      if buttoname then
      ....
      end

      ????

      I don't think so... How do I do it?

      Comment

      • pww
        Indigo Rose Customer
        • Jun 2005
        • 470

        #4
        for a message box, sort of this

        Code:
        q = Dialog.Message("Reboot now?", "Do you want to reboot now?", MB_YESNO, MB_ICONQUESTION, MB_DEFBUTTON2);
         if q == IDYES then
         	--reboot
         	System.Reboot();
         else
         	--quit
         	Application.Exit();
         end;
        You may put this code in the On Next script of your last screen, or simply remove After Installing screen(s) and put it in the On Post Install script

        Comment

        • dorkauf89
          New Member
          • May 2007
          • 144

          #5
          What if I want to use radio buttons? I added a screen with radio buttons one says restart now and the other one says restart later. How do I tell him what to do for different buttons? How do I give them names? Thanks!

          Comment

          • pww
            Indigo Rose Customer
            • Jun 2005
            • 470

            #6
            then put this in the On Next script

            Code:
            uChoice = String.ToNumber(SessionVar.Expand("%RadioSelection%"));
            if uChoice == CTRL_RADIO_BUTTON_01 then
            	--if the first option is selected, reboot
            	--assumes the first radio button is 'Reboot now', second is 'Reboot later'
            	System.Reboot();
            else
            	--otherwise quit
            	Application.Exit();
            end;

            Comment

            • dorkauf89
              New Member
              • May 2007
              • 144

              #7
              Thank you very much! I'm kind of new to this business so sorry for the stupid questions! Thanks

              Comment

              Working...
              X