This commit is contained in:
DavidXanatos 2023-05-27 17:12:22 +02:00
parent f31d06ac20
commit b84beed70c
5 changed files with 15 additions and 2 deletions

View File

@ -14,6 +14,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- fixed "Reset all GUI options" does not reset all GUI sections as expected [#2967](https://github.com/sandboxie-plus/Sandboxie/issues/2967)
- fixed sbie:// links below the Box Type presets [#2959](https://github.com/sandboxie-plus/Sandboxie/issues/2959#issuecomment-1565264161)
- fixed "Reset all GUI options" makes all sandbox names disappear [#2972](https://github.com/sandboxie-plus/Sandboxie/issues/2972)
- fixed A game can't be launched properly from "Run from Start Menu" [#2969](https://github.com/sandboxie-plus/Sandboxie/issues/2969)
## [1.9.5 / 5.64.5] - 2023-05-26

View File

@ -50,6 +50,10 @@ QVariantMap ResolveShortcut(const QString& LinkPath)
return Link;
Link["Arguments"] = QString::fromWCharArray(szPath);
hRes = psl->GetWorkingDirectory(szPath, ARRAYSIZE(szPath));
if (!FAILED(hRes))
Link["WorkingDir"] = QString::fromWCharArray(szPath);
int IconIndex;
hRes = psl->GetIconLocation(szPath, ARRAYSIZE(szPath), &IconIndex);
if (FAILED(hRes))

View File

@ -518,9 +518,12 @@ void CSandBoxPlus::ScanStartMenu()
pLink->Target = Link["Path"].toString();
pLink->Icon = Link["IconPath"].toString();
pLink->IconIndex = Link["IconIndex"].toInt();
pLink->WorkDir = Link["WorkingDir"].toString();
if (!pLink->Target.isEmpty() && !QFile::exists(pLink->Target) && !IsBoxexPath(pLink->Target))
pLink->Target = theAPI->GetBoxedPath(this, pLink->Target, FoundLink.Snapshot);
if (!pLink->WorkDir.isEmpty() && !QFile::exists(pLink->WorkDir) && !IsBoxexPath(pLink->WorkDir))
pLink->WorkDir = theAPI->GetBoxedPath(this, pLink->WorkDir, FoundLink.Snapshot);
if (!pLink->Icon.isEmpty() && !QFile::exists(pLink->Icon) && !IsBoxexPath(pLink->Icon))
pLink->Icon = theAPI->GetBoxedPath(this, pLink->Icon, FoundLink.Snapshot);
}

View File

@ -163,6 +163,7 @@ public:
QString Target;
QString Icon;
int IconIndex;
QString WorkDir;
};
QList<SLink> GetStartMenu() const { return m_StartMenu.values(); }

View File

@ -1459,11 +1459,12 @@ void CSbieView::OnSandBoxAction(QAction* Action, const QList<CSandBoxPtr>& SandB
else // custom run menu command
{
QString Command = Action->data().toString();
QString WorkingDir = Action->property("WorkingDir").toString();
if (Command.isEmpty())
Results.append(SandBoxes.first()->RunStart("start_menu"));
Results.append(SandBoxes.first()->RunStart("start_menu", false, WorkingDir));
else {
auto pBoxEx = SandBoxes.first().objectCast<CSandBoxPlus>();
Results.append(SandBoxes.first()->RunStart(pBoxEx->GetFullCommand(Command)));
Results.append(SandBoxes.first()->RunStart(pBoxEx->GetFullCommand(Command), false, WorkingDir));
}
}
@ -1838,6 +1839,7 @@ void CSbieView::UpdateStartMenu(CSandBoxPlus* pBoxEx)
if(Icon.isNull()) Icon = m_IconProvider.icon(QFileInfo(Link.Target));
pAction->setIcon(Icon);
pAction->setData(Link.Target);
pAction->setProperty("WorkingDir", Link.WorkDir);
}
}