mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-27 15:44:12 +08:00
.
This commit is contained in:
parent
239500d686
commit
dc6c468f01
@ -26,18 +26,33 @@ int updatewmain(int argc, wchar_t *argv[])
|
|||||||
int needreload = std::stoi(argv[1]);
|
int needreload = std::stoi(argv[1]);
|
||||||
try
|
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);
|
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)
|
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);
|
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);
|
ShellExecute(0, L"open", (std::wstring(argv[3]) + L"/Github/LunaTranslator/releases").c_str(), NULL, NULL, SW_SHOWNORMAL);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
wcscat(path, L"\\cache\\update");
|
std::filesystem::remove_all(argv[2]);
|
||||||
std::filesystem::remove_all(path);
|
|
||||||
}
|
}
|
||||||
catch (std::exception &e)
|
catch (std::exception &e)
|
||||||
{
|
{
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
set(VERSION_MAJOR 6)
|
set(VERSION_MAJOR 6)
|
||||||
set(VERSION_MINOR 5)
|
set(VERSION_MINOR 5)
|
||||||
set(VERSION_PATCH 2)
|
set(VERSION_PATCH 3)
|
||||||
set(VERSION_REVISION 0)
|
set(VERSION_REVISION 0)
|
||||||
set(LUNA_VERSION "{${VERSION_MAJOR},${VERSION_MINOR},${VERSION_PATCH},${VERSION_REVISION}}")
|
set(LUNA_VERSION "{${VERSION_MAJOR},${VERSION_MINOR},${VERSION_PATCH},${VERSION_REVISION}}")
|
||||||
add_library(VERSION_DEF INTERFACE)
|
add_library(VERSION_DEF INTERFACE)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#ifndef WINXP
|
#ifndef WINXP
|
||||||
|
|
||||||
#include <wrl.h>
|
#include <wrl.h>
|
||||||
#include <wil/com.h>
|
#include <wil/com.h>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user