diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d24c11215..9b330ba9ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - fixed SBIE2321 Cannot manage device map: [C0000034 / 11] [#2996](https://github.com/sandboxie-plus/Sandboxie/issues/2996) - fixed Cannot run explorer.exe on emulate admin sandbox [#3516](https://github.com/sandboxie-plus/Sandboxie/issues/3516) - fixed potential BSOD issue with WFP when trace loging is enabled +- fixed Run from Sandbox > Run > Program and Run from folder doesn't use the same working dir [#3555](https://github.com/sandboxie-plus/Sandboxie/issues/3555) diff --git a/SandboxiePlus/SandMan/Views/SbieView.cpp b/SandboxiePlus/SandMan/Views/SbieView.cpp index d3af63ce4c..71f3b8e207 100644 --- a/SandboxiePlus/SandMan/Views/SbieView.cpp +++ b/SandboxiePlus/SandMan/Views/SbieView.cpp @@ -1654,6 +1654,7 @@ void CSbieView::OnProcessAction(QAction* Action, const QList& QString BoxName = pProcess->GetBoxName(); QString LinkName = pProcess->GetProcessName(); QString LinkPath = pProcess->GetFileName(); + QString WorkingDir = pProcess->GetWorkingDir(); QString Path = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation).replace("/", "\\"); //Path = QFileDialog::getExistingDirectory(this, tr("Select Directory to create Shortcut in"), Path).replace("/", "\\"); @@ -1669,13 +1670,19 @@ void CSbieView::OnProcessAction(QAction* Action, const QList& return; QString StartExe = theAPI->GetSbiePath() + "\\SandMan.exe"; - CSbieUtils::CreateShortcut(StartExe, Path, LinkName, BoxName, LinkPath, LinkPath); + CSbieUtils::CreateShortcut(StartExe, Path, LinkName, BoxName, LinkPath, LinkPath, 0, WorkingDir); } else if (Action == m_pMenuPinToRun) { CSandBoxPlus* pBoxPlus = pProcess.objectCast()->GetBox(); if (m_pMenuPinToRun->isChecked()) - pBoxPlus->InsertText("RunCommand", pProcess->GetProcessName() + "|\"" + pBoxPlus->MakeBoxCommand(pProcess->GetFileName()) + "\""); + { + QVariantMap Entry; + Entry["Name"] = pProcess->GetProcessName(); + Entry["WorkingDir"] = pProcess->GetWorkingDir(); + Entry["Command"] = pBoxPlus->MakeBoxCommand(pProcess->GetFileName()); + pBoxPlus->InsertText("RunCommand", MakeRunEntry(Entry)); + } else if(!m_pMenuPinToRun->data().toString().isEmpty()) pBoxPlus->DelValue("RunCommand", m_pMenuPinToRun->data().toString()); }