diff --git a/cpp/shareddllproxy/update.cpp b/cpp/shareddllproxy/update.cpp index 9f380d31..eabec2f9 100644 --- a/cpp/shareddllproxy/update.cpp +++ b/cpp/shareddllproxy/update.cpp @@ -26,18 +26,33 @@ int updatewmain(int argc, wchar_t *argv[]) int needreload = std::stoi(argv[1]); try { + std::filesystem::remove_all(L".\\files_old"); + std::filesystem::rename(L".\\files", L".\\files_old"); std::filesystem::copy(argv[2], L".\\", std::filesystem::copy_options::recursive | std::filesystem::copy_options::overwrite_existing); + try + { + std::filesystem::remove_all(L".\\files_old"); + } + catch (...) + { + } } catch (std::exception &e) { + try + { + std::filesystem::rename(L".\\files_old", L".\\files"); + } + catch (...) + { + } MessageBoxA(GetForegroundWindow(), (std::string("Update failed!\r\n") + e.what()).c_str(), "Error", 0); ShellExecute(0, L"open", (std::wstring(argv[3]) + L"/Github/LunaTranslator/releases").c_str(), NULL, NULL, SW_SHOWNORMAL); return 0; } try { - wcscat(path, L"\\cache\\update"); - std::filesystem::remove_all(path); + std::filesystem::remove_all(argv[2]); } catch (std::exception &e) { diff --git a/cpp/version.cmake b/cpp/version.cmake index 6c685ee0..06e0c658 100644 --- a/cpp/version.cmake +++ b/cpp/version.cmake @@ -1,7 +1,7 @@ set(VERSION_MAJOR 6) set(VERSION_MINOR 5) -set(VERSION_PATCH 2) +set(VERSION_PATCH 3) set(VERSION_REVISION 0) set(LUNA_VERSION "{${VERSION_MAJOR},${VERSION_MINOR},${VERSION_PATCH},${VERSION_REVISION}}") add_library(VERSION_DEF INTERFACE) diff --git a/cpp/winsharedutils/webview2_extra.cpp b/cpp/winsharedutils/webview2_extra.cpp index b5c0261f..b4e572e4 100644 --- a/cpp/winsharedutils/webview2_extra.cpp +++ b/cpp/winsharedutils/webview2_extra.cpp @@ -1,4 +1,4 @@ -#ifndef WINXP +#ifndef WINXP #include #include