Skip to content

Commit

Permalink
chore: Fix installer
Browse files Browse the repository at this point in the history
  • Loading branch information
shdwmtr committed Jan 11, 2025
1 parent 82a0b11 commit 862ce94
Showing 1 changed file with 28 additions and 24 deletions.
52 changes: 28 additions & 24 deletions src/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,30 +73,34 @@ const static void EntryMain()

#ifdef _WIN32

// try {
// if (std::filesystem::exists(SystemIO::GetInstallPath() / "user32.queue.dll"))
// {
// Logger.Log("Updating shim module from cache...");

// while (true) {
// try {
// std::filesystem::remove(SystemIO::GetInstallPath() / "user32.dll");
// break;
// }
// catch (std::filesystem::filesystem_error& e) {
// continue;
// }
// }

// Logger.Log("Removed old inject shim...");

// std::filesystem::rename(SystemIO::GetInstallPath() / "user32.queue.dll", SystemIO::GetInstallPath() / "user32.dll");
// Logger.Log("Successfully updated user32.dll!");
// }
// }
// catch (std::exception& e) {
// LOG_ERROR("Failed to update user32.dll: {}", e.what());
// }
try {
if (std::filesystem::exists(SystemIO::GetInstallPath() / "user32.queue.dll"))
{
Logger.Log("Updating shim module from cache...");

while (true) {
try {
std::filesystem::remove(SystemIO::GetInstallPath() / "user32.dll");
break;
}
catch (std::filesystem::filesystem_error& e) {
continue;
}
}

Logger.Log("Removed old inject shim...");

std::filesystem::rename(SystemIO::GetInstallPath() / "user32.queue.dll", SystemIO::GetInstallPath() / "user32.dll");
Logger.Log("Successfully updated user32.dll!");
}
}
catch (std::exception& e) {
LOG_ERROR("Failed to update user32.dll: {}", e.what());

#ifdef _WIN32
MessageBoxA(NULL, "Failed to update user32.dll, it's recommended that you reinstall Millennium.", "Oops!", MB_ICONERROR | MB_OK);
#endif
}

std::unique_ptr<StartupParameters> startupParams = std::make_unique<StartupParameters>();

Expand Down

0 comments on commit 862ce94

Please sign in to comment.