#pragma once # ifndef PORTMODE_H # define PORTMODE_H namespace PortableModeUtil { void CheckAndSetDataPath() { /*auto portableDataPath = std::filesystem::current_path().wstring() + DSPROXY_DATA_DIR_PORTABLE; if (fs::is_directory(portableDataPath)) { g_portableMode = true; g_dataPath = std::move(portableDataPath); } else g_dataPath = GetKnownFolderFsPath(FOLDERID_RoamingAppData) / CLASHXW_DATA_DIR; g_configPath = g_dataPath / CLASH_CONFIG_DIR_NAME;*/ } inline void SetAppId() { THROW_IF_FAILED(SetCurrentProcessExplicitAppUserModelID(CLASHXW_APP_ID)); //if (g_portableMode) //{ // wchar_t appId[std::size(CLASHXW_APP_ID) + guidSize] = CLASHXW_APP_ID L"/"; // Both size includes the null terminator // GUID guid = {}; // THROW_IF_FAILED(CoCreateGuid(&guid)); // THROW_HR_IF(E_OUTOFMEMORY, StringFromGUID2(guid, appId + std::size(CLASHXW_APP_ID), guidSize) != guidSize); // THROW_IF_FAILED(SetCurrentProcessExplicitAppUserModelID(appId)); //} //else // THROW_IF_FAILED(SetCurrentProcessExplicitAppUserModelID(CLASHXW_APP_ID)); } } #endif