diff options
author | George Hazan <ghazan@miranda.im> | 2022-04-16 16:54:21 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2022-04-16 16:54:21 +0300 |
commit | d12310676d262c0d635eb90d4a62a418ce6a506c (patch) | |
tree | a55959739e5c0ab79771d251238025fd913d9d09 /plugins/PluginUpdater/src/Utils.cpp | |
parent | 86e467dcc11f7f5accd6f123e8bfbaf4ef5d1208 (diff) |
also we shall remove garbage from the root folder after changing platform
Diffstat (limited to 'plugins/PluginUpdater/src/Utils.cpp')
-rw-r--r-- | plugins/PluginUpdater/src/Utils.cpp | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/plugins/PluginUpdater/src/Utils.cpp b/plugins/PluginUpdater/src/Utils.cpp index b39f3c7acf..298c46c0f9 100644 --- a/plugins/PluginUpdater/src/Utils.cpp +++ b/plugins/PluginUpdater/src/Utils.cpp @@ -324,17 +324,22 @@ char* StrToLower(char *str) /////////////////////////////////////////////////////////////////////////////////////////
+MFilePath InvertMirandaPlatform()
+{
+ MFilePath wszPath;
+ #ifdef _WIN64
+ wszPath.Format(L"%s\\miranda32.exe", g_mirandaPath.get());
+ #else
+ wszPath.Format(L"%s\\miranda64.exe", g_mirandaPath.get());
+ #endif
+ return wszPath;
+}
+
void DoRestart()
{
BOOL bRestartCurrentProfile = g_plugin.getBool("RestartCurrentProfile", true);
- if (g_plugin.bChangePlatform) {
- MFilePath mirstartpath;
-#ifdef _WIN64
- mirstartpath.Format(L"%s\\miranda32.exe", g_mirandaPath.get());
-#else
- mirstartpath.Format(L"%s\\miranda64.exe", g_mirandaPath.get());
-#endif
- CallServiceSync(MS_SYSTEM_RESTART, bRestartCurrentProfile, (LPARAM)mirstartpath.c_str());
- }
- else CallServiceSync(MS_SYSTEM_RESTART, bRestartCurrentProfile);
+ if (g_plugin.bChangePlatform)
+ CallServiceSync(MS_SYSTEM_RESTART, bRestartCurrentProfile, (LPARAM)InvertMirandaPlatform().c_str());
+ else
+ CallServiceSync(MS_SYSTEM_RESTART, bRestartCurrentProfile);
}
|