Jump to content

poppe

Members
  • Posts

    17
  • Joined

  • Last visited

poppe's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Can you recommend some webserver to go along with this script? One that is free for business use, and as CPU light as possible. Thanks
  2. Thanks for help For some reason if i use {SPACE} instead of {ENTER} it works ok. ControlSend($WTitle, "", "[CLASS:Button; INSTANCE:2]", "{ENTER}") Ends up restarting the PC But: ControlSend($WTitle, "", "[CLASS:Button; INSTANCE:2]", "{SPACE}") Ends up closing the window, and not restarting, like it should. Could there be a bug? I don't understand why using Enter makes it restart, when the Enter is sent to No button. Anyway it works now
  3. Hello I have a weird problem. I'm doing a script that automatically installs a 3rd party software. At the last window the installer asks whether pc hould be restarted and there are two buttons: yes and no. Yes button is [CLASS:Button; INSTANCE:1] No button is [CLASS:Button; INSTANCE:2] I want it to press No button, but it always seems to press the Yes button, because PC restarts. My code: $WTitle = WinGetTitle("[active]") sleep (1000) ControlFocus($WTitle, "", "[CLASS:Button; INSTANCE:2]") sleep (1000) ControlSend($WTitle, "", "[CLASS:Button; INSTANCE:2]", "{ENTER}") I even tried to set the focus to the No button first, which it does ok, but for some reason it seems to always press yes, because the pc restarts when i run this script. If i comment out the last line (the controlsend) the pc is not restarted. What is wrong?
  4. Hello I have a 3rd party application combobox, to which i need to set the value. The value must be selected as "russian language". If the end-user has the proper codepage set for windows, the combobox values might be something like: English German русский Swedish etc. If the end-user does not have the proper codepage set for windows, the values might be garbled AND in different order. руÑÑкиРEnglish German Swedish etc. I can read the value with: Local $Text $Text = ControlGetText($AppTitle, "", "[CLASS:ComboBox; INSTANCE:1]") There is over 20 language choices in that combobox. How can i set the value, and make sure the value for russian language is always selected? At this point, it needs to be set, even if the text is garbled. Thanks
  5. I recreated the .ico now it works. Thanks.
  6. Hello and thanks for the reply I tried another actual .ico file, but it does not seem to update to my exe. The myapp.exe file still has the original autoit icon. Is this windows related problem? Do i need restart windows or something whenever i change the icon file?
  7. Hi I use the following line in my code: #AutoIt3Wrapper_icon=MyApp.ico I used MS PAINT to create the icon. Saved as .BMP and renamed to .ICO (16x16 pixels, 24bit) Windows displays the .ico file ok. Can i use MS PAINT to create the icon? The script compiles and builds ok, but the icon is not changed. How can i get it to change?
  8. Thanks, but that function returns the same title as i get by using the info tool. All the windows are identical Title: "Setup - my application" - Class: "TWizardForm" WinWait does not know the difference between them, and the script runs through in an instant. It should always wait until the next window appears. WinWait("Setup - My application","") ControlSend("Setup - My application", "", "[CLASS:Button; INSTANCE:1]", "{ENTER}") WinWait("Setup - My application","") ; ; script execution needs to wait at this point for the next window to appear, but now it does not. ; ; The application is unpacking files during this period, and the script ; should wait for that action to finish. ; ControlSend("Setup - My application", "", "[CLASS:Button; INSTANCE:2]", "{ENTER}") WinWait("Setup - My application","") ControlSend("Setup - My application", "", "[CLASS:Button; INSTANCE:2]", "{ENTER}") How can i make the script to wait for the next window to appear?
  9. Hello I am automating the installation of my application. I use winwait to wait for the next window to appear, then controlsend commands. WinWait("Setup - My application","") ControlSend("Setup - My application", "", "[CLASS:Button; INSTANCE:1]", "{ENTER}") WinWait("Setup - My application","") ControlSend("Setup - My application", "", "[CLASS:Button; INSTANCE:2]", "{ENTER}") WinWait("Setup - My application","") ControlSend("Setup - My application", "", "[CLASS:Button; INSTANCE:2]", "{ENTER}") The window names are identical and winwait does not seem to like it. In the help file it says i can use: text [optional] The text of the window to check. Some of the windows have lots of text, for example: "You are now installing... etc. etc." How can i identify the different windows with winwait? What is the proper use of this text option?
  10. Thank you! Now i can create it as it should be.
  11. Hello In the following code i create the GUI for the progress bar: #include <Math.au3> Global $iTimer = TimerInit() Global $iUpdateDelay = 1000 ; 1 sec Global $hWnd = GUICreate("Test") Global $hProgress = GUICtrlCreateProgress(-1, -1, 500, 20) GUISetState(@SW_SHOW, $hWnd) While 1 Switch GUIGetMsg() Case -3 Exit EndSwitch If (TimerDiff($iTimer) >= $iUpdateDelay) Then $iTimer = TimerInit() $iPercentage = GUICtrlRead($hProgress) If ($iPercentage < 100) Then GUICtrlSetData($hProgress, $iPercentage + 1) EndIf EndIf WEnd The code itself is not finished yet, but shows the general idea. My application installation code: If Not ShellExecute("setup.exe") Then MsgBox(48, "My application", "Could not launch setup.") Exit EndIf Sleep (10000) ControlSend("My application", "", "[CLASS:TNewButton; INSTANCE:1]", "{ENTER}") Sleep (10000) ControlSend("My application", "", "[CLASS:TNewButton; INSTANCE:2]", "{ENTER}") Sleep (10000) WinActivate("My application - locales","") Sleep (10000) ControlSend("My application", "", "[CLASS:TNewButton; INSTANCE:2]", "{ENTER}") When the progress bar GUI window is created, it will hang in the While loop, and never progress further. If i just paste the second code after it, it will never get executed. Installing my application takes 50 seconds, so i can preset the progress bar to 50 seconds also and it will match. How to combine the two codes?
  12. Hi Yes. That is what i am trying to accomplish. I'm trying to combine your script with mine, and don't know how to do it.
  13. OK thanks. I understand how your code works, but i don't understand how i can run it as a separate process. I have the following style code, that installs my application. Sleep is used to wait until the setup handles files, and then shows the next window on screen. This way the enter is sent to proper window. If Not ShellExecute("setup.exe") Then MsgBox(48, "My application", "Could not launch setup.") Exit EndIf Sleep (10000) ControlSend("My application", "", "[CLASS:TNewButton; INSTANCE:1]", "{ENTER}") Sleep (10000) ControlSend("My application", "", "[CLASS:TNewButton; INSTANCE:2]", "{ENTER}") Sleep (10000) WinActivate("My application - locales","") Sleep (10000) ControlSend("My application", "", "[CLASS:TNewButton; INSTANCE:2]", "{ENTER}") Where should i input your code, so the progressbar shows at the same time the installation proceeds ?
  14. Hi and thanks for the reply Even if i don't use sleep, the program hangs in the IF loop. It will wait until the IF has stopped executing, and proceed only after that. How can i run the progressbar function as a different process, so it does not interrupt the installation process? I would like the attached code to run during the installation process. If I know the installation takes for example 500 seconds, so i could pre-set it to 500. #include <Guiconstants.au3> Local $progressbar Local $i = 0 Sleep(500) GUICreate("babab", 180, 50) $progressbar = GUICtrlCreateProgress(10, 15, 160, 20) $label = Guictrlcreatelabel("",10,18,160,20,0x01) Guictrlsetbkcolor(-1, $GUI_BKCOLOR_TRANSPARENT) GUISetState() While Guigetmsg() <> -3 $i = $i + 1 GUICtrlSetData($progressbar, $i) GUICtrlSetData($label,$i) Sleep(20) If $i = 100 Then $i = 0 WEnd GUIDelete()
  15. Hello I'm writing a code that automates the installation of a specifc software. During the installation process i need a separate window to show the progress with a timer. My test code: _Timer() ControlSend("My Application", "", "[CLASS:NewButton; INSTANCE:1]", "{ENTER}") Exit Func _Timer() ProgressOn("Progress Meter", "Increments every second", "0 percent") For $i = 10 To 100 Step 10 Sleep(1000) ProgressSet($i, $i & " percent") Next ProgressSet(100, "Done", "Complete") Sleep(500) ProgressOff() EndFunc ;==>_Main The Timer will start running, but the ControlSend will not happen until the timer has ran out. I need the timer to start on the background, and the main code to progress normally at the same time, so it can install the software. How can i run the timer as a separate process?
×
×
  • Create New...