Jump to content

Dialog Box Issues


Recommended Posts

Forgive me if I leave something out. Thanks to computer issues unrelated to AutoIt, this is my 3rd attempt at this post. Here goes.

My company has software that we install for our clients. The install is mindless and repetitive, so I wrote up an autoit script to speed up the process. All was well until Windows 7. Most of the program still works, but there's one point that different on 7 than it is on XP.

The first goal I'm trying to accomplish is, partway through the install, for the program to stop and ask if the user is running windows XP or windows 7. The dialog box would be similar to the one seen in the beginning of the install.

The other goal I'm trying to accomplish is for the program, once it's run the code specific to the OS, to go back to a "common" point to continue and finsh the installation. Here's my code without trying to add an additional dialog box. This has been working fine for quite some time now. Please note that most of the code has been removed as it runs fine; my main issue is trying to create the additional dialog box.

;password field generated
$PASSWORD = "PASSWORD"
$retryCount = 0
While 1
    if $retryCount > 2 then Exit
    $input = InputBox("Password dialog", "Enter the password to continue", "", "*")
    If @error Or $input <> $PASSWORD Then
        MsgBox(4096,"Error", "Incorrect password")
        $retryCount = $retryCount + 1
    Else
        ExitLoop
    EndIf
Wend

;diaglog box created
$Form2 = GUICreate("Please Choose", 233, 143, 303, 219)
$Button1 = GUICtrlCreateButton("PreCerts", 24, 80, 75, 25, 0)
$Button2 = GUICtrlCreateButton("PostCerts", 128, 80, 75, 25, 0)
$Label1 = GUICtrlCreateLabel("Choose which script to run", 48, 32, 129, 17)
GUISetState()


While 1
        $msg = GUIGetMsg()
        Select
        Case $msg = $Button1

;PreCerts
    ;Questions
    $state = InputBox ("Question", "Enter the state")
    $bnkname = InputBox ("Question", "Enter the name of the Company")


;Create License
--->PROGRAM RUNS FINE HERE<---
Exit            
                
                
                
;PostCerts
Case $msg = $Button2
---> Section 1 <----


;Windowsxp
---> Section A <---


;Windows7
---> Section B <----


;"Common Area"
---> Section 2 <---

exit
        EndSelect
    WEnd

In the example above, for the second half of the install the user chooses "post certs". When the user chooses it, the program should run "Section 1" and then prompt if it's Windows XP ("Section A") or Windows 7 ("Section B"). Once either "Section A" or "Section B" ran, the program would continue on to run "Section 2"

I hope this makes sense and if I missed anything, feel free to ask.

THANKS!

Link to comment
Share on other sites

Fortunately for you - you don't need to ask users to specify what OS they are running.

There is a macro @OSVersion whose value is exactly what you need. So instead of asking the user, just check the value of @OSVersion and run the code accordingly.

It wouldn't hurt at all if you take the time to look through the help file.

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Link to comment
Share on other sites

Fortunately for you - you don't need to ask users to specify what OS they are running.

There is a macro @OSVersion whose value is exactly what you need. So instead of asking the user, just check the value of @OSVersion and run the code accordingly.

It wouldn't hurt at all if you take the time to look through the help file.

Enaiman,

Thank you for the assistance. I've looked through the help file multiple times, but some concepts are waaay above my skill set. I'm not a coder and never pretend to be which is why I'm in the fourms asking for assistance (which I appreciate).

Thanks

Edited by CodingMonkey81
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...