mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-29 01:46:38 +00:00
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:
@@ -1516,7 +1516,7 @@ bool IsRunningAsAdmin()
|
||||
}
|
||||
|
||||
bool RunProcessAsAdmin(const QString &fullExecutablePath, const QStringList ¶ms,
|
||||
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);
|
||||
|
||||
|
||||
@@ -585,7 +585,7 @@ typedef std::function<bool()> ProgressFinishedMethod;
|
||||
QStringList ParseArgsList(const QString &args);
|
||||
bool IsRunningAsAdmin();
|
||||
bool RunProcessAsAdmin(const QString &fullExecutablePath, const QStringList ¶ms,
|
||||
QWidget *parent = NULL,
|
||||
QWidget *parent = NULL, bool hidden = false,
|
||||
std::function<void()> finishedCallback = std::function<void()>());
|
||||
|
||||
void RevealFilenameInExternalFileBrowser(const QString &filePath);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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 !!");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user