Skip to content

Commit

Permalink
Merge pull request #11 from EA31337/dev
Browse files Browse the repository at this point in the history
Improves installation steps
  • Loading branch information
kenorb authored Feb 11, 2024
2 parents 8a1e6e4 + ba4f675 commit 5b99691
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 35 deletions.
3 changes: 2 additions & 1 deletion molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
ansible.builtin.include_role:
name: ea31337.metatrader
vars:
# @fixme: https://github.com/Winetricks/winetricks/issues/2119
# noqa: var-naming[no-role-prefix]
wine_winetricks_url: >-
https://raw.githubusercontent.com/jre-wine/winetricks/Workaround_missing_/usr/bin/wine64/src/winetricks
https://raw.githubusercontent.com/kenorb-contrib/winetricks/GH-2119-fix/src/winetricks
# noqa: var-naming[no-role-prefix]
wine_winetricks_winver: win10
8 changes: 4 additions & 4 deletions molecule/default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
path: /root/.wine/drive_c/Program Files/MetaTrader 5
register: stat_result

- name: Verify platform exist
- name: Verify platform directory exist
ansible.builtin.assert:
that:
- stat_result.stat.exists
Expand All @@ -24,12 +24,12 @@
register: find_mt_res
when: ansible_os_family != "Windows"

- name: Check if Meta Editor exists
- name: Checks if platform's editor exists
changed_when: false
failed_when: find_mt_res.matched == 0
failed_when: find_mte_res.matched == 0
ansible.builtin.find:
paths: '{{ ansible_env.HOME }}/.wine/drive_c'
patterns: metaeditor*.exe
patterns: "[mM]eta[eE]ditor*.exe"
recurse: true
register: find_mte_res
when: ansible_os_family != "Windows"
3 changes: 2 additions & 1 deletion molecule/mt4/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
metatrader_setup_url: |
https://download.mql5.com/cdn/web/3315/mt4/xm4setup.exe
metatrader_version: 4
# @fixme: https://github.com/Winetricks/winetricks/issues/2119
# noqa: var-naming[no-role-prefix]
wine_winetricks_url: >-
https://raw.githubusercontent.com/jre-wine/winetricks/Workaround_missing_/usr/bin/wine64/src/winetricks
https://raw.githubusercontent.com/kenorb-contrib/winetricks/GH-2119-fix/src/winetricks
# noqa: var-naming[no-role-prefix]
wine_winetricks_winver: win10
8 changes: 4 additions & 4 deletions molecule/mt4/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
path: /root/.wine/drive_c/Program Files
register: stat_result

- name: Verify Program Files exist
- name: Verify Program Files directory exist
ansible.builtin.assert:
that:
- stat_result.stat.exists
Expand All @@ -24,12 +24,12 @@
register: find_mt_res
when: ansible_os_family != "Windows"

- name: Check if Meta Editor exists
- name: Checks if platform's editor exists
changed_when: false
failed_when: find_mt_res.matched == 0
failed_when: find_mte_res.matched == 0
ansible.builtin.find:
paths: '{{ ansible_env.HOME }}/.wine/drive_c'
patterns: metaeditor*.exe
patterns: "[mM]eta[eE]ditor*.exe"
recurse: true
register: find_mte_res
when: ansible_os_family != "Windows"
3 changes: 2 additions & 1 deletion molecule/mt5/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
name: ea31337.metatrader
vars:
metatrader_version: 5
# @fixme: https://github.com/Winetricks/winetricks/issues/2119
# noqa: var-naming[no-role-prefix]
wine_winetricks_url: >-
https://raw.githubusercontent.com/jre-wine/winetricks/Workaround_missing_/usr/bin/wine64/src/winetricks
https://raw.githubusercontent.com/kenorb-contrib/winetricks/GH-2119-fix/src/winetricks
# noqa: var-naming[no-role-prefix]
wine_winetricks_winver: win10
8 changes: 4 additions & 4 deletions molecule/mt5/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
path: /root/.wine/drive_c/Program Files/MetaTrader 5
register: stat_result

- name: Verify platform exist
- name: Verify platform directory exist
ansible.builtin.assert:
that:
- stat_result.stat.exists
Expand All @@ -24,12 +24,12 @@
register: find_mt_res
when: ansible_os_family != "Windows"

- name: Check if Meta Editor exists
- name: Checks if platform's editor exists
changed_when: false
failed_when: find_mt_res.matched == 0
failed_when: find_mte_res.matched == 0
ansible.builtin.find:
paths: '{{ ansible_env.HOME }}/.wine/drive_c'
patterns: metaeditor*.exe
patterns: "[mM]eta[eE]ditor*.exe"
recurse: true
register: find_mte_res
when: ansible_os_family != "Windows"
2 changes: 2 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,5 @@
state: absent
- name: Verifies
ansible.builtin.include_tasks: verify.yml
tags:
- metatrader_verify
41 changes: 23 additions & 18 deletions tasks/verify.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
---
- name: Checks if Meta Terminal exists
changed_when: false
failed_when: find_mt_res.matched == 0
ansible.builtin.find:
paths: '{{ ansible_env.HOME }}/.wine/drive_c'
patterns: terminal*.exe
recurse: true
register: find_mt_res
when: ansible_os_family != "Windows"
- name: Checks if Meta Editor exists
changed_when: false
failed_when: find_mt_res.matched == 0
ansible.builtin.find:
paths: '{{ ansible_env.HOME }}/.wine/drive_c'
patterns: metaeditor*.exe
recurse: true
register: find_mte_res
when: ansible_os_family != "Windows"
- name: Verifies platform files exist
tags:
- metatrader_verify
block:
- name: Checks if platform's terminal exists
changed_when: false
failed_when: find_mt_res.matched == 0
ansible.builtin.find:
paths: '{{ ansible_env.HOME }}/.wine/drive_c'
patterns: terminal*.exe
recurse: true
register: find_mt_res
when: ansible_os_family != "Windows"

- name: Checks if platform's editor exists
changed_when: false
failed_when: find_mte_res.matched == 0
ansible.builtin.find:
paths: '{{ ansible_env.HOME }}/.wine/drive_c'
patterns: "[mM]eta[eE]ditor*.exe"
recurse: true
register: find_mte_res
when: ansible_os_family != "Windows"
3 changes: 1 addition & 2 deletions templates/mt5_install.verb.j2
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ load_mt5_install()
SetTitleMatchMode, RegEx
WinWait, MetaTrader 5,, 30
Send, {Enter}
WinWait, MetaTrader 5 Setup, Congratulations!
Send, {Tab}{Enter}
WinWaitClose
Process, Wait, terminal64.exe, 30
Process, Close, terminal64.exe
"
Expand Down

0 comments on commit 5b99691

Please sign in to comment.