2020-06-08 16:17:37 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "qsbieapi_global.h"
|
|
|
|
|
2020-09-05 16:45:39 +01:00
|
|
|
#include "SbieStatus.h"
|
2020-06-08 16:17:37 +01:00
|
|
|
|
|
|
|
class QSBIEAPI_EXPORT CSbieUtils
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
enum EComponent
|
|
|
|
{
|
|
|
|
eNone = 0,
|
|
|
|
eDriver = 0x01,
|
|
|
|
eService = 0x02,
|
|
|
|
eAll = 0xFF
|
|
|
|
};
|
|
|
|
|
|
|
|
static SB_STATUS DoAssist();
|
|
|
|
|
|
|
|
static SB_STATUS Start(EComponent Component);
|
|
|
|
static SB_STATUS Stop(EComponent Component);
|
|
|
|
static bool IsRunning(EComponent Component);
|
|
|
|
|
|
|
|
static SB_STATUS Install(EComponent Component);
|
|
|
|
static SB_STATUS Uninstall(EComponent Component);
|
|
|
|
static bool IsInstalled(EComponent Component);
|
|
|
|
|
2020-09-12 09:09:24 +01:00
|
|
|
static int IsContextMenu();
|
|
|
|
static void AddContextMenu(const QString& StartPath);
|
|
|
|
static void RemoveContextMenu();
|
|
|
|
|
2020-12-29 08:54:59 +00:00
|
|
|
static bool CreateShortcut(class CSbieAPI* pApi, const QString &LinkPath, const QString &LinkName, const QString &boxname, const QString &arguments, const QString &iconPath = QString(), int iconIndex = 0, const QString &workdir = QString(), bool bRunElevated = false);
|
2020-12-07 16:34:20 +00:00
|
|
|
static bool GetStartMenuShortcut(class CSbieAPI* pApi, QString &BoxName, QString &LinkPath, QString &IconPath, quint32& IconIndex, QString &WorkDir);
|
2020-11-28 16:20:56 +00:00
|
|
|
|
2020-06-08 16:17:37 +01:00
|
|
|
private:
|
|
|
|
static SB_STATUS ElevateOps(const QStringList& Ops);
|
|
|
|
static SB_STATUS ExecOps(const QStringList& Ops);
|
|
|
|
|
|
|
|
static void Start(EComponent Component, QStringList& Ops);
|
|
|
|
static void Stop(EComponent Component, QStringList& Ops);
|
|
|
|
|
|
|
|
static void Install(EComponent Component, QStringList& Ops);
|
|
|
|
static void Uninstall(EComponent Component, QStringList& Ops);
|
2020-09-12 09:09:24 +01:00
|
|
|
|
|
|
|
static bool CheckRegValue(const wchar_t* key);
|
|
|
|
static void CreateShellEntry(const wstring& classname, const wstring& cmdtext, const wstring& iconpath, const wstring& startcmd);
|
2020-06-08 16:17:37 +01:00
|
|
|
};
|
|
|
|
|