Jump to content

Reading Form Buttons


Recommended Posts

Need help with a couple of things which should be minor. These are all for an automated software install.

1) I have a couple of Radio buttons on a form to select Drive locations (C:Drive, D:Drive etc) for an automated software install. How do I read the Radio Button selection and change a line which needs the Drive letter? For example changing to "C:\software_install_loction" to whatever the Radio button is set to.

2)The form has 2 selection buttons on it. One for exiting and the other to continue with the install as shown below. How do I read the Install button to continue on with the install. The install works when run by itself, but need to add the user interface to it. The exit function also works.

Do

$msg = GUIGetMsg()

Select

Case $msg= $InstallID

Case $msg= $ExitID

Case $msg= $GUI_EVENT_CLOSE

EndSelect

Until $msg = $GUI_EVENT_CLOSE or $msg = $ExitID

3) This next one is more complicated (for me anyway), I am checking the existance of a previous software install using:

$var = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\FLEXlm License Manager", "Service")

This reports the existance as it should.

How do I use this info as a condition to continue with one install or another install. It makes a differance in the install windows whether a previous version exists.

Any examples to help me through this would be appreciated...

Thanks.

Link to comment
Share on other sites

#include <GUIConstants.au3>


GUICreate("Form1", 264, 193)
$Radio1 = GUICtrlCreateRadio("C:\", 8, 16, 121, 17)
$Radio2 = GUICtrlCreateRadio("D:\", 8, 40, 121, 17)
$path = GUICtrlCreateInput("", 8, 96, 233, 21)
$Label1 = GUICtrlCreateLabel("Installation path:", 8, 72, 81, 17)
$continue = GUICtrlCreateButton("Continue", 8, 160, 121, 25, 0)
$cancel = GUICtrlCreateButton("Cancel", 136, 160, 121, 25, 0)
GUISetState(@SW_SHOW)


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Radio1
            GUICtrlSetData($path,"C:\My Program")
        Case $Radio2
            GUICtrlSetData($path,"D:\My Program")
        Case $continue
            $var = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\FLEXlm License Manager", "Service")
            If $var="whatever value tells you it's already installed" Then
                MsgBox(0,"Error","The program is already installed")
                Exit
            Else
                ;Do your installation stuff
            EndIf
        Case $cancel
            Dim $iMsgBoxAnswer
            $iMsgBoxAnswer = MsgBox(52,"Exit","Quit installer?")
            Select
               Case $iMsgBoxAnswer = 6 ;Yes
                    Exit
            EndSelect
    EndSwitch
WEnd

Here, pretty much what you asked for I think... Just one suggestion, don't ask for this kind of things in the future, they can be easily figured out with a minor effort. Use the examples and the help file. Search the forums too. :)

Link to comment
Share on other sites

Thanks for your help on this..

I did look through the help file and DID search the forums on this. Just remember, not everyone is a programmer and some things are not as obvious as it would be to others, but I do appreciate the help. (Learning by example)

Link to comment
Share on other sites

Thanks for your help on this..

I did look through the help file and DID search the forums on this. Just remember, not everyone is a programmer and some things are not as obvious as it would be to others, but I do appreciate the help. (Learning by example)

Yes, I understand that. I'm no expert either! and there was a time when I didn't know a thing about AutoIt. You have no idea how much I learned from the examples AutoIt comes with. I always read the help file too.

Sorry if I was rude, I didn't mean to.

Another suggestion: Download Koda: http://www.autoitscript.com/forum/index.php?showtopic=32299 it's awesome for designing your apps :)

Link to comment
Share on other sites

Yes, I understand that. I'm no expert either! and there was a time when I didn't know a thing about AutoIt. You have no idea how much I learned from the examples AutoIt comes with. I always read the help file too.

Sorry if I was rude, I didn't mean to.

Another suggestion: Download Koda: http://www.autoitscript.com/forum/index.php?showtopic=32299 it's awesome for designing your apps :)

Hey, No problem. What you did send was extremly helpful and opened my mind to other ideas on the project. It is coming to gether slowly. Aiming for a "One Button" software install for hundreds of users. Thanks again.

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...