Compare commits

...

5 Commits

Author SHA1 Message Date
WerWolv
dbe8bfd75f fix: Standard magic file not getting bundled into executable correctly 2024-06-29 19:43:40 +02:00
WerWolv
c6c599c75b build: Bumped version to 1.35.2 2024-06-29 19:26:00 +02:00
WerWolv
c2b7b4a11e fix: Default folders still not being created correctly on Linux 2024-06-29 19:25:20 +02:00
WerWolv
495255484e build: Bumped version to 1.35.1 2024-06-29 18:50:10 +02:00
WerWolv
b92b0922d5 fix: Default folders not being created correctly anymore 2024-06-29 18:50:01 +02:00
4 changed files with 24 additions and 8 deletions

View File

@@ -1 +1 @@
1.35.0
1.35.2

View File

@@ -117,6 +117,10 @@ macro(add_imhex_plugin)
endmacro()
macro(add_romfs_resource input output)
if (NOT EXISTS ${input})
message(WARNING "Resource file ${input} does not exist")
endif()
configure_file(${input} ${CMAKE_CURRENT_BINARY_DIR}/romfs/${output} COPYONLY)
list(APPEND LIBROMFS_RESOURCE_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/romfs)

View File

@@ -31,14 +31,26 @@ namespace hex::init {
return true;
}
static bool isSubPathWritable(std::fs::path path) {
while (path.root_directory() != path) {
if (hex::fs::isPathWritable(path))
return true;
path = path.parent_path();
}
return false;
}
bool createDirectories() {
bool result = true;
// Try to create all default directories
for (auto path : paths::All) {
for (auto &folder : path->write()) {
for (auto &folder : path->all()) {
try {
wolv::io::fs::createDirectories(folder);
if (isSubPathWritable(folder.parent_path()))
wolv::io::fs::createDirectories(folder);
} catch (...) {
log::error("Failed to create folder {}!", wolv::util::toUTF8String(folder));
result = false;

View File

@@ -2,6 +2,11 @@ cmake_minimum_required(VERSION 3.16)
include(ImHexPlugin)
find_file(DEFAULT_MAGIC_FILE_PATH magic.mgc HINTS ${LIBMAGIC_INCLUDE_DIR}/../share/misc)
if (EXISTS ${DEFAULT_MAGIC_FILE_PATH})
add_romfs_resource(${DEFAULT_MAGIC_FILE_PATH} always_auto_extract/magic/magic.mgc)
endif ()
add_imhex_plugin(
NAME
builtin
@@ -122,11 +127,6 @@ add_imhex_plugin(
LLVMDemangle
)
find_file(DEFAULT_MAGIC_FILE_PATH magic.mgc HINTS ${LIBMAGIC_INCLUDE_DIR}/../share/misc)
if (DEFAULT_MAGIC_FILE_PATH)
add_romfs_resource(${DEFAULT_MAGIC_FILE_PATH} always_auto_extract/magic/magic.mgc)
endif ()
if (WIN32)
target_link_libraries(builtin PRIVATE setupapi)
endif ()