summaryrefslogtreecommitdiff
path: root/src/spawn.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/spawn.cpp')
-rw-r--r--src/spawn.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/spawn.cpp b/src/spawn.cpp
index f92387d5..6bb34aea 100644
--- a/src/spawn.cpp
+++ b/src/spawn.cpp
@@ -159,8 +159,9 @@ HANDLE startBinary(const QFileInfo &binary,
"(you will be asked if you want to allow ModOrganizer.exe to make changes to the system)").arg(
QDir::toNativeSeparators(binary.absoluteFilePath())),
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
+ std::wstring parameters = ToWString("\"" + QDir::toNativeSeparators(binary.absoluteFilePath()) + "\" " + QString(arguments).replace("\"", "\\\""));
::ShellExecuteW(nullptr, L"runas", ToWString(QCoreApplication::applicationFilePath()).c_str(),
- (std::wstring(L"\"") + binaryName + L"\" " + ToWString(arguments)).c_str(), currentDirectoryName.c_str(), SW_SHOWNORMAL);
+ parameters.c_str(), currentDirectoryName.c_str(), SW_SHOWNORMAL);
return INVALID_HANDLE_VALUE;
} else {
return INVALID_HANDLE_VALUE;