shhammer5634 Posted February 3, 2013 Share Posted February 3, 2013 Hello, I'm new here and to AutoIT, but not to programming/scripting in general. This is my first attempt at an AutoIT script. The purpose of the script is to install TightVNC server on the target machine, which could be any flavor of Windows from XP forward. Development is happening on Windows 7 Pro. I've managed to get past a couple hurdles, namely the open file warning, and interacting with a systreeview control to turn off the viewer portion of the install. I'm stuck in two places. One is UAC. During the actual install, Windows pops up the usual "Do you want to allow ..." message, and the install stops until you acknowledge it. I think I've seen it refered to as a secure desktop. I've tried the #Requireadmin directive, but that didn't have any effect. The other pace I'm stuck is just before the install completes, an always-on-top window opens for setting up passwords for the VNC server. What actually needs to happen is I need to click on two different radio buttons to indicate I don't want to use passwords, and then dismiss the window. I don't seem to be able to interact with this window at all. AU3Info seems to be able to identify this window and the controls on it, but that hasn't helped. There are 6 radio buttons and 4 entry fields on this window, plus a visible button at the bottom. 3 of the radio buttons and two of the entry fields are grouped together in what I would call a frames. A box comprised of a slightly sunken line with a title in the top left. AU3Info identifies this as a button. It also identifies each of the radio buttons as a button. I've tried ControlClick, ControlComand, and I've tried sending keystrokes to the windows with ControlSend. None of these seems to have any effect whatsoever. Also, the one thing that should work, which is clicking the button at the bottom of the window, does not. It's like even though I've used the _WinWaitActivate function to wait for and activate the window, the window is not truly active. It seems to actually "fall through" those four lines of code. As a debug measure, I put in a long Sleep, and the script gets to that point, or at least it seems to. Code included below. The problem area starts 4 line before the Sleep(60000) near the bottom of the code. I actually suspect that the two issues may be related, both being in a secure desktop, although the behavior of this password window isn't quite the same as UAC itself. Any and all help/comments appreciated. ----<CODE>---- #include <winapi.au3> EnvSet("SEE_MASK_NOZONECHECKS","1") ShellExecute('C:\temp\tightvnc-2.6.4-setup-32bit.msi') _WinWaitActivate("TightVNC Setup","") ControlClick("TightVNC Setup","",846) _WinWaitActivate("TightVNC Setup","License Agreement") ControlClick("TightVNC Setup","",911) ControlClick("TightVNC Setup","",846) _WinWaitActivate("TightVNC Setup","Choose Setup Type") ControlClick("TightVNC Setup","",954) _WinWaitActivate("TightVNC Setup","Server and Viewer") ControlClick("TightVNC Setup","",970,"",1,100,42) ControlSend ('TightVNC Setup',"",970,'{End}{Space}') Sleep(250) ControlSend ('TightVNC Setup',"",970,'{Down 4}{Enter}') ControlClick("TightVNC Setup","",846) _WinWaitActivate("TightVNC Setup","Select Additional Tasks") ControlClick("TightVNC Setup","",846) _WinWaitActivate("TightVNC Setup","Ready to install") ControlClick("TightVNC Setup","",879) _WinWaitActivate("TightVNC Server: Set Passwords","Please") ControlCommand("TightVNC Server: Set Passwords","Please","[CLASS:Button; INSTANCE:3]","Check","") ControlCommand("TightVNC Server: Set Passwords","Please","[CLASS:Button; INSTANCE:7]","Check","") ControlClick("TightVNC Server: Set Passwords","Please","[CLASS:Button; INSTANCE:9]") Sleep(60000) _WinWaitActivate("TightVNC Setup","") ControlClick("TightVNC Setup","",817) EnvSet("SEE_MASK_NOZONECHECKS","0") Exit Func _WinWaitActivate($title,$text,$timeout=0) WinWait($title,$text,$timeout) If Not WinActive($title,$text) Then WinActivate($title,$text) WinWaitActive($title,$text,$timeout) EndFunc Link to comment Share on other sites More sharing options...
PhoenixXL Posted February 3, 2013 Share Posted February 3, 2013 (edited) whoa! please just specify the problem I feel boresome to read a full essay !! and please post the code in [autoit] tags Nevermind if i sounded rude Edited February 4, 2013 by PhoenixXL My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression. Link to comment Share on other sites More sharing options...
Centrally Posted February 3, 2013 Share Posted February 3, 2013 (edited) ...You could make while loop that will search for that question to popup and if direct keystroke sends is not working do it hacky way with mouseclick. Edited February 3, 2013 by Centrally Link to comment Share on other sites More sharing options...
JohnOne Posted February 3, 2013 Share Posted February 3, 2013 Installing SilentlyTo install an MSI package silently from the command line, you should run the msiexec tool with /iand /quiet options (where /i stands for install, /quiet sets silent mode). For TightVNC, it would be agood idea to add the /norestart option, to prevent rebooting the system after installing the software.If everything is good, TightVNC installation should not require restart even if its previous version isrunning as a service. The installer should upgrade the system correctly, by shutting down oldservice, installing the files and then starting new service.Here is the simplest example of installing TightVNC in silent mode:• msiexec /i tightvnc-2.5.2-setup-64bit.msi /quiet /norestartThis command should install TightVNC with default settings. However, MSI allows you tocustomize installation via so called MSI properties. The general syntax is the following:• msiexec /i tightvnc-2.5.2-setup-64bit.msi /quiet /norestartPROPERTY1=value1 PROPERTY2=value2 PROPERTY3=value3There is a number of standard properties which are supported by every package (e.g. ADDLOCALhttp://www.tightvnc.com/doc/win/TightVNC-installer-2.5.2.pdf 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...
shhammer5634 Posted February 3, 2013 Author Share Posted February 3, 2013 whoa! please just specify the problem I feel boresome to read a full essay !! and please post the code in [autoit] tags Sorry. I've posted in other forums and they all want as much information as possible in order to help. Thought it would be the same here. I'll try to do better next time. Link to comment Share on other sites More sharing options...
shhammer5634 Posted February 3, 2013 Author Share Posted February 3, 2013 http://www.tightvnc.com/doc/win/TightVNC-installer-2.5.2.pdfThanks for the posting. Should have look there first. Appreciate the help. 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