IF THEN statements?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Nocturnal
    Forum Member
    • Jun 2006
    • 29

    IF THEN statements?

    I'm trying to build something that will a) ask me "Do you want to install, YES OR NO?" with either a Yes button or a No button.

    If I click on yes, I want it to go on to the next action which will be installing several programs.

    How do I accomplish this? I've already got the dialog box down. Thanks!
  • jackdaniels
    No longer a forum member
    • Mar 2007
    • 533

    #2
    this will get you started...

    Code:
    result = Dialog.Message("Installation", "Do you want to install ?", MB_YESNO, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
        --if they choose yes 
        if result == IDYES then
            --install app
            return true;
        else
            --dont install
            return false;
        end

    Comment

    • rexzooly
      No longer a forum member
      • Jul 2007
      • 1512

      #3
      Originally posted by Nocturnal View Post
      I'm trying to build something that will a) ask me "Do you want to install, YES OR NO?" with either a Yes button or a No button.

      If I click on yes, I want it to go on to the next action which will be installing several programs.

      How do I accomplish this? I've already got the dialog box down. Thanks!
      if you look the dialog as options to be able to yes no, ok & Concel and so on :yes

      Good luck.

      Comment

      • motoman
        Forum Member
        • Apr 2009
        • 2

        #4
        so I have the following:

        result = Dialog.Message("Installation", "Did you remove any existing antivirus software via ADD/REMOVE PROGRAMS in Control Panel?", MB_YESNO, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
        --if they choose yes
        if result == IDYES then
        --install AutoPlay\\Docs\\SophosHomeInstall.EXE
        return true;
        else
        --dont install
        return false;
        end

        I get the dialog box but when I hit YES, it doesnt launch the executable. What did I miss?

        Comment

        • jackdaniels
          No longer a forum member
          • Mar 2007
          • 533

          #5
          Try like that ;

          Code:
          result = Dialog.Message("Installation", "Did you remove any existing antivirus software via ADD/REMOVE PROGRAMS in Control Panel?", MB_YESNO, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
          if result == IDYES then
          File.Run("AutoPlay\\Docs\\SophosHomeInstall.EXE", "", "", SW_SHOWNORMAL, false);
          else
          return false;
          end

          Comment

          • motoman
            Forum Member
            • Apr 2009
            • 2

            #6
            that worked man. thanks

            Comment

            Working...
            X