AbstractProcessStep: Make isExecutableFile check a part of setupProcess

Task-number: QTCREATORBUG-29168
Change-Id: I47cc43f1465528354802fdc033fc6369e413b526
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2023-07-11 22:25:53 +02:00
parent 5385f84d55
commit d42e1756ef

View File

@@ -177,14 +177,6 @@ void AbstractProcessStep::setupOutputFormatter(OutputFormatter *formatter)
void AbstractProcessStep::doRun() void AbstractProcessStep::doRun()
{ {
if (!d->m_param.effectiveCommand().isExecutableFile()) {
emit addOutput(Tr::tr("The program \"%1\" does not exist or is not executable.")
.arg(d->m_displayedParams->effectiveCommand().toUserOutput()),
OutputFormat::ErrorMessage);
finish(ProcessResult::StartFailed);
return;
}
setupStreams(); setupStreams();
d->m_process.reset(new Process); d->m_process.reset(new Process);
@@ -218,6 +210,13 @@ bool AbstractProcessStep::setupProcess(Process &process)
OutputFormat::ErrorMessage); OutputFormat::ErrorMessage);
return false; return false;
} }
if (!d->m_param.effectiveCommand().isExecutableFile()) {
emit addOutput(Tr::tr("The program \"%1\" does not exist or is not executable.")
.arg(d->m_displayedParams->effectiveCommand().toUserOutput()),
OutputFormat::ErrorMessage);
return false;
}
process.setUseCtrlCStub(HostOsInfo::isWindowsHost()); process.setUseCtrlCStub(HostOsInfo::isWindowsHost());
process.setWorkingDirectory(workingDir); process.setWorkingDirectory(workingDir);
// Enforce PWD in the environment because some build tools use that. // Enforce PWD in the environment because some build tools use that.