This commit is contained in:
恍兮惚兮 2024-11-21 16:20:54 +08:00
parent 239500d686
commit dc6c468f01
3 changed files with 19 additions and 4 deletions

View File

@ -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)
{

View File

@ -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)

View File

@ -1,4 +1,4 @@
#ifndef WINXP
#ifndef WINXP
#include <wrl.h>
#include <wil/com.h>