<p>The installation of Windows application can be automated using <a href="https://autohotkey.com/" rel="nofollow noreferrer">AutoHotkey</a> (AHK), similar as <a href="https://github.com/Winetricks/winetricks/blob/master/src/winetricks" rel="nofollow noreferrer">Winetricks</a> does this for all common apps which support.</p>

<p>Here is example of AHK script which aims to install mentioned application:</p>

<pre><code>Run, mt5setup.exe
WinWait, MetaTrader 5 Setup
ControlClick, Button1
Sleep 100
ControlClick, Button3
WinWait, MetaTrader 5 Setup, Installation successfully completed
ControlClick, Button4
Process, Wait, terminal.exe
Process, Close, terminal.exe
</code></pre>

<p>To integrate it with CI, AHK needs to be installed by downloading ZIP file, uncompressing it and passing the above AHK script. Suggested <code>appveyor.yml</code> file:</p>

<pre><code>install:
- curl -sLo https://www.metatrader5.com/en/download
- curl -sLo http://www.autohotkey.com/download/AutoHotkey104805.zip
- unzip *.zip
before_test:
- dir
test_script:
- AutoHotkey.exe install.ahk
build: off
platform: x86
</code></pre>

<p>where <code>install.ahk</code> is the file to contain above AHK script which can be dynamically generated or downloaded from some repository.</p>

CC BY-SA 3.0
2017-03-01T13:56:49.463Z
2017-10-22T13:51:49.877Z
2017-10-22T13:51:49.877Z
kenorb
<p>I've the installer in EXE format (<a href="https://www.metatrader5.com/en/download" rel="noreferrer"><code>mt5setup.exe</code></a>) and I'd like to download it and automate the installation process on Appveyor CI. On Linux I would normally use <a href="http://www.semicomplete.com/projects/xdotool/" rel="noreferrer">xdotool</a>.</p>

<p>Since this installer doesn't have any silent flags to use, how can I automate the installation process headlessly?</p>

CC BY-SA 3.0
2017-02-28T17:39:56.623Z
Best idea coming to my mind: https://www.autoitscript.com/site/autoit/ (but out of this, writing this as an answer would be too long or link only)
Tensibai
CC BY-SA 3.0
2017-02-28T17:40:37.413Z
Brief answer how to use it would be fine.
kenorb
CC BY-SA 3.0
2017-02-28T17:42:55.310Z
There's no brief answer, this mean watching the install and writing the script, the tool examples are good I think and just quoting the doc doesn't sound an answer to me :/.
Tensibai
CC BY-SA 3.0
2017-02-28T17:44:51.333Z
And another option could be https://chocolatey.org/ (again, answering mean installing your linked software or quoting the doc.
Tensibai
<automation><appveyor><installation>
How to automate installation of Windows installer on Appveyor CI?
kenorb
# How to automate installation of Windows installer on Appveyor CI?

(Asked by: username_0 on 2017-02-28)

I've the installer in EXE format ([`mt5setup.exe`](https://www.metatrader5.com/en/download)) and I'd like to download it and automate the installation process on Appveyor CI. On Linux I would normally use [xdotool](http://www.semicomplete.com/projects/xdotool/).

Since this installer doesn't have any silent flags to use, how can I automate the installation process headlessly?

**Tags:** automation, appveyor, installation

> **Comments:**
> **username_1**: Best idea coming to my mind: https://www.autoitscript.com/site/autoit/ (but out of this, writing this as an answer would be too long or link only)  
> **username_0**: Brief answer how to use it would be fine.  
> **username_1**: There's no brief answer, this mean watching the install and writing the script, the tool examples are good I think and just quoting the doc doesn't sound an answer to me :/.  
> **username_1**: And another option could be https://chocolatey.org/ (again, answering mean installing your linked software or quoting the doc.  

---

## 1 answers

### Answer by username_0 on 2017-03-01. Score: 4 | Accepted answer

The installation of Windows application can be automated using AutoHotkey (AHK), similar as Winetricks does this for all common apps which support.
Here is example of AHK script which aims to install mentioned application:
Run, mt5setup.exe
WinWait, MetaTrader 5 Setup
ControlClick, Button1
Sleep 100
ControlClick, Button3
WinWait, MetaTrader 5 Setup, Installation successfully completed
ControlClick, Button4
Process, Wait, terminal.exe
Process, Close, terminal.exe

To integrate it with CI, AHK needs to be installed by downloading ZIP file, uncompressing it and passing the above AHK script. Suggested appveyor.yml file:
install:
- curl -sLo https://www.metatrader5.com/en/download
- curl -sLo http://www.autohotkey.com/download/AutoHotkey104805.zip
- unzip *.zip
before_test:
- dir
test_script:
- AutoHotkey.exe install.ahk
build: off
platform: x86

where install.ahk is the file to contain above AHK script which can be dynamically generated or downloaded from some repository.


---

