Sign in to follow this  
Followers 0
ZenKensei

multiple adlib functions possible?

2 posts in this topic

Group,

I'm working on a script to install 2 pieces of software and am faced with an Adlib function problem. Is it possible to call (or enable) multiple Adlib functions at one time? And if so what is the syntax? If not, how could I combine the 2 Adlibs to work in one function, as there may be times when Adlib 1 is not necessary but Alib 2 is. Please see the example code below, Adlib 1 comes into play if the software install package detects a previous installation. Adlib 2, where necessary, would always be past a point where Alib 1 would have been needed. Therefore, one simple function combining the 2 has always failed because the triggers for Adlib 1 may not happen before Adlib 2 is needed (confused yet? I am...). My assumption is that I can only run 1 Adlib function at a time, if I add a second one it is only overwriting the first one, in the example below only _PreviousInst would be active. If that is the case, how can I create one Adlib function from the examples below to be used?

AdlibEnable("_HWConfirm")
AdlibEnable("_PreviousInst")

Opt("WinWaitDelay",100)
Opt("WinTitleMatchMode",4)
Opt("WinDetectHiddenText",1)
; Opt("MouseCoordMode",0)
Run('E:\AutoIT\GUI Scripts\Projects\Sprint & VPN Software\VPN Client v4.0\Setup.exe')
WinWait("Cisco Systems VPN Client Setup","Yes, I want to resta")
If Not WinActive("Cisco Systems VPN Client Setup","Yes, I want to resta") Then WinActivate("Cisco Systems VPN Client Setup","Yes, I want to resta")
WinWaitActive("Cisco Systems VPN Client Setup","Yes, I want to resta")
Send("{DOWN}{ENTER}")
Exit

Below is what should be Adlib 1

Func _PreviousInst
WinWait("Question","Setup has detected a")
If Not WinActive("Question","Setup has detected a") Then WinActivate("Question","Setup has detected a")
WinWaitActive("Question","Setup has detected a")
Send("{TAB}{ENTER}")
EndFunc

Below is what should be Adlib 2

Func _HWConfirm ()
    WinWait("Hardware Installation","The software you are")
If Not WinActive("Hardware Installation","The software you are") Then WinActivate("Hardware Installation","The software you are")
WinWaitActive("Hardware Installation","The software you are")
Send("{SHIFTDOWN}{TAB}{SHIFTUP}{ENTER}")
EndFunc

I seem to be running into a single, linear logic problem with the adlib, if the first trigger hasn't been met, the second trigger is never checked.

As always, any help or suggestions are greatly appreciated.

Thanks,

ZK

Share this post


Link to post
Share on other sites

#2 ·  Posted (edited)

Below is what should be Adlib 1

Func _PreviousInst
WinWait("Question","Setup has detected a")
If Not WinActive("Question","Setup has detected a") Then WinActivate("Question","Setup has detected a")
WinWaitActive("Question","Setup has detected a")
Send("{TAB}{ENTER}")
EndFunc

Below is what should be Adlib 2

Func _HWConfirm ()
    WinWait("Hardware Installation","The software you are")
If Not WinActive("Hardware Installation","The software you are") Then WinActivate("Hardware Installation","The software you are")
WinWaitActive("Hardware Installation","The software you are")
Send("{SHIFTDOWN}{TAB}{SHIFTUP}{ENTER}")
EndFunc

    I seem to be running into a single, linear logic problem with the adlib, if the first trigger hasn't been met, the second trigger is never checked.

As always, any help or suggestions are greatly appreciated.

Thanks,

ZK

<{POST_SNAPBACK}>

AdLibEnable("_Whatever")
.
.
.



Func _Whatever()
   Select
      Case WinExists("Question","Setup has detected a") = 1
          _PreviousInst()
      Case WinExists("Hardware Installation","The software you are") = 1
          _HWConfirm ()
   EndSelect
EndFunc
Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

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