Jump to content

AutoHotKey Usage?


Recommended Posts

I have a few install packages that I think could be easily used with WPIW with AutoHotKey. I know the idea of WPIW is that it runs every thing sequentially, thus it seems like using a tool like AutoHotKey could be a bit difficult. For example, I have an EXE file that displays an OK box at the end letting you know the install was completed. The install is fairly complex, and I don't really want to mess with it. However, if I ran the exe in cmd=1, and then cmd=2 was an autohotkey exe file that just pressed enter, it would never get to cmd=2 to press enter since it's waiting at the end of cmd=1 for enter to be pressed. Thus it seems the only approach I could take is to have AutoHotKey be the only cmd ran, but have the AutoHotKey exe execute the file that needs to be run. The question is, how do you have it press keys at the right time? Would some thing like this be the best way (This is my sudo-code)? This assumes that the installer works perfect, but it needs you to push an "OK" box when the install is completed.

"%wpipath%\install\TestApplication\setup.exe"

while (ActiveWindow.title <> "Setup Complete")
do nothing
end while

send {ENTER}

Is there a better way then this, and would this even work? I don't have a VM at the moment to start messing around with, so I'm kind of coding blind a little.

Link to comment
Share on other sites


  • 5 weeks later...

This is my Autoit-Code to install ProgDVB - this code works also if the setup-window hasn't the focus.

; ----------------------------------------------------------------------------
;
; AutoIt Version: 3.1.1
; Author: Hawk
;
; ----------------------------------------------------------------------------

; Script Start - Add your code below here
AutoItSetOption("TrayIconDebug", 1)
AutoItSetOption("WinWaitDelay", 500)
AutoItSetOption("SendKeyDelay", 50)

$PID = Run("ProgDVB4.83FullInstall.exe", @ScriptDir)

WinWait("Installation ProgDVB ", "Select language :")
ControlClick("Installation ProgDVB ", "Next", "Button1")

WinWait("Installation ProgDVB ", "Destination directory :")
ControlSend("Installation ProgDVB ", "", "ComboBox1", "{END}")
ControlSetText("Installation ProgDVB ", "", "Edit1", EnvGet("PROGRAMFILES") & "\ProgDVB\")
ControlClick("Installation ProgDVB ", "Next", "Button1")

WinWait("Installation ProgDVB ", " Timeshift ")
ControlClick("Installation ProgDVB ", "In file", "Button6")
ControlClick("Installation ProgDVB ", "Next", "Button1")

WinWait("Installation ProgDVB ", " Modules ")
ControlClick("Installation ProgDVB ", "Next", "Button1")

WinWait("Installation ProgDVB ", "Installation successfully completed.")
ControlClick("Installation ProgDVB ", "Run ProgDVB", "Button5")
ControlClick("Installation ProgDVB ", "OK", "Button2")

ProcessWaitClose($PID)

Al

Link to comment
Share on other sites

  • 3 weeks later...

What's the difference between Autohotkey and AutoIt? I think I read that AHK was written with AutoIt, but I'm wondering, as far as functionality goes, what's the difference? AHK just runs an INI file containing AutoIt commands?

Link to comment
Share on other sites

What's the difference between Autohotkey and AutoIt? I think I read that AHK was written with AutoIt, but I'm wondering, as far as functionality goes, what's the difference? AHK just runs an INI file containing AutoIt commands?

search the forums of the two projects, the biggest difference are syntax and license (one's freeware, the other GPL). Some features of AutoHotKey are based on source code of AutoIt, as the acknowledgement in AHK's helpfile indicates.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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