Hi

I have a gui app on mac os x which want to do a auto update on start, what i want to do:
1).download the new mpkg file;
2).use QProcess to run "installer -pkg MY_APP.mpkg -target LocalSystem" to install the newly downloaded mpkg file;

my code:
Qt Code:
  1. QProcess* proc = new QProcess();
  2. QString cmd = "installer -pkg MY_APP.mpkg -target LocalSystem";
  3. proc->start(cmd);
  4. if (!proc->waitForFinished())
  5. qDebug() << "install failed:" << proc->errorString();
  6. else
  7. qDebug() << "install output:" << proc->readAll();
  8. delete proc;
To copy to clipboard, switch view to plain text mode 
the result is: install output: "installer: Must be run as root to install this package."
so i changed the code to like this:
Qt Code:
  1. QString cmd = "sudo installer -pkg MY_APP.mpkg -target LocalSystem";
To copy to clipboard, switch view to plain text mode 
But it didn't work and output nothing.

What i want is: when proc->start,it will pop up a system gui to let user input passwork,just like double-clicked a mpkg to start a install process.

I've searched through google and in this forum,but didn't get this solved.
Can anyone help?
Thanks in advance.