| 170 | } |
| 171 | |
| 172 | bool CUpdater::MoveFile(const char *pFile) |
| 173 | { |
| 174 | char aBuf[256]; |
| 175 | const size_t Length = str_length(pFile); |
| 176 | bool Success = true; |
| 177 | |
| 178 | #if !defined(CONF_FAMILY_WINDOWS) |
| 179 | if(!str_comp_nocase(pFile + Length - 4, ".dll")) |
| 180 | return Success; |
| 181 | #endif |
| 182 | |
| 183 | #if !defined(CONF_PLATFORM_LINUX) |
| 184 | if(!str_comp_nocase(pFile + Length - 3, ".so")) |
| 185 | return Success; |
| 186 | #endif |
| 187 | |
| 188 | if(!str_comp_nocase(pFile + Length - 4, ".dll") || !str_comp_nocase(pFile + Length - 4, ".ttf") || !str_comp_nocase(pFile + Length - 3, ".so")) |
| 189 | { |
| 190 | str_format(aBuf, sizeof(aBuf), "%s.old", pFile); |
| 191 | m_pStorage->RenameBinaryFile(pFile, aBuf); |
| 192 | str_format(aBuf, sizeof(aBuf), "update/%s", pFile); |
| 193 | Success &= m_pStorage->RenameBinaryFile(aBuf, pFile); |
| 194 | } |
| 195 | else |
| 196 | { |
| 197 | str_format(aBuf, sizeof(aBuf), "update/%s", pFile); |
| 198 | Success &= m_pStorage->RenameBinaryFile(aBuf, pFile); |
| 199 | } |
| 200 | |
| 201 | return Success; |
| 202 | } |
| 203 | |
| 204 | void CUpdater::Update() |
| 205 | { |
nothing calls this directly
no test coverage detected