updater: Fixed updater not working properly on macOS
This commit is contained in:
parent
a42e4c5299
commit
8b2184f8e3
2
lib/external/libwolv
vendored
2
lib/external/libwolv
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 2ea4b7d73b9d8828c70d88ac729b00c603f8f7e7
|
Subproject commit 4b42068eca113e45e1a052e0437a5c7a96c3eda5
|
@ -44,7 +44,7 @@ namespace hex::paths {
|
|||||||
|
|
||||||
if (includeSystemFolders) {
|
if (includeSystemFolders) {
|
||||||
if (auto executablePath = wolv::io::fs::getExecutablePath(); executablePath.has_value()) {
|
if (auto executablePath = wolv::io::fs::getExecutablePath(); executablePath.has_value()) {
|
||||||
paths.push_back(*executablePath);
|
paths.push_back(executablePath->parent_path());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -341,7 +341,7 @@ namespace hex {
|
|||||||
#if defined(OS_WINDOWS)
|
#if defined(OS_WINDOWS)
|
||||||
std::ignore = system(hex::format("start \"\" {0}", command).c_str());
|
std::ignore = system(hex::format("start \"\" {0}", command).c_str());
|
||||||
#elif defined(OS_MACOS)
|
#elif defined(OS_MACOS)
|
||||||
std::ignore = system(hex::format("open {0}", command).c_str());
|
std::ignore = system(hex::format("{0}", command).c_str());
|
||||||
#elif defined(OS_LINUX)
|
#elif defined(OS_LINUX)
|
||||||
executeCmd({"xdg-open", command});
|
executeCmd({"xdg-open", command});
|
||||||
#elif defined(OS_WEB)
|
#elif defined(OS_WEB)
|
||||||
|
@ -7,14 +7,10 @@ add_executable(updater
|
|||||||
target_compile_definitions(updater PRIVATE IMHEX_PROJECT_NAME="${PROJECT_NAME}")
|
target_compile_definitions(updater PRIVATE IMHEX_PROJECT_NAME="${PROJECT_NAME}")
|
||||||
target_link_libraries(updater PRIVATE libimhex ${FMT_LIBRARIES})
|
target_link_libraries(updater PRIVATE libimhex ${FMT_LIBRARIES})
|
||||||
add_dependencies(main updater)
|
add_dependencies(main updater)
|
||||||
|
setupCompilerFlags(updater)
|
||||||
|
|
||||||
if (APPLE)
|
|
||||||
set(OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${BUNDLE_NAME}/Contents/MacOS")
|
|
||||||
else ()
|
|
||||||
set(OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set_target_properties(updater PROPERTIES
|
set_target_properties(updater PROPERTIES
|
||||||
OUTPUT_NAME "imhex-updater"
|
OUTPUT_NAME "imhex-updater"
|
||||||
RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_DIRECTORY}
|
RUNTIME_OUTPUT_DIRECTORY ${IMHEX_MAIN_OUTPUT_DIRECTORY}
|
||||||
)
|
)
|
@ -80,9 +80,9 @@ std::string getUpdateType() {
|
|||||||
return "win-msi";
|
return "win-msi";
|
||||||
#elif defined (OS_MACOS)
|
#elif defined (OS_MACOS)
|
||||||
#if defined(__x86_64__)
|
#if defined(__x86_64__)
|
||||||
return "mac-dmg-x86";
|
return "macos-dmg-x86";
|
||||||
#elif defined(__arm__)
|
#elif defined(__arm64__)
|
||||||
return "mac-dmg-arm";
|
return "macos-dmg-arm";
|
||||||
#endif
|
#endif
|
||||||
#elif defined (OS_LINUX)
|
#elif defined (OS_LINUX)
|
||||||
if (hex::executeCommand("grep 'ID=ubuntu' /etc/os-release") == 0) {
|
if (hex::executeCommand("grep 'ID=ubuntu' /etc/os-release") == 0) {
|
||||||
@ -113,15 +113,15 @@ int installUpdate(const std::string &type, std::fs::path updatePath) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
constexpr static auto UpdateHandlers = {
|
constexpr static auto UpdateHandlers = {
|
||||||
UpdateHandler { "win-msi", ".msi", "msiexec /i {} /qb" },
|
UpdateHandler { "win-msi", ".msi", "msiexec /i \"{}\" /qb" },
|
||||||
UpdateHandler { "macos-dmg-x86", ".dmg", "hdiutil attach {}" },
|
UpdateHandler { "macos-dmg-x86", ".dmg", "hdiutil attach -autoopen \"{}\"" },
|
||||||
UpdateHandler { "macos-dmg-arm", ".dmg", "hdiutil attach {}" },
|
UpdateHandler { "macos-dmg-arm", ".dmg", "hdiutil attach -autoopen \"{}\"" },
|
||||||
UpdateHandler { "linux-deb-24.04", ".deb", "sudo apt update && sudo apt install -y --fix-broken {}" },
|
UpdateHandler { "linux-deb-24.04", ".deb", "sudo apt update && sudo apt install -y --fix-broken \"{}\"" },
|
||||||
UpdateHandler { "linux-deb-24.10", ".deb", "sudo apt update && sudo apt install -y --fix-broken {}" },
|
UpdateHandler { "linux-deb-24.10", ".deb", "sudo apt update && sudo apt install -y --fix-broken \"{}\"" },
|
||||||
UpdateHandler { "linux-rpm-40", ".rpm", "sudo rpm -i {}" },
|
UpdateHandler { "linux-rpm-40", ".rpm", "sudo rpm -i \"{}\"" },
|
||||||
UpdateHandler { "linux-rpm-41", ".rpm", "sudo rpm -i {}" },
|
UpdateHandler { "linux-rpm-41", ".rpm", "sudo rpm -i \"{}\"" },
|
||||||
UpdateHandler { "linux-rpm-rawhide", ".rpm", "sudo rpm -i {}" },
|
UpdateHandler { "linux-rpm-rawhide", ".rpm", "sudo rpm -i \"{}\"" },
|
||||||
UpdateHandler { "linux-arch", ".zst", "sudo pacman -Syy && sudo pacman -U --noconfirm {}" }
|
UpdateHandler { "linux-arch", ".zst", "sudo pacman -Syy && sudo pacman -U --noconfirm \"{}\"" }
|
||||||
};
|
};
|
||||||
|
|
||||||
for (const auto &handler : UpdateHandlers) {
|
for (const auto &handler : UpdateHandlers) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user