diff --git a/Library/DialogManage.cpp b/Library/DialogManage.cpp index 20bd4d2b..d76de7ca 100644 --- a/Library/DialogManage.cpp +++ b/Library/DialogManage.cpp @@ -1513,9 +1513,10 @@ INT_PTR CDialogManage::CTabThemes::OnCommand(WPARAM wParam, LPARAM lParam) int sel = ListBox_GetCurSel(item); const std::vector& themes = Rainmeter->GetAllThemes(); - std::wstring args = Rainmeter->GetThemePath(); + std::wstring args = L"\"" + Rainmeter->GetThemePath(); args += themes[sel]; args += L"\\Rainmeter.thm"; + args += L'"'; RunFile(Rainmeter->GetSkinEditor().c_str(), args.c_str()); } break; diff --git a/Library/Litestep.cpp b/Library/Litestep.cpp index 9768cf36..38991873 100644 --- a/Library/Litestep.cpp +++ b/Library/Litestep.cpp @@ -82,11 +82,10 @@ void RunCommand(std::wstring command) } } -void RunFile(const WCHAR* file, const WCHAR* args, bool asAdmin) +void RunFile(const WCHAR* file, const WCHAR* args) { SHELLEXECUTEINFO si = {sizeof(SHELLEXECUTEINFO)}; - si.hwnd = NULL; - si.lpVerb = asAdmin ? L"runas" : L"open"; + si.lpVerb = L"open"; si.lpFile = file; si.nShow = SW_SHOWNORMAL; diff --git a/Library/Litestep.h b/Library/Litestep.h index f0793901..bd34db17 100644 --- a/Library/Litestep.h +++ b/Library/Litestep.h @@ -50,7 +50,7 @@ void LogWithArgs(int nLevel, const WCHAR* format, ...); void LogError(CError& error); void RunCommand(std::wstring command); -void RunFile(const WCHAR* file, const WCHAR* args = NULL, bool asAdmin = false); +void RunFile(const WCHAR* file, const WCHAR* args = NULL); WCHAR* GetString(UINT id); std::wstring GetFormattedString(UINT id, ...); diff --git a/Library/Rainmeter.cpp b/Library/Rainmeter.cpp index 69822d71..4591bd1d 100644 --- a/Library/Rainmeter.cpp +++ b/Library/Rainmeter.cpp @@ -1283,21 +1283,18 @@ void CRainmeter::ReloadSettings() void CRainmeter::EditSettings() { - std::wstring file = L"\"" + m_IniFile + L"\""; + std::wstring file = L"\"" + m_IniFile; + file += L'"'; RunFile(m_SkinEditor.c_str(), file.c_str()); } void CRainmeter::EditSkinFile(const std::wstring& name, const std::wstring& iniFile) { - std::wstring args = m_SkinPath + name; + std::wstring args = L"\"" + m_SkinPath; + args += name; args += L'\\'; args += iniFile; - bool writable = CSystem::IsFileWritable(args.c_str()); - - args = L"\"" + args + L"\""; - - // Execute as admin if in protected location - RunFile(m_SkinEditor.c_str(), args.c_str(), !writable); + RunFile(m_SkinEditor.c_str(), args.c_str()); } void CRainmeter::OpenSkinFolder(const std::wstring& name)