Sign in to follow this  
Followers 0
Guest DWhittier

QUESTION: Looking for Help with Adlib()

6 posts in this topic

Hi there.

I have been trying to automate an install program that tries to replace some dlls with older versions, and causes a confirmation prompt to appear. The number of times this prompt appears varies, depending on the machine.

I was advised in this forum that the Adlib() function is the way to make this work.

I have attempted to make this work, but have failed. Everything works fine until the "Version Conflict" prompt appears. Previously I had included a few WinWaitActive lines for these, which worked - but again, since the number of these varies, it would not be reliable.

Could someone have a quick look at this, and see if they can spot my error?

Many thanks for all suggestions.

Cheers,

Doug Whittier

_____________________

AdlibEnable("myadlib")

Run("setup.exe")

WinWaitActive("ESP Report Viewer Setup")

Send(" ")

WinWaitActive("License Agreement")

Send("!y")

WinWaitActive("ESP Report Viewer Setup")

Send(" ")

WinWaitActive("ESP Report Viewer - Choose Program Group")

Send("!c")

Func myadlib()

If WinActive("Version Conflict") Then

Send("!y")

EndIf

EndFunc

WinWaitActive("ESP Report Viewer Setup")

Send(" ")

Exit

_____________________________

Share this post


Link to post
Share on other sites



Send(" ")

I do not understand what you are sending?

Did you get that from the help guide?

Share this post


Link to post
Share on other sites

Hi there.

I have been trying to automate an install program that tries to replace some dlls with older versions, and causes a confirmation prompt to appear. The number of times this prompt appears varies, depending on the machine.

I was advised in this forum that the Adlib() function is the way to make this work.

I have attempted to make this work, but have failed. Everything works fine until the "Version Conflict" prompt appears. Previously I had included a few WinWaitActive lines for these, which worked - but again, since the number of these varies, it would not be reliable.

Could someone have a quick look at this, and see if they can spot my error?

Many thanks for all suggestions.

Cheers,

Doug Whittier

_____________________

AdlibEnable("myadlib")

Run("setup.exe")

WinWaitActive("ESP Report Viewer Setup")

Send(" ")

WinWaitActive("License Agreement")

Send("!y")

WinWaitActive("ESP Report Viewer Setup")

Send(" ")

WinWaitActive("ESP Report Viewer - Choose Program Group")

Send("!c")

Func myadlib()

    If WinActive("Version Conflict") Then

    Send("!y") 

    EndIf

EndFunc

WinWaitActive("ESP Report Viewer Setup")

Send(" ")

Exit

_____________________________

<{POST_SNAPBACK}>

I am not really fluent in the ways of the adlib, but you script doesn't have much length to it. Is there any chance that the script exits before 250 ms (defualt adlib time) times out? You never actually say what the script is doing that it shouldn't be, what makes you think it isnt working?

*** Matt @ MPCS

Share this post


Link to post
Share on other sites

Sorry for the lack of clarity...

The "Send (" ")" line sends a space character. I've replaced those lines with "Send ("{SPACE}") and the behavior is identical.

The problem is that, as the script is now, when the "Version Conflict" prompt appears, nothing happens. It is as if the script just STOPS. With individual "WinWaitActive" lines, it worked fine, but the number of conflict prompts varied - so I don't see how I can reliably use the individual WinWaitActive lines.

Share this post


Link to post
Share on other sites

Sorry for the lack of clarity...

The "Send (" ")" line sends a space character. I've replaced those lines with "Send ("{SPACE}") and the behavior is identical.

The problem is that, as the script is now, when the "Version Conflict" prompt appears, nothing happens. It is as if the script just STOPS. With individual "WinWaitActive" lines, it worked fine, but the number of conflict prompts varied - so I don't see how I can reliably use the individual WinWaitActive lines.

<{POST_SNAPBACK}>

Are the version confict windows getting the focus?

If not you might want to do:

Func myadlib()
    If WinExists("Version Conflict") Then
      Winactivate("Version Conflict")
      Send("!y")    
    EndIf
EndFunc

Its by the way better when you work with control commands when possible.


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Sorry for the lack of clarity...

The "Send (" ")" line sends a space character. I've replaced those lines with "Send ("{SPACE}") and the behavior is identical.

The problem is that, as the script is now, when the "Version Conflict" prompt appears, nothing happens. It is as if the script just STOPS. With individual "WinWaitActive" lines, it worked fine, but the number of conflict prompts varied - so I don't see how I can reliably use the individual WinWaitActive lines.

<{POST_SNAPBACK}>

Is your script still running when the window pops-up? You may want to put a msgbox at the end of your script to make sure your script didn't just fall through without picking up the adlib.

*** Matt @ MPCS

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