ZenKensei Posted March 15, 2005 Posted March 15, 2005 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}") ExitBelow is what should be Adlib 1Func _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}") EndFuncBelow is what should be Adlib 2Func _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
Blue_Drache Posted March 15, 2005 Posted March 15, 2005 (edited) Below is what should be Adlib 1Func _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}") EndFuncBelow is what should be Adlib 2Func _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 March 15, 2005 by Blue_Drache Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now