PDA

View Full Version : QProcess help please



munna
31st August 2006, 08:14
Can some please tell me why does the MessageBox appears everytime I try to call the following slot




void ApplicationWindow::InstallUpdate()
{
QFile file("Update.exe");

if(file.exists()){
CloseWorkspace();

QProcess process(this);
process.addArgument("Update.exe");
process.addArgument("/SILENT");

if(!process.start()){
QMessageBox::information(this,"Error","Cannot install updates");
}

close();
}
else{
// Error message
}
}



Thanks a lot.

jpn
31st August 2006, 08:28
Is the update.exe located in PATH or current working directory?

munna
31st August 2006, 08:37
It is in the current working directory. file.exists() is returning true.

jlbrd
31st August 2006, 21:16
Perhaps try with new :

QProcess process = new QProcess(this);
process->addArgument("Update.exe");
process->addArgument("/SILENT");

if(!process->start()){
QMessageBox::information(this,"Error","Cannot install updates");
}