amar3181 Posted February 16, 2015 Posted February 16, 2015 Hello, I am new to Autoit and have been given a long code. This basically forms a GUI where it has selection for few items and after 2 or 3 choice the work starts. I just need to make it non GUI to be integrated with an environment. Is there any way we can hard code the 3 selection that we get to choose on GUI. Alternatively remove GUI which I guess is more work.
amar3181 Posted February 16, 2015 Author Posted February 16, 2015 Making my requirement more clear. I wish to suppress my GUI as I do not wish any user interaction during execution. Any way we can make it run in hidden mode while all 3 user selection can be supplied say in cmd line or somehow
Moderators JLogan3o13 Posted February 16, 2015 Moderators Posted February 16, 2015 Look at GuiSetState, you can either disable (visible but cannot interact with) or hide the GUI. If you would like further assistance, please post your code. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
amar3181 Posted February 16, 2015 Author Posted February 16, 2015 Its a long code. Can I share it privately somehow?
Moderators JLogan3o13 Posted February 16, 2015 Moderators Posted February 16, 2015 (edited) I will send you a PM you can respond to. Edit: It looks like you are too new to PM yet. Can a Mod respond, does the user need 5 posts to PM? Edited February 16, 2015 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Developers Jos Posted February 16, 2015 Developers Posted February 16, 2015 A New Member is indeed unable to use PM. Jos SciTE4AutoIt3 Full installer Download page  - Beta files    Read before posting   How to post scriptsource   Forum etiquette Forum Rules  Live for the present, Dream of the future, Learn from the past.Â
amar3181 Posted February 17, 2015 Author Posted February 17, 2015 I just need to make more posts here to PM?
JohnOne Posted February 17, 2015 Posted February 17, 2015 Why not just post a simple reproducer? AutoIt Absolute Beginners  Require a serial  Pause Script  Video Tutorials by Morthawt  ipify Monkey's are, like, natures humans.
Moderators JLogan3o13 Posted February 17, 2015 Moderators Posted February 17, 2015 J1 is correct, especially after the 1200-line PM you sent. As I responded, please just post a small (runnable) script reproducing the issue; what you sent is so full of external file references it won't begin to run. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
amar3181 Posted February 19, 2015 Author Posted February 19, 2015 PM'ed. Able to hide GUI. How do we hardcode user selection for it to proceed with execution without user interference?
Developers Jos Posted February 22, 2015 Developers Posted February 22, 2015 Any help? Any runnable reproducer as requested? Jos SciTE4AutoIt3 Full installer Download page  - Beta files    Read before posting   How to post scriptsource   Forum etiquette Forum Rules  Live for the present, Dream of the future, Learn from the past.Â
amar3181 Posted February 23, 2015 Author Posted February 23, 2015 (edited) TO run just exe files are missing with are org specific application installer. They are large plus legal issues. I was able to hide all the GUI by doing GUISetState(@SW_HIDE) as suggested. Now the only issues is that how do I hardcode user selection for the installation to proceed without any user interference. Like when it runs then for next 3 windows the user has to select from the choices from drop down menu. I need to make one of them as permanent and proceed with the final install. So need help with hardcoding user selection to the code. No choice should be available and install should proceed. Anyway can we provide the parameters outside while installation like on cmd line or something? Edited February 23, 2015 by amar3181
amar3181 Posted February 23, 2015 Author Posted February 23, 2015 Below is the code part for one such selection of language from dropdown ----------------------------------------------- #Region ### START Koda GUI section ### Form=q:1_clientsmorphomorphosecureinstall_lang.kxf $install_lang = GUICreate("MorphoSecurePC", 615, 438, -1, -1) GUISetBkColor(0xFFFFFF) $Logo01 = GUICtrlCreatePic($PathSrc&"Imglogo01.jpg", 56, 32, 500, 196) $lang_install = GUICtrlCreateCombo("", 128, 280, 361, 30, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetFont(-1, 12, 800, 0, "Arial Black") GUICtrlSetColor(-1, 0x646464) $Next_lang = GUICtrlCreateButton("Next >>", 496, 392, 107, 33) $version = GUICtrlCreateLabel("v "&IniRead($PathSrc&"config.ini", "Global", "version", "0"), 576, 8, 37, 17) GUISetState(@SW_SHOW, $install_lang) #EndRegion ### END Koda GUI section ###   ; Get all languages onto language.ini $LanguageList = "" ;MsgBox(0, "", $PathSrc&"language.ini") Local $VarLangList = IniReadSectionNames($PathSrc&"language.ini") If @error Then Logger("INI Language : ERROR : Cannot find the language.ini file.") ErrorAndExit("Language File") Else For $i = 1 To $VarLangList[0] $LanguageList = $LanguageList & $VarLangList[$i] & "|" Next $LanguageList = StringLeft($LanguageList, StringLen($LanguageList)-1) EndIf GUICtrlSetData($lang_install, $LanguageList, "English")   ; Wait for a click on "Next" button While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Next_lang GUISetState(@SW_HIDE, $install_lang) ;OsType() Global $My_Language = GUICtrlRead($lang_install) ExitLoop EndSwitch WEnd  ----------------------------------------------------------------------  How do I make the already displayed selection as default and automatically have next selected here?
JohnOne Posted February 24, 2015 Posted February 24, 2015 Use an ini file or have the user start the script with appropriate command line parameters. AutoIt Absolute Beginners  Require a serial  Pause Script  Video Tutorials by Morthawt  ipify Monkey's are, like, natures humans.
amar3181 Posted February 24, 2015 Author Posted February 24, 2015 In cmd line how can we start it with the appropriate parameter? Say in cmd I put up the exe so what option should I supply in which syntax for it to run directly?
amar3181 Posted February 24, 2015 Author Posted February 24, 2015 In the image the requirements seems clear for the code above mentioned. I just need the default selection to be selected at each screen and automatically do next next at each GUI selection and finally install. How can I do this? Or is there a code in form of timer where is nothing is selected the default automatically gets selected and does a next selection? Any solution just to move to next screen automatically would be great help here.
amar3181 Posted February 24, 2015 Author Posted February 24, 2015 I also tried automating the exe installation in next autoit script. Run('MorphoSecurePC-655.exe') WinWaitActive("UAC","UAC") Send("{TAB}") Send("{TAB}") Send("{TAB}") Send("{ENTER}") WinWaitActive("MorphoSecure","Setup") Send("{TAB}") Send("{ENTER}") WinWaitActive("MorphoSecure","Setup") Send("{TAB}") Send("{TAB}") Send("{ENTER}") WinWaitActive("MorphoSecure","Setup") Send("{TAB}") Send("{TAB}") Send("{TAB}") Send("{TAB}") Send("{TAB}") Send("{TAB}") Send("{TAB}") Send("{ENTER}") WinWaitActive("MorphoSecure","Setup") Send("{TAB}") Send("{TAB}") Send("{ENTER}") WinWaitActive("MorphoSecure","Setup") Â Â It does not work. Is there something wrong. I just need to press tab and enter everywhere. Also if I were to hide the GUI will this work in hidden mode too?
TheSaint Posted February 24, 2015 Posted February 24, 2015 It is a bit confusing what you are asking here, but it seems like you want to extract three sections of code and do away with the GUI side of things altogether. Which is easy enough to do if you know what you are doing. You probably need to make each required section of a code a Function, and remove any commands that refer to GUI elements. You would then, it would seem, just run each function, one after the other using function calls. All pretty easy if we had the code to work with and knew which sections you want. Else, we can only advise something like I said above. You don't appear to be all that conversant with AutoIt syntax and coding? Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)
amar3181 Posted February 25, 2015 Author Posted February 25, 2015 Yes, I am new but putting all efforts to learn more but my work is on time constraint. I started with the requirement for just removing GUI. But soon realized other requirements. I have an exe and I jut need to automate the install with no GUI component. I was able to remove GUI but had no idea on how to automate. After some research I thought why not automate the exe installation using autoit itself. Above code is just for pressing tab to move to proper selection and hit enter. But when windows UAC pops up nothing happens further. No automatic tab or enter. Is the above code correct?
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