diff --git a/src/Cafe/OS/libs/vpad/vpad.cpp b/src/Cafe/OS/libs/vpad/vpad.cpp index 74eb2970..d869eef1 100644 --- a/src/Cafe/OS/libs/vpad/vpad.cpp +++ b/src/Cafe/OS/libs/vpad/vpad.cpp @@ -4,7 +4,6 @@ #include "Cafe/OS/libs/vpad/vpad.h" #include "audio/IAudioAPI.h" #include "Cafe/OS/libs/coreinit/coreinit_Time.h" -#include #include "config/ActiveSettings.h" #include "Cafe/OS/libs/coreinit/coreinit_Alarm.h" #include "input/InputManager.h" diff --git a/src/config/ActiveSettings.cpp b/src/config/ActiveSettings.cpp index 5f17efb1..ff5435bc 100644 --- a/src/config/ActiveSettings.cpp +++ b/src/config/ActiveSettings.cpp @@ -1,30 +1,27 @@ -#include "config/ActiveSettings.h" - #include "Cafe/GameProfile/GameProfile.h" -#include "Cemu/Logging/CemuLogging.h" -#include "LaunchSettings.h" -#include "util/helpers/helpers.h" - -#include - #include "Cafe/IOSU/legacy/iosu_crypto.h" #include "Cafe/HW/Latte/Renderer/Vulkan/VulkanAPI.h" #include "Cafe/CafeSystem.h" +#include "Cemu/Logging/CemuLogging.h" +#include "config/ActiveSettings.h" +#include "config/LaunchSettings.h" +#include "util/helpers/helpers.h" std::set -ActiveSettings::LoadOnce(const fs::path& user_data_path, - const fs::path& config_path, - const fs::path& cache_path, - const fs::path& data_path) +ActiveSettings::LoadOnce( + const fs::path& executablePath, + const fs::path& userDataPath, + const fs::path& configPath, + const fs::path& cachePath, + const fs::path& dataPath) { - s_full_path = boost::dll::program_location().generic_wstring(); - - s_user_data_path = user_data_path; - s_config_path = config_path; - s_cache_path = cache_path; - s_data_path = data_path; + s_executable_path = executablePath; + s_user_data_path = userDataPath; + s_config_path = configPath; + s_cache_path = cachePath; + s_data_path = dataPath; std::set failed_write_access; - for (auto&& path : {user_data_path, config_path, cache_path}) + for (auto&& path : {userDataPath, configPath, cachePath}) { if (!fs::exists(path)) { @@ -38,7 +35,7 @@ ActiveSettings::LoadOnce(const fs::path& user_data_path, } } - s_filename = s_full_path.filename(); + s_executable_filename = s_executable_path.filename(); g_config.SetFilename(GetConfigPath("settings.xml").generic_wstring()); g_config.Load(); diff --git a/src/config/ActiveSettings.h b/src/config/ActiveSettings.h index 9621b4d0..678c3966 100644 --- a/src/config/ActiveSettings.h +++ b/src/config/ActiveSettings.h @@ -35,13 +35,14 @@ private: public: // Set directories and return all directories that failed write access test static std::set - LoadOnce(const fs::path& user_data_path, - const fs::path& config_path, - const fs::path& cache_path, - const fs::path& data_path); + LoadOnce(const fs::path& executablePath, + const fs::path& userDataPath, + const fs::path& configPath, + const fs::path& cachePath, + const fs::path& dataPath); - [[nodiscard]] static fs::path GetFullPath() { return s_full_path; } - [[nodiscard]] static fs::path GetFilename() { return s_filename; } + [[nodiscard]] static fs::path GetExecutablePath() { return s_executable_path; } + [[nodiscard]] static fs::path GetExecutableFilename() { return s_executable_filename; } template [[nodiscard]] static fs::path GetUserDataPath(TArgs&&... args){ return GetPath(s_user_data_path, std::forward(args)...); }; template @@ -60,12 +61,12 @@ public: [[nodiscard]] static fs::path GetDefaultMLCPath(); private: - inline static fs::path s_full_path; // full filename + inline static fs::path s_executable_path; inline static fs::path s_user_data_path; inline static fs::path s_config_path; inline static fs::path s_cache_path; inline static fs::path s_data_path; - inline static fs::path s_filename; // cemu.exe + inline static fs::path s_executable_filename; // cemu.exe inline static fs::path s_mlc_path; public: diff --git a/src/config/NetworkSettings.cpp b/src/config/NetworkSettings.cpp index 2227b981..20df8251 100644 --- a/src/config/NetworkSettings.cpp +++ b/src/config/NetworkSettings.cpp @@ -2,7 +2,6 @@ #include "ActiveSettings.h" #include "LaunchSettings.h" #include "CemuConfig.h" -#include #include "Common/FileStream.h" XMLNetworkConfig_t n_config(L"network_services.xml"); diff --git a/src/gui/CemuApp.cpp b/src/gui/CemuApp.cpp index 92ba9436..73cbcb75 100644 --- a/src/gui/CemuApp.cpp +++ b/src/gui/CemuApp.cpp @@ -80,8 +80,8 @@ bool CemuApp::OnInit() { fs::path user_data_path, config_path, cache_path, data_path; auto standardPaths = wxStandardPaths::Get(); -#ifdef PORTABLE fs::path exePath(standardPaths.GetExecutablePath().ToStdString()); +#ifdef PORTABLE #if MACOS_BUNDLE exePath = exePath.parent_path().parent_path().parent_path(); #endif @@ -108,7 +108,7 @@ bool CemuApp::OnInit() cache_path = standardPaths.GetUserDir(wxStandardPaths::Dir::Dir_Cache).ToStdString(); cache_path /= appName.ToStdString(); #endif - auto failed_write_access = ActiveSettings::LoadOnce(user_data_path, config_path, cache_path, data_path); + auto failed_write_access = ActiveSettings::LoadOnce(exePath, user_data_path, config_path, cache_path, data_path); for (auto&& path : failed_write_access) wxMessageBox(fmt::format("Cemu can't write to {} !", path.generic_string()), _("Warning"), wxOK | wxCENTRE | wxICON_EXCLAMATION, nullptr); diff --git a/src/gui/CemuUpdateWindow.cpp b/src/gui/CemuUpdateWindow.cpp index 5a6f05f5..f3568ee7 100644 --- a/src/gui/CemuUpdateWindow.cpp +++ b/src/gui/CemuUpdateWindow.cpp @@ -471,13 +471,13 @@ void CemuUpdateWindow::WorkerThread() break; // apply update - fs::path exePath = fs::path(wxStandardPaths::Get().GetExecutablePath().ToStdString()); + fs::path exePath = ActiveSettings::GetExecutablePath(); std::wstring target_directory = exePath.parent_path().generic_wstring(); if (target_directory[target_directory.size() - 1] == '/') target_directory = target_directory.substr(0, target_directory.size() - 1); // remove trailing / // get exe name - const auto exec = ActiveSettings::GetFullPath(); + const auto exec = ActiveSettings::GetExecutablePath(); const auto target_exe = fs::path(exec).replace_extension("exe.backup"); fs::rename(exec, target_exe); m_restartFile = exec; diff --git a/src/main.cpp b/src/main.cpp index 786cbe47..c27b1e60 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -271,7 +271,7 @@ void HandlePostUpdate() { // finalize update process // delete update cemu.exe.backup if available - const auto filename = ActiveSettings::GetFullPath().replace_extension("exe.backup"); + const auto filename = ActiveSettings::GetExecutablePath().replace_extension("exe.backup"); if (fs::exists(filename)) { #if BOOST_OS_WINDOWS diff --git a/vcpkg.json b/vcpkg.json index 6bd91d7e..d0facf8b 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -17,9 +17,7 @@ "boost-program-options", "boost-nowide", "boost-algorithm", - "boost-range", "boost-functional", - "boost-dll", "boost-optional", "boost-signals2", "boost-asio",