diff --git a/SandboxiePlus/SandMan/Engine/BoxObject.cpp b/SandboxiePlus/SandMan/Engine/BoxObject.cpp index 3a2b672a..a45fd638 100644 --- a/SandboxiePlus/SandMan/Engine/BoxObject.cpp +++ b/SandboxiePlus/SandMan/Engine/BoxObject.cpp @@ -99,6 +99,11 @@ bool CBoxObject::MakeShortcut(const QString& Target, const QVariantMap& Options) return CSbieView::CreateShortcutEx(Target, getName(), Name, Options["iconPath"].toString(), Options["iconIndex"].toInt(), Options["workDir"].toString()); } +void CSBoxObject::Start(const QString& Command, bool bElevale) +{ + m_pIni.objectCast()->RunStart(Command.isEmpty() ? "run_dialog" : Command, bElevale); +} + void CSBoxObject::ApplyChanges(bool bApply) { CWizardEngine* pEngine = qobject_cast(parent()); diff --git a/SandboxiePlus/SandMan/Engine/BoxObject.h b/SandboxiePlus/SandMan/Engine/BoxObject.h index 9663b49d..93d9bca7 100644 --- a/SandboxiePlus/SandMan/Engine/BoxObject.h +++ b/SandboxiePlus/SandMan/Engine/BoxObject.h @@ -41,6 +41,8 @@ public: public slots: + void Start(const QString& Command, bool bElevale); + void ApplyChanges(bool bApply); protected: @@ -128,6 +130,10 @@ public: JSBoxObject(CBoxObject* pObject, CBoxEngine* pEngine) : JBoxObject(pObject, pEngine) {} + Q_INVOKABLE void start(const QString& Command = QString(), bool bElevale = false) { + QMetaObject::invokeMethod(m_pObject, "Start", Qt::BlockingQueuedConnection, Q_ARG(QString, Command), Q_ARG(bool, bElevale)); + } + Q_INVOKABLE void applyChanges(bool bApply = true) { QMetaObject::invokeMethod(m_pObject, "ApplyChanges", Qt::BlockingQueuedConnection, Q_ARG(bool, bApply)); } diff --git a/SandboxiePlus/SandMan/Troubleshooting/Sandboxing/game_fps.js b/SandboxiePlus/SandMan/Troubleshooting/Sandboxing/game_fps.js new file mode 100644 index 00000000..445fa74a --- /dev/null +++ b/SandboxiePlus/SandMan/Troubleshooting/Sandboxing/game_fps.js @@ -0,0 +1,44 @@ +/* +* group: sandboxing +* class: sandboxing +* name: Low FPS in sandboxed Games +* description: This procedure will obtimize the box settings for gaming +* +*/ + +let form = [ + {type: 'box', id: 'box'} +]; + +let data = wizard.showForm(form, tr('Select which box to optimize.')); + +let boxName = data['box']; +let box = sbie.getBox(boxName); + +let message = tr('To apply recommended settings press NEXT. \n'); + +if(!sbie.testFeature('SMod')) + message += tr('\nPlease note that this required preset works only with a valid supporter certificate!'); + +wizard.showStatus(message, true); + +box.setIniValue('SysCallLockDown', 'y'); +box.applyChanges(); +box.start(); + +{ + sbie.setupTrace(); + + let form = [ + { id: 'yes', name: tr('Yes'), type: 'radio' }, + { id: 'no', name: tr('No'), type: 'radio' }, + ]; + let ret = wizard.showForm(form, tr('The options has been applied please tryout your game in %1 and indicate if the issue has been resolved.', boxName)); + if (ret['yes'] == true) { + wizard.setResult(true); + } + if (ret['no'] == true) { + wizard.setResult(false, 'Webcam mitigation not successfull'); + // todo roll back changes + } +} diff --git a/SandboxiePlus/SandMan/Troubleshooting/Sandboxing/installer.js b/SandboxiePlus/SandMan/Troubleshooting/Sandboxing/installer.js index 72f4eb96..1339c34a 100644 --- a/SandboxiePlus/SandMan/Troubleshooting/Sandboxing/installer.js +++ b/SandboxiePlus/SandMan/Troubleshooting/Sandboxing/installer.js @@ -52,4 +52,4 @@ let ret3 = wizard.showForm(form3, tr('Was the issue resolved?')); if (ret3['yes'] == true) wizard.setResult(true); else - wizard.setResult(false, 'no mitigation worked'); \ No newline at end of file + wizard.setResult(false, tr('no mitigation worked')); \ No newline at end of file diff --git a/SandboxiePlus/SandMan/Troubleshooting/Sandboxing/webcam.js b/SandboxiePlus/SandMan/Troubleshooting/Sandboxing/webcam.js index 05ba7281..7396b222 100644 --- a/SandboxiePlus/SandMan/Troubleshooting/Sandboxing/webcam.js +++ b/SandboxiePlus/SandMan/Troubleshooting/Sandboxing/webcam.js @@ -10,7 +10,7 @@ let message = tr('To enable webcam support on Windows 11, the isolation level must be reduced. \n'+ 'If you want to proceed, please press NEXT and select a sandbox to modify. \n'); -if(!sbie.isCertValid()) +if(!sbie.testFeature('AppC')) message += tr('\nPlease note that this required preset works only with a valid supporter certificate!'); wizard.showStatus(message, true); @@ -28,6 +28,7 @@ box.setIniValue('NoSecurityIsolation', 'y'); box.appendIniValue('Template', 'OpenCOM'); box.setIniValue('DropAdminRights', 'y'); box.applyChanges(); +box.start(); { sbie.setupTrace();