From c46f2b1a585f506e1f05a272e329baee455b6c68 Mon Sep 17 00:00:00 2001
From: Marcin Cichocki <marcincichocki1993@gmail.com>
Date: Wed, 22 Sep 2021 15:16:52 +0200
Subject: [PATCH] fix(common): use AutoHotkey path from settings

---
 src/common/node/robot.ts      | 3 ++-
 src/electron/common/common.ts | 1 -
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/common/node/robot.ts b/src/common/node/robot.ts
index 4e97b2f2..84f63b0c 100644
--- a/src/common/node/robot.ts
+++ b/src/common/node/robot.ts
@@ -11,6 +11,7 @@ export interface RobotSettings {
   screenshotDir: string;
   autoExit: boolean;
   useScaling: boolean;
+  ahkBinPath: string;
 }
 
 export enum BreachProtocolRobotKeys {
@@ -146,7 +147,7 @@ export class AhkRobot extends BreachProtocolRobot {
     [BreachProtocolRobotKeys.Right]: 'Right',
   };
 
-  protected readonly binPath = 'C:/Program Files/AutoHotkey/AutoHotkey.exe';
+  protected readonly binPath = this.settings.ahkBinPath;
   private readonly scriptPath = './resources/win32/ahk/robot.ahk';
 
   override async bin(command: string) {
diff --git a/src/electron/common/common.ts b/src/electron/common/common.ts
index fdd52909..617c0be8 100644
--- a/src/electron/common/common.ts
+++ b/src/electron/common/common.ts
@@ -62,7 +62,6 @@ export interface AppSettings
   experimentalBufferSizeRecognition: boolean;
   outputDevice: 'mouse' | 'keyboard';
   engine: 'nircmd' | 'ahk' | 'xdotool';
-  ahkBinPath: string;
   resolveDelay: number;
 }