Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Install Sheild automation issue

$
0
0
Hello All,

I am facing a very strange issue. I am trying to automate and installer. When the installer finishes copying over the files, it Tries to start a couple of services on my PC. However since my PC does not have admin rights it fails. Now since this is an error condition, I have come up with a structure like this:

I declare 3 functions namely Error_Condition, Error_Handler() and Post_Install

Error_Condition() checks if the error has happened and whether any popup window with Text "Error" is active. If it gets the popup window in the active state, it call the finction Error_Handler() which actually Finds the error message and logs it in a log file. Else if there is no popup then it goes to the Post_Install() part which is nothing but clicking the Finish button on the final window.

Below is the code for the function Error_Condition()


Func Error_Condition()
   $state = WinWaitActive("Installer window name","Error")

If $state<>0 Then
Error_Handler()
Do
Sleep(1000)
ElseIf $state=0 Then
Post_Install()
EndIf

EndFunc

=========================================================================================

Now the problem which I am facing is very strange. When the error happens and the popup window is active, the If statement is executed properly. However when there is no error and the installation is successful, then it does not go the Else section of the code.

Any help from the forum to handle this would be highly appreciated. Also since I am very new to Autoit, would appreciate if the solution is elaborate.

Regards,
Hirak

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>