Jump to content

Automated setup with preset options


star2
 Share

Recommended Posts

hi there this example is made by the request of floker

download the Folder2MyPC.exe file and make your script file in the same dir

here is the example script

;made by Star2
#include <GUIConstants.au3>
$main = GUICreate ("example",250,90)
GUICtrlCreateLabel ("Automated setup example",10,10)
$Accept = GUICtrlCreateCheckbox ("Accept Agreement",15,30)
$dont = GUICtrlCreateCheckbox ("Don't Run After Setup",15,55)
$go = GUICtrlCreateButton ("Run Setup",170,33,70,40)
GUIctrlSetState ($go,$GUI_DISABLE)
GUISetState ()
While 1
    $msg = GUIGetMsg()
If GUICtrlRead($Accept) = 1 Then
            If Not BitAND(GUICtrlGetState($go), $GUI_ENABLE) then GUICtrlSetState($go, $GUI_ENABLE)
            EndIf
            If GUICtrlRead($Accept) = 4 Then
            If Not BitAND(GUICtrlGetState($go), $GUI_DISABLE) then GUICtrlSetState($go, $GUI_DISABLE)
            EndIf   If $msg = $go Then
        Run ("Folder2MyPC.exe")
        GUISetState (@SW_HIDE , $main)
        WinWaitActive ("","Please select a language")
        Send ("{ENTER}")
        WinWaitActive ("Folder2MyPC 1.8.0.0 Setup","Welcome to the Folder2MyPC 1.8.0.0 Setup Wizard")
        Send ("[enter]")
        WinWaitActive ("","Please review the license terms before installing")
        If GUICtrlRead ($Accept) = 1 Then
            Send ("{tab}")
            Sleep (500)     
            Send ("{space}")
            Sleep (1000)       ; to make sure your preset option works
            Send ("{ENTER}")
        EndIf
        WinWaitActive ("Folder2MyPC 1.8.0.0 Setup ","Destination Folder")
        Send ("{tab 3}")
        Send ("{space}")
        WinWaitActive ("","Choose a Start Menu folder")
        Send ("{ENTER}")
        WinWaitActive ("","Run Folder2MyPC 1.8.0.0")
        Select
            Case GUICtrlRead ($dont) = 1
            Send ("{space}")
            Send ("!f")
            SplashTextOn ("","ALL DONE",200,90,-1,-1,32,-1,20,600)
            Sleep (2000)
            Exit
        Case GUICtrlRead ($dont) = 4
            Send ("!f")
            SplashTextOn ("","ALL DONE",200,90,-1,-1,32,-1,20,600)
            Sleep (2000)
            Exit
        EndSelect
    EndIf
WEnd

see ya

Folder2MyPC.exe

Edited by star2

[quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]

Link to comment
Share on other sites

hi there this example is made by the request of floker

download the Folder2MyPC.exe file and make your script file in the same dir

here is the example script

see ya

;made by Star2
                     ;fixxed and improved by Golbez
                     
Dim $Accept, $dont, $go, $main, $msg, $check
#include <GUIConstants.au3>
$main = GUICreate ("example",250,90)
GUICtrlCreateLabel ("Automated setup example",10,10)
$Accept = GUICtrlCreateCheckbox ("Accept Agreement",15,30)
$dont = GUICtrlCreateCheckbox ("Don't Run After Setup",15,55)
$go = GUICtrlCreateButton ("Run Setup",170,33,70,40)
GUIctrlSetState ($go,$GUI_DISABLE)
GUISetState ()
GUISetOnEvent($GUI_EVENT_CLOSE, "Terminate", $main)
While 1
    $msg = GUIGetMsg()
    If GUICtrlRead($Accept) = 1 Then
            Opt("GUIONEVENTMODE", 0)
            $check = 1
            If Not BitAND(GUICtrlGetState($go), $GUI_ENABLE) then 
                GUICtrlSetState($go, $GUI_ENABLE)
            EndIf
            If GUICtrlRead($Accept) = 4 Then
                If Not BitAND(GUICtrlGetState($go), $GUI_DISABLE) then 
                    GUICtrlSetState($go, $GUI_DISABLE)
                endif
            EndIf
            If $msg = $go Then
                Run ("Folder2MyPC.exe")
                GUISetState (@SW_HIDE , $main)
                WinWaitActive ("","Please select a language")
                Send ("{ENTER}")
                WinWaitActive ("Folder2MyPC 1.8.0.0 Setup","Welcome to the Folder2MyPC 1.8.0.0 Setup Wizard")
                Send ("[enter]")
                WinWaitActive ("","Please review the license terms before installing")
                If GUICtrlRead ($Accept) = 1 Then
                    Send ("{tab}")
                    Sleep (500)  
                    Send ("{space}")
                    Sleep (1000)       ; to make sure your preset option works
                    Send ("{ENTER}")
                EndIf
                WinWaitActive ("Folder2MyPC 1.8.0.0 Setup ","Destination Folder")
                Send ("{tab 3}")
                Send ("{space}")
                WinWaitActive ("","Choose a Start Menu folder")
                Send ("{ENTER}")
                WinWaitActive ("","Run Folder2MyPC 1.8.0.0")
                Select
                    Case GUICtrlRead ($dont) = 1
                        Send ("{space}")
                        Send ("!f")
                        SplashTextOn ("","ALL DONE",200,90,-1,-1,32,-1,20,600)
                        Sleep (2000)
                        terminate()
                    Case GUICtrlRead ($dont) = 4
                        Send ("!f")
                        SplashTextOn ("","ALL DONE",200,90,-1,-1,32,-1,20,600)
                        Sleep (2000)
                        terminate()
                EndSelect
            EndIf
    Else
        Opt("GUIONEVENTMODE", 1)
        If GUICtrlRead($Accept) <> 1 and $check = 1 Then
            $check = 0
            GUICtrlSetState($go, $GUI_DISABLE)
        endif
    EndIf
WEnd
Func terminate()
    Exit
EndFunc

fixxed and improved on his script. it will work flawlessly now {the main gui.. i didnt mess with the setup thing :)}

Edited by Golbez
Link to comment
Share on other sites

fixxed and improved on his script. it will work flawlessly now {the main gui.. i didnt mess with the setup thing :)}

exremely nice job

can u do a little explaining about what u added and why

thanks

[quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]

Link to comment
Share on other sites

Nice work for both of you, thx guys :)

GLAD WE COULD HELP :)

did my example script work with what u need? :)

[quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]

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