Ran Bonjour installer in passive mode

This commit is contained in:
Xinyu Hou 2014-11-26 16:42:32 +00:00
parent dff2cb34be
commit 79f534273f
1 changed files with 9 additions and 2 deletions

View File

@ -54,7 +54,7 @@ static const QString synergyConfigFilter(QObject::tr("Synergy Configurations (*.
static const char bonjourUrl[] = "http://synergy-project.org/bonjour/"; static const char bonjourUrl[] = "http://synergy-project.org/bonjour/";
static const char bonjour32Url[] = "http://synergy-project.org/bonjour/Bonjour.msi"; static const char bonjour32Url[] = "http://synergy-project.org/bonjour/Bonjour.msi";
static const char bonjour64Url[] = "http://synergy-project.org/bonjour/Bonjour64.msi"; static const char bonjour64Url[] = "http://synergy-project.org/bonjour/Bonjour64.msi";
static const char bonjourInstaller[] = "BonjourSetup.exe"; static const char bonjourInstaller[] = "BonjourSetup.msi";
#else #else
static const char synergyConfigName[] = "synergy.conf"; static const char synergyConfigName[] = "synergy.conf";
static const QString synergyConfigFilter(QObject::tr("Synergy Configurations (*.conf);;All files (*.*)")); static const QString synergyConfigFilter(QObject::tr("Synergy Configurations (*.conf);;All files (*.*)"));
@ -1109,7 +1109,14 @@ void MainWindow::installBonjour()
file.write(m_pDataDownloader->downloadedData()); file.write(m_pDataDownloader->downloadedData());
file.close(); file.close();
QDesktopServices::openUrl(QUrl("file:///" + filename)); QProcess process;
QStringList arguments;
arguments.append("/i");
QString winFilename = QDir::toNativeSeparators(filename);
arguments.append(winFilename);
arguments.append("/passive");
process.start("msiexec", arguments);
process.waitForFinished();
m_DownloadMessageBox->hide(); m_DownloadMessageBox->hide();
#endif #endif