 IniRead, use_tmux, %A_ScriptDir%\etc\wsl-terminal.conf, config, use_tmux, 0
 IniRead, attach_tmux_locally, %A_ScriptDir%\etc\wsl-terminal.conf, config, attach_tmux_locally, 0
 IniRead, icon, %A_ScriptDir%\etc\wsl-terminal.conf, config, icon, ""
+
+bash_exe = %A_WinDir%\sysnative\bash.exe
+if (!FileExist(bash_exe))
+{
+    bash_exe = %A_WinDir%\system32\bash.exe
+}
+if (!FileExist(bash_exe))
+{
+    MsgBox, 0x10, , Ubuntu-on-Windows must be installed.
+    ExitApp, 1
+}
 
 icon_string = -i "%A_ScriptFullPath%"
 if (icon != "" && FileExist(icon))

    if (WinExist(title))
    {
        cmd =
        Run, c:\windows\sysnative\bash -c 'tmux new-window -c "$PWD"', , Hide
    }
    else if (args = "-a")
    {


    if (ErrorLevel = 0)
    {
        Run, "%bash_exe%" -c 'exec sleep 10000000d', , Hide
    }
}
