Jump to content

Choose between 2 windows


 Share

Recommended Posts

Hi Men, I want to install divxplay but it comes with googletoolbar, Then when i install it on a computer which has been already installed googletoolbar, the windows for installing the google doesnt appear, but if i install it in a computer which hasnt been installed google, the windows for installing google appear.

I want to write a command that:

if appears the windows (to install google) ---> choose no or yes

if doesnt appear the windows ---> execute the following sentence.

Sorry for my poor english and thanks in advance

Link to comment
Share on other sites

You could probably use WinWait with a timeout value to see if it's going to show up or not. Then, use the result from that in an if statement :whistle:

$result = WinWait("Title of google popup", "optional text in the popup", 5)

If $result = 1 Then

<code to install google>

Else

<check if the next window after the google window exists here FIRST!!!>

<code to continue without google>

EndIf

Edited by HeX
Link to comment
Share on other sites

need some info

you have no script.... right?

you want to install this on other computers... right?

you want an "auto-install" script... right?

Do you want the google to install....???

Do you down-load the install-program from the internet each time...?

NEED INPUT

8)

NEWHeader1.png

Link to comment
Share on other sites

Here is my script:

AutoItSetOption("WinTitleMatchMode", 1)

$SF= "DivXPlay.exe" ;Setup file name

Run($SF)

WinWaitActive("Language selection")

Send("{ENTER}")

WinWaitActive("DivX Play Bundle Setup")

Send("{ENTER}")

WinWaitActive("DivX Play Bundle Setup")

ControlClick("DivX Play Bundle Setup", "", "Button4")

Send("{ENTER}")

WinWaitActive("DivX Play Bundle Setup")

ControlSend("DivX Play Bundle Setup","","SysTreeView321", "{RIGHT}{DOWN 2}{SPACE}{DOWN}{SPACE}{DOWN}{SPACE}{DOWN}{SPACE}{DOWN 2}{SPACE}")

Send("!N")

HERE WHERE I WANT TO PUT THE SENTENCE SUGGESTED BY HEX

WinWaitActive("DivX Play Bundle Setup")

Send("!N")

WinWaitActive("DivX Play Bundle Setup", "Installation Complete")

Send("!C")

Link to comment
Share on other sites

do you want to install the google...

if not it looks as if you are at the final stage of the divx install and maybe could... replace your line with this

$PID = Run($SF)

then where the line you want to check is... put this

"If $PID Then ProcessClose($PID)"

8)

LET ME KNOW IF THIS WORKED...OK???

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

I have put, but when it doesnt appear the windows (Google), it doesnt close the last windows. the other case works fine (when google appears)

I will try your method and thanks man, i will tell you if it has worked or not

AutoItSetOption("WinTitleMatchMode", 1)

$SF= "DivXPlay.exe" ;Setup file name

Run($SF)

WinWaitActive("Language selection")

Send("{ENTER}")

WinWaitActive("DivX Play Bundle Setup")

Send("{ENTER}")

WinWaitActive("DivX Play Bundle Setup")

ControlClick("DivX Play Bundle Setup", "", "Button4")

Send("{ENTER}")

WinWaitActive("DivX Play Bundle Setup")

ControlSend("DivX Play Bundle Setup","","SysTreeView321", "{RIGHT}{DOWN 2}{SPACE}{DOWN}{SPACE}{DOWN}{SPACE}{DOWN}{SPACE}{DOWN 2}{SPACE}")

Send("!N")

winWaitActive("DivX Play Bundle Setup")

Send("!N")

$Result = WinWait("DivX Play Bundle Setup", "Google Toolbar")

IF $Result = 1 Then

ControlClick("DivX Play Bundle Setup", "Google Toolbar", "", "Button5")

Send("!I")

WinWaitActive("DivX Play Bundle Setup", "Installation Complete")

Send("!C")

ELSE

WinWaitActive("DivX Play Bundle Setup", "Installation Complete")

Send("!C")

ENDIF

EXIT

Link to comment
Share on other sites

Here are the images of what i want. i explain you.

I click the image1:

If i have already installed google toolbar, divx will be installed directly and it passes to image 3

If i have not already installed google toolbar, setup passes to image 2, i will tell the setup not to install toolbar and i click install to install divx, and finally the setup passes to image 3

Posted ImagePosted ImagePosted Image

Link to comment
Share on other sites

okie dokie then.... lets try this

AutoItSetOption("WinTitleMatchMode", 1)
$SF= "DivXPlay.exe";Setup file name
Run($SF)

WinWaitActive("Language selection")
Send("{ENTER}")
WinWaitActive("DivX Play Bundle Setup")
Send("{ENTER}")
WinWaitActive("DivX Play Bundle Setup")
ControlClick("DivX Play Bundle Setup", "", "Button4")
Send("{ENTER}")
WinWaitActive("DivX Play Bundle Setup")
ControlSend("DivX Play Bundle Setup","","SysTreeView321", "{RIGHT}{DOWN 2}{SPACE}{DOWN}{SPACE}{DOWN}{SPACE}{DOWN}{SPACE}{DOWN 2}{SPACE}")
Send("!N")
winWaitActive("DivX Play Bundle Setup")
Send("!N")

While 1
    $Result = ControlCommand("DivX Play Bundle Setup", "Google Toolbar", "", "IsEnabled", "" )
        IF $Result = 1 Then
        ControlClick("DivX Play Bundle Setup", "Google Toolbar", "", "Button5")
        Send("!I")
        WinWaitActive("DivX Play Bundle Setup", "Installation Complete")
        Send("!C")
        ExitLoop
    EndIf

    $func1 = ControlCommand("DivX Play Bundle Setup", "Installation Complete", "", "IsEnabled", "")
    If $func1 = 1 Then 
        Send("!C")
        ExitLoop
    EndIf
WEnd

let me know

8)

NEWHeader1.png

Link to comment
Share on other sites

To those helping Delai,

Isn't there a file or registry setting that could be checked to (reliably?) determine if the google tool bar has been installed already. If so, then I would wrap the "google screen" code in an "if/endif" that checks for that file/key.

just a thought...

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

To those helping Delai,

Isn't there a file or registry setting that could be checked to (reliably?) determine if the google tool bar has been installed already. If so, then I would wrap the "google screen" code in an "if/endif" that checks for that file/key.

just a thought...

<{POST_SNAPBACK}>

We are in the middle of one page on an installation... just thought continuing using this direction was the best... and understandable for Delai

8)

NEWHeader1.png

Link to comment
Share on other sites

:dance::whistle: It works fine, very fine. Thank you very much Valuater and also Hex.

It is better programmed.

I have a question, i have noticed in the sentence that it doesnt select (not to install), like if it didnt any effect

ControlClick("DivX Play Bundle Setup", "Google Toolbar", "", "Button5")

Then i have tried with the old method:

Send("{DOWN}").

and it did effect.

Thanks

Link to comment
Share on other sites

This is the Final Script, i have changed the line whant i have mentioned above:

AutoItSetOption("WinTitleMatchMode", 1)

$SF= "DivXPlay.exe";Setup file name

Run($SF)

WinWaitActive("Language selection")

Send("{ENTER}")

WinWaitActive("DivX Play Bundle Setup")

Send("{ENTER}")

WinWaitActive("DivX Play Bundle Setup")

ControlClick("DivX Play Bundle Setup", "", "Button4")

Send("{ENTER}")

WinWaitActive("DivX Play Bundle Setup")

ControlSend("DivX Play Bundle Setup","","SysTreeView321", "{RIGHT}{DOWN 2}{SPACE}{DOWN}{SPACE}{DOWN}{SPACE}{DOWN}{SPACE}{DOWN 2}{SPACE}")

Send("!N")

winWaitActive("DivX Play Bundle Setup")

Send("!N")

While 1

$Result = ControlCommand("DivX Play Bundle Setup", "Google Toolbar", "", "IsEnabled", "" )

IF $Result = 1 Then

Send("{DOWN}")

Send("!I")

WinWaitActive("DivX Play Bundle Setup", "Installation Complete")

Send("!C")

ExitLoop

EndIf

$func1 = ControlCommand("DivX Play Bundle Setup", "Installation Complete", "", "IsEnabled", "")

If $func1 = 1 Then

Send("!C")

ExitLoop

EndIf

WEnd

:whistle: I HAVE TRIED IT WITH GOOGLE TOOLBAR ALREADY INSTALLED AND WITHOUT GOOGLE TOOLBAR. IT WORKS VERY FINE IN BOTH CASES.

THANKS MEN.

Link to comment
Share on other sites

EDIT: Got it 8)

Dim $fileExists
$fileExists =  FileExists(@ProgramFilesDir & "\DivX\DivxPlay.exe"); change to correct location
    


If $fileExists = 1 then 
    MsgBox(0,"DivX Play Installer", " The DivX Play Program is already installed")
    Exit
EndIf

If $fileExists = 0 then
        
        $ans = MsgBox(4100, "DivX Play Installer", "DivX Player is not installed,  Do you wish to download and install now?  ")
    
        If $ans = 7 Then Exit
        If $ans = 6 Then Sleep(200)

    dim $Size
    $Size=InetGetSize("http://go.divx.com/pad/divx/play/DivXPlay.exe")
    ProgressOn("DivX Player","Downloading")
    $r=InetGet("http://go.divx.com/pad/divx/play/DivXPlay.exe", @DesktopDir & "\divXPlay.exe" , 0, 1)
    if $r=0 then
        ProgressOff()       
        msgbox(0,"Error","Cant connect to the internet!!")
        Exit
    EndIf
    
    While @InetGetActive
        ProgressSet(@InetGetBytesRead / $Size * 100,Round( @InetGetBytesRead / $Size * 100,0) & " %")
        Sleep(250)
    Wend
    ProgressOff()


Sleep (200)
EndIf

You can place this above your script to down-load ... then install

enjoy!

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

...just thought continuing using this direction was the best...

<{POST_SNAPBACK}>

...what you posted was great - had I seen it before I posted my two little sentences, I would not have posted.

The more I think about it, the more useless my coding method would have been. If the DivX installer thinks that the google bar is not installed (even if it is) then you need to deal with that middle screen (like your code did).

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

...what you posted was great - had I seen it before I posted my two little sentences, I would not have posted.

The more I think about it, the more useless my coding method would have been. If the DivX installer thinks that the google bar is not installed (even if it is) then you need to deal with that middle screen (like your code did).

<{POST_SNAPBACK}>

Thanks.. plato

and... your thoughts are always welcome

8)

NEWHeader1.png

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