summaryrefslogtreecommitdiff
path: root/plugins/PluginUpdater
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2022-04-16 15:02:19 +0300
committerGeorge Hazan <ghazan@miranda.im>2022-04-16 15:02:19 +0300
commit86b82de0ec0aa933bf8101cef55597e19d78d6a8 (patch)
treea15c6a01f11719d9f7d434c5eff69ac9f3f7fa57 /plugins/PluginUpdater
parent23843ef3efa7b02aa04e9a470bb95c118d3a7ceb (diff)
fixes #3008 (Недоработка при смене разрядности приложения)
Diffstat (limited to 'plugins/PluginUpdater')
-rw-r--r--plugins/PluginUpdater/src/DlgUpdate.cpp11
-rw-r--r--plugins/PluginUpdater/src/Notifications.cpp2
-rw-r--r--plugins/PluginUpdater/src/Utils.cpp19
-rw-r--r--plugins/PluginUpdater/src/stdafx.h2
-rw-r--r--plugins/PluginUpdater/src/version.h2
5 files changed, 23 insertions, 13 deletions
diff --git a/plugins/PluginUpdater/src/DlgUpdate.cpp b/plugins/PluginUpdater/src/DlgUpdate.cpp
index d9c0401a21..8f626876fa 100644
--- a/plugins/PluginUpdater/src/DlgUpdate.cpp
+++ b/plugins/PluginUpdater/src/DlgUpdate.cpp
@@ -148,17 +148,6 @@ LBL_Error:
}
pDlg->Close();
- BOOL bRestartCurrentProfile = g_plugin.getBool("RestartCurrentProfile", true);
- if (g_plugin.bChangePlatform) {
- TFileName mirstartpath;
-#ifdef _WIN64
- mir_snwprintf(mirstartpath, L"%s\\miranda32.exe", wszMirandaPath.get());
-#else
- mir_snwprintf(mirstartpath, L"%s\\miranda64.exe", wszMirandaPath.get());
-#endif
- CallServiceSync(MS_SYSTEM_RESTART, bRestartCurrentProfile, (LPARAM)mirstartpath);
- }
- else CallServiceSync(MS_SYSTEM_RESTART, bRestartCurrentProfile);
}
void ResizeVert(int yy)
diff --git a/plugins/PluginUpdater/src/Notifications.cpp b/plugins/PluginUpdater/src/Notifications.cpp
index 24471f507d..e9724717dd 100644
--- a/plugins/PluginUpdater/src/Notifications.cpp
+++ b/plugins/PluginUpdater/src/Notifications.cpp
@@ -74,7 +74,7 @@ void CALLBACK RestartPrompt(void *)
return;
}
- CallService(MS_SYSTEM_RESTART, g_plugin.getBool("RestartCurrentProfile", true), 0);
+ DoRestart();
}
static LRESULT CALLBACK PopupDlgProcRestart(HWND hPopup, UINT uMsg, WPARAM wParam, LPARAM lParam)
diff --git a/plugins/PluginUpdater/src/Utils.cpp b/plugins/PluginUpdater/src/Utils.cpp
index b0d7be149b..f1636511d8 100644
--- a/plugins/PluginUpdater/src/Utils.cpp
+++ b/plugins/PluginUpdater/src/Utils.cpp
@@ -322,3 +322,22 @@ char* StrToLower(char *str)
return str;
}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+void DoRestart()
+{
+ BOOL bRestartCurrentProfile = g_plugin.getBool("RestartCurrentProfile", true);
+ if (g_plugin.bChangePlatform) {
+ VARSW wszMirandaPath(L"%miranda_path%");
+
+ MFilePath mirstartpath;
+#ifdef _WIN64
+ mirstartpath.Format(L"%s\\miranda32.exe", wszMirandaPath.get());
+#else
+ mirstartpath.Format(L"%s\\miranda64.exe", wszMirandaPath.get());
+#endif
+ CallServiceSync(MS_SYSTEM_RESTART, bRestartCurrentProfile, (LPARAM)mirstartpath.c_str());
+ }
+ else CallServiceSync(MS_SYSTEM_RESTART, bRestartCurrentProfile);
+}
diff --git a/plugins/PluginUpdater/src/stdafx.h b/plugins/PluginUpdater/src/stdafx.h
index 7c8e2dd1f9..c12ec6e08a 100644
--- a/plugins/PluginUpdater/src/stdafx.h
+++ b/plugins/PluginUpdater/src/stdafx.h
@@ -241,6 +241,8 @@ void InitEvents();
void InitListNew();
void UnloadListNew();
+void DoRestart(void);
+
void CALLBACK RestartPrompt(void *);
void CALLBACK CheckUpdateOnStartup(void);
diff --git a/plugins/PluginUpdater/src/version.h b/plugins/PluginUpdater/src/version.h
index 4b4e1339cd..dc65e6a1bc 100644
--- a/plugins/PluginUpdater/src/version.h
+++ b/plugins/PluginUpdater/src/version.h
@@ -1,7 +1,7 @@
#define __MAJOR_VERSION 0
#define __MINOR_VERSION 2
#define __RELEASE_NUM 1
-#define __BUILD_NUM 1
+#define __BUILD_NUM 2
#include <stdver.h>