Fix issue where #hotfix doesn't work properly in new Windows installations

This commit is contained in:
Akkadius 2020-07-02 21:31:50 -05:00
parent a78c3b9800
commit 36e064a7b3

View File

@ -12822,15 +12822,23 @@ void command_hotfix(Client *c, const Seperator *sep)
c->Message(Chat::White, "Creating and applying hotfix");
std::thread t1(
[c, hotfix_name]() {
std::string shared_memory_path;
#ifdef WIN32
if(hotfix_name.length() > 0) {
if(system(StringFormat("shared_memory -hotfix=%s", hotfix_name.c_str()).c_str()));
} else {
if(system(StringFormat("shared_memory").c_str()));
shared_memory_path = "shared_memory";
if (file_exists("bin/shared_memory")) {
shared_memory_path = "bin/shared_memory";
}
if (hotfix_name.length() > 0) {
if (system(StringFormat("%s -hotfix=%s", shared_memory_path.c_str(), hotfix_name.c_str()).c_str())) {}
}
else {
if (system(StringFormat("%s", shared_memory_path.c_str()).c_str())) {}
}
#else
std::string shared_memory_path = "./shared_memory";
shared_memory_path = "./shared_memory";
if (file_exists("./bin/shared_memory")) {
shared_memory_path = "./bin/shared_memory";
}