0

I'm doing a QT app for windows that during the execution I need to start another program that is on the same folder than the executable. The thing is that I have this currently working but it only fails when I copy the folder into "C:/program files (x86)", it just doesn't execute it and neither giving any QProcessError.

For example, if I put the folder of my program (with all necessary DLL's and the other .exe) at desktop or directly in c:, it does work, but the moment it's inside ProgramFiles (x86) it stops working the part that automatically execute the second program.

I think it should be some kind of permision problem, but, my QT app asks for admin right when it's executed.

Here, the code:

QProcess procStart;
...
connect(procStart, SIGNAL(error(QProcess::ProcessError)),this, SLOT(slotProcessError(QProcess::ProcessError)));
...

void AppName::launchProcess()
{
    procStart.start(rootPath + ressources + app);
}

Any idea? I've tried with start, startDetached, execute, etc... and same result always, outside programfiles works flawlesly, but not inside.

Thanks!

rul3s
  • 332
  • 1
  • 2
  • 18
  • Note that you're invoking the `static` member [`QProcess::startDetached`](http://doc.qt.io/qt-5/qprocess.html#startDetached-2) which will create a new process and detach from it. So listening for signals from `procStart` won't work. Please provide a [mcve] and say *why* you need to detach the process. – G.M. May 23 '18 at 12:08
  • @G.M. sorry, I didn't meant to use the startDetached, it was my last trial and doing copy paste without revising was my fault. By the way, the problem of running it from programfiles persists. – rul3s May 23 '18 at 14:42
  • `QProcess procStart;` `procStart = new QProcess(this);` , does that really compile??!! – Mohammad Kanan May 23 '18 at 23:44
  • @MohammadKanan sorry, it was from the past edit, that i had QProcess* and startDetached, my mistake. By the way, about the thing I'm talking, any idea? Thanks. – rul3s May 25 '18 at 07:19

0 Answers0