Jump to content

Removing all GUI functions


amar3181
 Share

Go to solution Solved by orbs,

Recommended Posts

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.

Link to comment
Share on other sites

  • Replies 50
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

  • Moderators

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!

Link to comment
Share on other sites

  • Moderators

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

"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!

Link to comment
Share on other sites

  • Moderators

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!

Link to comment
Share on other sites

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
Link to comment
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?
Link to comment
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

Link to comment
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?
Link to comment
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?

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

Link to comment
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?

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...