diff options
Diffstat (limited to 'windows/nsis-plugins/src/cleanup/cleanup.cpp')
| -rw-r--r-- | windows/nsis-plugins/src/cleanup/cleanup.cpp | 31 |
1 files changed, 7 insertions, 24 deletions
diff --git a/windows/nsis-plugins/src/cleanup/cleanup.cpp b/windows/nsis-plugins/src/cleanup/cleanup.cpp index ea8d59ac79..faef07c2f0 100644 --- a/windows/nsis-plugins/src/cleanup/cleanup.cpp +++ b/windows/nsis-plugins/src/cleanup/cleanup.cpp @@ -1,4 +1,5 @@ #include <stdafx.h> +#include "../error.h" #include "cleaningops.h" #include <libcommon/string.h> #include <windows.h> @@ -6,12 +7,6 @@ #include <functional> #include <vector> -enum class RemoveLogsAndCacheStatus -{ - GENERAL_ERROR = 0, - SUCCESS -}; - void __declspec(dllexport) NSISCALL RemoveLogsAndCache ( HWND hwndParent, @@ -49,15 +44,9 @@ void __declspec(dllexport) NSISCALL RemoveLogsAndCache } } - pushint(success ? RemoveLogsAndCacheStatus::SUCCESS : RemoveLogsAndCacheStatus::GENERAL_ERROR); + pushint(success ? NsisStatus::SUCCESS : NsisStatus::GENERAL_ERROR); } -enum class RemoveSettingsStatus -{ - GENERAL_ERROR = 0, - SUCCESS -}; - void __declspec(dllexport) NSISCALL RemoveSettings ( HWND hwndParent, @@ -73,20 +62,14 @@ void __declspec(dllexport) NSISCALL RemoveSettings try { cleaningops::RemoveSettingsServiceUser(); - pushint(RemoveSettingsStatus::SUCCESS); + pushint(NsisStatus::SUCCESS); } catch (...) { - pushint(RemoveSettingsStatus::GENERAL_ERROR); + pushint(NsisStatus::GENERAL_ERROR); } } -enum class RemoveRelayCacheStatus -{ - GENERAL_ERROR = 0, - SUCCESS -}; - void __declspec(dllexport) NSISCALL RemoveRelayCache ( HWND hwndParent, @@ -104,16 +87,16 @@ void __declspec(dllexport) NSISCALL RemoveRelayCache cleaningops::RemoveRelayCacheServiceUser(); pushstring(L""); - pushint(RemoveRelayCacheStatus::SUCCESS); + pushint(NsisStatus::SUCCESS); } catch (const std::exception &err) { pushstring(common::string::ToWide(err.what()).c_str()); - pushint(RemoveRelayCacheStatus::GENERAL_ERROR); + pushint(NsisStatus::GENERAL_ERROR); } catch (...) { pushstring(L"Unspecified error"); - pushint(RemoveRelayCacheStatus::GENERAL_ERROR); + pushint(NsisStatus::GENERAL_ERROR); } } |
