ENH: GUI: add arm64 check logic for windows

jira: no-jira
Change-Id: Ic788d4ae9218b909eae5ce571d4436c39e77230a
(cherry picked from commit 323184e42c5f85c8738b03b890e5aaf3818e8858)
This commit is contained in:
lane.wei
2025-04-07 20:09:51 +08:00
committed by Noisyfox
parent 7af9802688
commit 320cd87f0b
5 changed files with 49 additions and 1 deletions

View File

@@ -943,6 +943,16 @@ void PresetUpdater::priv::sync_plugins(std::string http_url, std::string plugin_
}
}
#if defined(__WINDOWS__)
if (GUI::wxGetApp().is_running_on_arm64()) {
//set to arm64 for plugins
std::map<std::string, std::string> current_headers = Slic3r::Http::get_extra_headers();
current_headers["X-BBL-OS-Type"] = "win_arm64";
Slic3r::Http::set_extra_headers(current_headers);
BOOST_LOG_TRIVIAL(info) << boost::format("set X-BBL-OS-Type to win_arm64");
}
#endif
try {
std::map<std::string, Resource> resources
{
@@ -953,6 +963,16 @@ void PresetUpdater::priv::sync_plugins(std::string http_url, std::string plugin_
catch (std::exception& e) {
BOOST_LOG_TRIVIAL(warning) << format("[Orca Updater] sync_plugins: %1%", e.what());
}
#if defined(__WINDOWS__)
if (GUI::wxGetApp().is_running_on_arm64()) {
//set back
std::map<std::string, std::string> current_headers = Slic3r::Http::get_extra_headers();
current_headers["X-BBL-OS-Type"] = "windows";
Slic3r::Http::set_extra_headers(current_headers);
BOOST_LOG_TRIVIAL(info) << boost::format("set X-BBL-OS-Type back to windows");
}
#endif
bool result = get_cached_plugins_version(cached_version, force_upgrade);
if (result) {