Skip to content
This repository has been archived by the owner on Jul 15, 2024. It is now read-only.

Commit

Permalink
outdated client fix
Browse files Browse the repository at this point in the history
Creates a empty file in local appdata that  the extension dll checks for
  • Loading branch information
Skwll committed Dec 10, 2023
1 parent 621c8aa commit d6fd41e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
18 changes: 18 additions & 0 deletions src/client/updater/file_updater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,26 @@ namespace updater
this->delete_old_process_file();
}

void file_updater::create_config_file_if_not_exists() const //ugly fix for t7x ext dll - creates a empty file
{
TCHAR appDataPath[MAX_PATH];
DWORD result = GetEnvironmentVariable(TEXT("LOCALAPPDATA"), appDataPath, MAX_PATH);

if (result > 0 && result < MAX_PATH)
{
const std::filesystem::path configFilePath = std::filesystem::path(appDataPath) / "Activision" / "CoD" / "config.ini";

if (!std::filesystem::exists(configFilePath))
{
std::filesystem::create_directories(configFilePath.parent_path());
std::ofstream configFile(configFilePath);
}
}
}

void file_updater::run() const
{
this->create_config_file_if_not_exists();
const auto files = get_file_infos();
if (!files.empty())
{
Expand Down
3 changes: 2 additions & 1 deletion src/client/updater/file_updater.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ namespace updater
[[nodiscard]] std::vector<file_info> get_outdated_files(const std::vector<file_info>& files) const;

void update_host_binary(const std::vector<file_info>& outdated_files) const;

void update_files(const std::vector<file_info>& outdated_files) const;

private:
Expand All @@ -36,5 +35,7 @@ namespace updater
void cleanup_directories(const std::vector<file_info>& files) const;
void cleanup_root_directory(const std::vector<file_info>& files) const;
void cleanup_data_directory(const std::vector<file_info>& files) const;

void create_config_file_if_not_exists() const; //ugly fix for t7x ext.dll
};
}

0 comments on commit d6fd41e

Please sign in to comment.