diff --git a/src/base/system.cpp b/src/base/system.cpp index ee3b81e25..491421c30 100644 --- a/src/base/system.cpp +++ b/src/base/system.cpp @@ -3458,22 +3458,6 @@ int open_link(const char *link) #endif } -int os_is_winxp_or_lower() -{ -#if defined(CONF_FAMILY_WINDOWS) - static const DWORD WINXP_MAJOR = 5; - static const DWORD WINXP_MINOR = 1; - OSVERSIONINFO ver; - mem_zero(&ver, sizeof(OSVERSIONINFO)); - ver.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - GetVersionEx(&ver); - return ver.dwMajorVersion < WINXP_MAJOR || - (ver.dwMajorVersion == WINXP_MAJOR && ver.dwMinorVersion <= WINXP_MINOR); -#else - return 0; -#endif -} - struct SECURE_RANDOM_DATA { int initialized; diff --git a/src/base/system.h b/src/base/system.h index b6e40cf12..fe516f047 100644 --- a/src/base/system.h +++ b/src/base/system.h @@ -2129,16 +2129,6 @@ PROCESS shell_execute(const char *file); */ int kill_process(PROCESS process); -/* - Function: os_is_winxp_or_lower - Checks whether the program runs on Windows XP or lower. - - Returns: - 1 - Windows XP or lower. - 0 - Higher Windows version, Linux, macOS, etc. -*/ -int os_is_winxp_or_lower(); - /* Function: generate_password Generates a null-terminated password of length `2 * diff --git a/src/engine/client/client.cpp b/src/engine/client/client.cpp index 65ff9ea08..e5ccf6d00 100644 --- a/src/engine/client/client.cpp +++ b/src/engine/client/client.cpp @@ -4501,11 +4501,7 @@ bool CClient::RaceRecord_IsRecording() void CClient::RequestDDNetInfo() { char aUrl[256]; - static bool s_IsWinXP = os_is_winxp_or_lower(); - if(s_IsWinXP) - str_copy(aUrl, "http://info2.ddnet.tw/info", sizeof(aUrl)); - else - str_copy(aUrl, "https://info2.ddnet.tw/info", sizeof(aUrl)); + str_copy(aUrl, "https://info2.ddnet.tw/info", sizeof(aUrl)); if(g_Config.m_BrIndicateFinished) { diff --git a/src/engine/client/updater.cpp b/src/engine/client/updater.cpp index 6557ec2ad..89e90a5a6 100644 --- a/src/engine/client/updater.cpp +++ b/src/engine/client/updater.cpp @@ -102,7 +102,6 @@ void CUpdater::Init() m_pClient = Kernel()->RequestInterface(); m_pStorage = Kernel()->RequestInterface(); m_pEngine = Kernel()->RequestInterface(); - m_IsWinXP = os_is_winxp_or_lower(); } CUpdater::~CUpdater() @@ -204,13 +203,10 @@ bool CUpdater::ReplaceClient() char aPath[512]; // Replace running executable by renaming twice... - if(!m_IsWinXP) - { - m_pStorage->RemoveBinaryFile(CLIENT_EXEC ".old"); - Success &= m_pStorage->RenameBinaryFile(PLAT_CLIENT_EXEC, CLIENT_EXEC ".old"); - str_format(aPath, sizeof(aPath), "update/%s", m_aClientExecTmp); - Success &= m_pStorage->RenameBinaryFile(aPath, PLAT_CLIENT_EXEC); - } + m_pStorage->RemoveBinaryFile(CLIENT_EXEC ".old"); + Success &= m_pStorage->RenameBinaryFile(PLAT_CLIENT_EXEC, CLIENT_EXEC ".old"); + str_format(aPath, sizeof(aPath), "update/%s", m_aClientExecTmp); + Success &= m_pStorage->RenameBinaryFile(aPath, PLAT_CLIENT_EXEC); #if !defined(CONF_FAMILY_WINDOWS) m_pStorage->GetBinaryPath(PLAT_CLIENT_EXEC, aPath, sizeof aPath); char aBuf[512]; @@ -387,23 +383,6 @@ void CUpdater::CommitUpdate() m_State = NEED_RESTART; else { - if(!m_IsWinXP) - m_pClient->Restart(); - else - WinXpRestart(); + m_pClient->Restart(); } } - -void CUpdater::WinXpRestart() -{ - char aBuf[512]; - IOHANDLE bhFile = io_open(m_pStorage->GetBinaryPath("du.bat", aBuf, sizeof aBuf), IOFLAG_WRITE); - if(!bhFile) - return; - char bBuf[512]; - str_format(bBuf, sizeof(bBuf), ":_R\r\ndel \"" PLAT_CLIENT_EXEC "\"\r\nif exist \"" PLAT_CLIENT_EXEC "\" goto _R\r\n:_T\r\nmove /y \"update\\%s\" \"" PLAT_CLIENT_EXEC "\"\r\nif not exist \"" PLAT_CLIENT_EXEC "\" goto _T\r\nstart " PLAT_CLIENT_EXEC "\r\ndel \"du.bat\"\r\n", m_aClientExecTmp); - io_write(bhFile, bBuf, str_length(bBuf)); - io_close(bhFile); - shell_execute(aBuf); - m_pClient->Quit(); -} diff --git a/src/engine/client/updater.h b/src/engine/client/updater.h index c6c1e12a6..fdaf5101f 100644 --- a/src/engine/client/updater.h +++ b/src/engine/client/updater.h @@ -40,8 +40,6 @@ class CUpdater : public IUpdater class IStorage *m_pStorage; class IEngine *m_pEngine; - bool m_IsWinXP; - LOCK m_Lock; int m_State; @@ -80,7 +78,6 @@ public: virtual void InitiateUpdate(); void Init(); virtual void Update(); - void WinXpRestart(); }; #endif