diff --git a/ide/debugmanager.pas b/ide/debugmanager.pas index effb8d12c1..6048014559 100644 --- a/ide/debugmanager.pas +++ b/ide/debugmanager.pas @@ -2190,9 +2190,11 @@ begin // For 'run' and 'step' bypass 'idle', so we can set the filename later CanRun:=false; if Project1<>nil then - CanRun:=((AnUnitInfo<>nil) and (AnUnitInfo.RunFileIfActive)) or - ((Project1.CompilerOptions.ExecutableType=cetProgram) - and (pfRunnable in Project1.Flags)); + CanRun:=( (AnUnitInfo<>nil) and (AnUnitInfo.RunFileIfActive) ) or + ( ((Project1.CompilerOptions.ExecutableType=cetProgram) or + (Project1.RunParameterOptions.HostApplicationFilename<>'')) + and (pfRunnable in Project1.Flags) + ); RunSpeedButton.Enabled := CanRun and (DebuggerInvalid or (dcRun in FDebugger.Commands) or (FDebugger.State = dsIdle)); itmRunMenuRun.Enabled := RunSpeedButton.Enabled; diff --git a/ide/main.pp b/ide/main.pp index 1233453085..f1336a40ae 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -11097,8 +11097,9 @@ begin // Check if we can run this project debugln('TMainIDE.DoInitProjectRun A ',dbgs(pfRunnable in Project1.Flags),' ',dbgs(Project1.MainUnitID)); - if not ((Project1.CompilerOptions.ExecutableType=cetProgram) and - (pfRunnable in Project1.Flags) and (Project1.MainUnitID >= 0)) then Exit; + if not ( ((Project1.CompilerOptions.ExecutableType=cetProgram) or + (Project1.RunParameterOptions.HostApplicationFilename<>'')) + and (pfRunnable in Project1.Flags) and (Project1.MainUnitID >= 0) ) then Exit; debugln('TMainIDE.DoInitProjectRun B'); // Build project first