Jump to content

QUESTION: Looking for Help with Adlib()


Guest DWhittier
 Share

Recommended Posts

Guest DWhittier

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

_____________________________

Link to comment
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

Link to comment
Share on other sites

Guest DWhittier

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.

Link to comment
Share on other sites

  • Developers

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.

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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

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