amar3181

Removing all GUI functions

51 posts in this topic

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.

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

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.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Its a long code. Can I share it privately somehow?

Share this post


Link to post
Share on other sites

#5 ·  Posted (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 by JLogan3o13

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

I just need to make more posts here to PM?

Share this post


Link to post
Share on other sites

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.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

PM'ed. Able to hide GUI. How do we hardcode user selection for it to proceed with execution without user interference?

Share this post


Link to post
Share on other sites

Any help?

Share this post


Link to post
Share on other sites

#13 ·  Posted (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 by amar3181

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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.

post-90173-0-84646300-1424760338_thumb.p

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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?


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

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)

userbar.png

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now