Change renderdoccmd to be a console program on windows.

* This means it outputs natively/properly to stdout/stderr and its output can be
  redirected with pipes.
* It does mean we need to be very careful whenever it's run internally to not
  pop up a command window, which happens by default.
This commit is contained in:
baldurk
2019-01-09 16:27:15 +00:00
parent 150e6527ad
commit d265a14a45
10 changed files with 44 additions and 38 deletions
+2 -2
View File
@@ -1516,7 +1516,7 @@ bool IsRunningAsAdmin()
}
bool RunProcessAsAdmin(const QString &fullExecutablePath, const QStringList &params,
QWidget *parent, std::function<void()> finishedCallback)
QWidget *parent, bool hidden, std::function<void()> finishedCallback)
{
#if defined(Q_OS_WIN32)
@@ -1536,7 +1536,7 @@ bool RunProcessAsAdmin(const QString &fullExecutablePath, const QStringList &par
info.lpVerb = L"runas";
info.lpFile = wideExe.c_str();
info.lpParameters = wideParams.c_str();
info.nShow = SW_SHOWNORMAL;
info.nShow = hidden ? SW_HIDE : SW_SHOWNORMAL;
ShellExecuteExW(&info);
+1 -1
View File
@@ -585,7 +585,7 @@ typedef std::function<bool()> ProgressFinishedMethod;
QStringList ParseArgsList(const QString &args);
bool IsRunningAsAdmin();
bool RunProcessAsAdmin(const QString &fullExecutablePath, const QStringList &params,
QWidget *parent = NULL,
QWidget *parent = NULL, bool hidden = false,
std::function<void()> finishedCallback = std::function<void()>());
void RevealFilenameInExternalFileBrowser(const QString &filePath);
+2 -2
View File
@@ -431,11 +431,11 @@ void CaptureDialog::vulkanLayerWarn_mouseClick()
}
RunProcessAsAdmin(cmd, QStringList() << lit("vulkanregister") << lit("--system"), this,
[this]() { ui->vulkanLayerWarn->setVisible(false); });
true, [this]() { ui->vulkanLayerWarn->setVisible(false); });
#else
RunProcessAsAdmin(qApp->applicationFilePath(),
QStringList() << lit("--install_vulkan_layer") << lit("root"), this,
[this]() { ui->vulkanLayerWarn->setVisible(false); });
false, [this]() { ui->vulkanLayerWarn->setVisible(false); });
#endif
return;
}
+3 -3
View File
@@ -252,9 +252,9 @@ void UpdateDialog::on_update_clicked()
QDir::setCurrent(dir.absolutePath());
success = RunProcessAsAdmin(dir.absoluteFilePath(cmd), QStringList()
<< lit("upgrade") << lit("--path")
<< appDir.absolutePath());
success = RunProcessAsAdmin(
dir.absoluteFilePath(cmd),
QStringList() << lit("upgrade") << lit("--path") << appDir.absolutePath(), NULL, true);
exit(0);
+3
View File
@@ -1019,6 +1019,9 @@ void MainWindow::SetTitle(const QString &filename)
.arg(lit(FULL_VERSION_STRING))
.arg(QString::fromLatin1(GitVersionHash));
if(IsRunningAsAdmin())
text += tr(" (Administrator)");
if(QString::fromLatin1(RENDERDOC_GetVersionString()) != lit(MAJOR_MINOR_VERSION_STRING))
text += tr(" - !! VERSION MISMATCH DETECTED !!");