ahk
ahk copied to clipboard
Cannot find AHKv2 if only AHKv1 is in path
describe your issue
I had an end user who I believe had AHKv1 in their path, but did not have v2 in their path. This lead to an error
"AutoHotkey v2 was request but AutoHotkey v1 was detected for executable C:\Program Files\AutoHotkey\Autohotkey.exe"
Explicitly specifying the executable path with r'C:\Program Files\AutoHotkey\v2\AutoHotkey64.exe' worked.
I think this is the relevant line of code is: https://github.com/spyoungtech/ahk/blob/1bfb9924b7e4453dab1eaf59141367246089b5d1/ahk/_utils.py#L97
ahk.version
1.7.8
AutoHotkey version
v2
Code to reproduce the issue
from ahk import AHK
ahk = AHK(
version='v2'
)
Traceback/Error message
No response
Thanks for the report. There's probably some improvements that can be made in the _resolve_executable_path function to help address this issue.