pravi1986 Posted March 25, 2013 Share Posted March 25, 2013 Hi, I am running an XmlRpc client/server program, in which the Client side python code triggers the Autoit script("kumar.exe") which is to perform an application installation. Autoit script is in server side and it is triggered from client machine. here when the autoit script gets triggered , the installation setup window loses it's control and hence the installation is not proceeding. Can anyone help in solving this problem ?? Client side python code: ----------------------------------------------------------------------------------------------------------------- import xmlrpclib import sys proxy = xmlrpclib.ServerProxy('http://'+sys.argv[1]+':8001') #print ("AutoIT script trigger output %s" % str(proxy.ads_trigger("c:\Sharing\kumar.exe"))) get_line = proxy.ads_trigger("c:\Sharing\kumar.exe") out_file = open(r"c:\builds\ads-log248.txt", "w") out_file.write("%s" %(get_line)) out_file.close( --------------------------------------------------------------------------------------------------------------- AutoIT Script code: --------------------------- #include <Process.au3> #Include <GuiToolBar.au3> #include <GUIConstantsEx.au3> ADS_Install() Exit Func ADS_Install() RunAsWait("Administrator", "", "Emc@123", 0, "C:\Sharing\abcd.exe") WinWaitActive($val, "Welcome to the Avamar Downloader") Send("{ENTER}") WinWaitActive($val, "Install Avamar Downloader") Send("{ENTER}") WinWaitActive($val, "&Install") Send("{ENTER}") WinWaitActive($val, "&Finish") Send("{ENTER}") EndFunc Link to comment Share on other sites More sharing options...
JohnOne Posted March 25, 2013 Share Posted March 25, 2013 Your AutoIt code does not know what the variable "$val" is. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
pravi1986 Posted March 25, 2013 Author Share Posted March 25, 2013 thanks and Yes that $val value i am reading it as a string value.here when the autoit script gets triggered , the installation setup window loses it's control and hence the installation is not proceeding.Any idea or any solution to this issue.? Link to comment Share on other sites More sharing options...
BrewManNH Posted March 25, 2013 Share Posted March 25, 2013 This topic should really be in General Help & Support, but anyways, you should use ControlSend instead of Send, then it won't matter what window is the active one. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
pravi1986 Posted March 26, 2013 Author Share Posted March 26, 2013 I have tried ControlSend instead of Send and still it's not solving the problem. Any other solution for the issue. Link to comment Share on other sites More sharing options...
JohnOne Posted March 26, 2013 Share Posted March 26, 2013 how about expanding on this the installation setup window loses it's controland posting your full code, instead of giving us little snippets.It's in your own best interests. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
pravi1986 Posted March 26, 2013 Author Share Posted March 26, 2013 AutoIT complete code: --------------------------- #include <Process.au3> #Include <GuiToolBar.au3> #include <GUIConstantsEx.au3> Local $install = "C:SharingDownloaderService-7.0.0-1.exe" ADS_Install() Exit Func ADS_Install() Run($install) WinWaitActive("Downloader Service 7.0.0.1 setup", "Welcome to the Downloader service") Send("!n") WinWaitActive("Downloader Service 7.0.0.1 setup", "Install Downloader service") Send("!n") WinWaitActive("Downloader Service 7.0.0.1 setup", "&Install") Send("{ENTER}") WinWaitActive("Downloader Service 7.0.0.1 setup", "&Finish") Send("{ENTER}") EndFunc Link to comment Share on other sites More sharing options...
BrewManNH Posted March 26, 2013 Share Posted March 26, 2013 Where do you have an issue with this in the code above, where is it not sending the correct information to the correct screen. Also, what is taking focus away from this installer when you run it? If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
pravi1986 Posted March 26, 2013 Author Share Posted March 26, 2013 Hi,When the installation is trigger from the client side, the installation window lost it's control and hence the installation is not proceeding.Please help me out in resolving the issue. Please find the attached screenshot of the issue state.Below the complete code informationPython version used : 2.7.3Host Machine IP : 10.110.112.121Run the server code first and then start the client side code.In server machine : - server side code, autoitscript.exe, application to be installed(.exe file)In Client machine : - client side codeAutoit code:#include <Process.au3>#Include <GuiToolBar.au3>#include <GUIConstantsEx.au3>Firefox_Install()ExitFunc Firefox_Install() Run("C:\Sharing\Firefox Setup 18.0.2.exe") WinWaitActive("Mozilla Firefox Setup", "Welcome to the Mozilla Firefox Setup Wizard") Send("{ENTER}") WinWaitActive("Mozilla Firefox Setup", "Setup Type") Send("{ENTER}") WinWaitActive("Mozilla Firefox Setup", "Summary") Send("{ENTER}")EndFuncServer Side Code (rpc_server.py)------------------------------------------import xmlrpclibimport os,sys,refrom SimpleXMLRPCServer import SimpleXMLRPCServerglobal cmd_outdef ads_trigger(n): cmd_out = os.popen("%s" %(n))server = SimpleXMLRPCServer(("10.110.112.121", 8001))print ("Listening on port 8001...")server.register_function(ads_trigger, "ads_trigger")server.serve_forever()-----------------------------------------Machine IP : 10.110.112.121Client Side Code (rpc_client.py)----------------------------------------import xmlrpclibimport sysproxy = xmlrpclib.ServerProxy('http://'+sys.argv[1]+':8001')proxy.ads_trigger("c:\Sharing\autoitscript.exe")----------------------------------------In the command prompt, type “python rpc_client.py 10.110.112.121” Link to comment Share on other sites More sharing options...
pravi1986 Posted March 28, 2013 Author Share Posted March 28, 2013 Can anyone help me out on this issue.. i am struggling on this for quite some time. Thanks in advance. Link to comment Share on other sites More sharing options...
BrewManNH Posted March 28, 2013 Share Posted March 28, 2013 Do you need Python to be able to launch the script? If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
pravi1986 Posted March 28, 2013 Author Share Posted March 28, 2013 Yes, we need Python installed in order to run python script which in turn trigger's Autoit script. Link to comment Share on other sites More sharing options...
BrewManNH Posted March 28, 2013 Share Posted March 28, 2013 What I meant was, do you need python to launch the script, or could you launch the script another way? If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
pravi1986 Posted March 28, 2013 Author Share Posted March 28, 2013 Yes, i am using python to trigger autoit script. Link to comment Share on other sites More sharing options...
LarryDalooza Posted March 28, 2013 Share Posted March 28, 2013 A fundamental in interacting with windows... is... WinWait() for the window... If Not WinActive Then WinActivate() the window... WinWaitActive() the window. However, I am sure there are command line parameters to pass to make it install automatic without interaction. Lar. AutoIt has helped make me wealthy Link to comment Share on other sites More sharing options...
pravi1986 Posted March 29, 2013 Author Share Posted March 29, 2013 Can you please share those info of how to perform installation command line. Link to comment Share on other sites More sharing options...
LarryDalooza Posted March 29, 2013 Share Posted March 29, 2013 I can't believe, after 13 years, I am still googling for people... Try the -ms switch... "Firefox Setup 18.0.2.exe" -ms ... get your quotes right or I am going to lobby for your banishment Lar AutoIt has helped make me wealthy Link to comment Share on other sites More sharing options...
pravi1986 Posted March 29, 2013 Author Share Posted March 29, 2013 Still it's not working. Any other option ?? Link to comment Share on other sites More sharing options...
pravi1986 Posted March 30, 2013 Author Share Posted March 30, 2013 can anyone help in resolving this issue. struggling for quite some time. Link to comment Share on other sites More sharing options...
BrewManNH Posted March 30, 2013 Share Posted March 30, 2013 Yes, i am using python to trigger autoit script.Not what I asked, what I asked was do you NEED to use Python to run the script or can you launch the exe another way?Still it's not working. Any other option ?Yes, the option is you tell us what doesn't work instead of a blanket not working post, that's not at all helpful to us or you. Once you figure out how to properly explain your problem and what you've done and what exactly isn't working and exactly how it's not working, then you should come back with a more sensible post. Otherwise you're on your own as far as I'm concerned. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
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