Sign in to follow this  
Followers 0
dsvpcsupport

IF WINEXISTS not working ?

3 posts in this topic

Sorry newbie to this and despite hours of fiddling & staring at the code cannot get this to work. It's just for Autoroute install, and if NET 1.1 is not installed it comes up with an extra window at the start of install.

Idea was test if Net exists, click on OK on this window to install Net 1.1, and then continue on with rest of install. Works perfectly without the IF THEN, so must be this that is not working, but I cannot see where. It just stops on the Window and does not process the Controlclick to continue.

Here's the text, any ideas very gratefully recieved :) :

If Winexists ("Microsoft AutoRoute 2007 Setup","requires additional system components") Then

WinWaitActive ("Microsoft AutoRoute 2007 Setup","requires additional system components")

WinActivate("Microsoft AutoRoute 2007 Setup","requires additional system components")

ControlClick("Microsoft AutoRoute 2007 Setup","requires additional system components", 1, "OK")

EndIf

WinWaitActive ("Microsoft AutoRoute 2007 Setup", "Welcome!")

send("!n")

WinWaitActive ("Microsoft AutoRoute 2007 Setup", "Please enter your information.")

send("!n")

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Seems like a good time to use AdlibEnable() to check for a window that may or may not appear. I did a little change to your example so hope it works ok for you.

AdlibEnable('_Adlib'); enable constant check for possible window

WinWait("Microsoft AutoRoute 2007 Setup", "Welcome!")
ControlClick("Microsoft AutoRoute 2007 Setup", "Welcome!", "&Next")

AdlibDisable(); disable constant check for possible window

WinWait("Microsoft AutoRoute 2007 Setup", "Please enter your information.")
ControlClick("Microsoft AutoRoute 2007 Setup", "Please enter your information.", "&Next")

Func _Adlib()
    If Winexists ("Microsoft AutoRoute 2007 Setup","requires additional system components") Then
        ControlClick("Microsoft AutoRoute 2007 Setup","requires additional system components", "OK")
    EndIf
EndFunc

:)

Edit:

Updated ControlID parameters

Edited by MHz

Share this post


Link to post
Share on other sites

It works :)

Thank you so much for your help - very very grateful.

Share this post


Link to post
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
Sign in to follow this  
Followers 0