From c2fa2963445a71bbf7131cea1ff624acccdb2210 Mon Sep 17 00:00:00 2001 From: louist103 <35883445+louist103@users.noreply.github.com> Date: Sat, 12 Apr 2025 19:04:31 -0400 Subject: [PATCH] Remove extractor directory from actions builds. --- CMakeLists.txt | 14 +++++++------- soh/soh/Extractor/Extract.cpp | 15 ++++++++++----- soh/soh/OTRGlobals.cpp | 8 ++++---- 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c45dd81d..c4de48716 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -176,13 +176,13 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") install(PROGRAMS "${CMAKE_BINARY_DIR}/linux/soh.sh" DESTINATION . COMPONENT appimage) install(FILES "${CMAKE_BINARY_DIR}/soh/soh.o2r" DESTINATION . COMPONENT ship) install(TARGETS ZAPD DESTINATION ./assets/extractor COMPONENT extractor) -install(DIRECTORY "${CMAKE_SOURCE_DIR}/soh/assets/extractor/" DESTINATION ./assets/extractor COMPONENT extractor) -install(DIRECTORY "${CMAKE_SOURCE_DIR}/soh/assets/xml/" DESTINATION ./assets/extractor/xmls COMPONENT extractor) +install(DIRECTORY "${CMAKE_SOURCE_DIR}/soh/assets/extractor/" DESTINATION ./assets COMPONENT extractor) +install(DIRECTORY "${CMAKE_SOURCE_DIR}/soh/assets/xml/" DESTINATION ./assets/xml COMPONENT extractor) endif() if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows") -install(DIRECTORY "${CMAKE_SOURCE_DIR}/soh/assets/extractor/" DESTINATION ./assets/extractor COMPONENT ship) -install(DIRECTORY "${CMAKE_SOURCE_DIR}/soh/assets/xml/" DESTINATION ./assets/extractor/xmls COMPONENT ship) +install(DIRECTORY "${CMAKE_SOURCE_DIR}/soh/assets/extractor/" DESTINATION ./assets/ COMPONENT ship) +install(DIRECTORY "${CMAKE_SOURCE_DIR}/soh/assets/xml/" DESTINATION ./assets/xml COMPONENT ship) endif() find_package(Python3 COMPONENTS Interpreter) @@ -258,12 +258,12 @@ add_custom_target(CreateOSXIcons ) add_dependencies(soh CreateOSXIcons) -install(TARGETS ZAPD DESTINATION ${CMAKE_BINARY_DIR}/assets/extractor) +install(TARGETS ZAPD DESTINATION ${CMAKE_BINARY_DIR}/assets) set(PROGRAM_PERMISSIONS_EXECUTE OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ) -install(DIRECTORY "${CMAKE_SOURCE_DIR}/soh/assets/extractor/" DESTINATION ./assets/extractor) -install(DIRECTORY "${CMAKE_SOURCE_DIR}/soh/assets/xml/" DESTINATION ./assets/extractor/xmls) +install(DIRECTORY "${CMAKE_SOURCE_DIR}/soh/assets/extractor/" DESTINATION ./assets/) +install(DIRECTORY "${CMAKE_SOURCE_DIR}/soh/assets/xml/" DESTINATION ./assets/xml) install(DIRECTORY ${CMAKE_BINARY_DIR}/assets DESTINATION . diff --git a/soh/soh/Extractor/Extract.cpp b/soh/soh/Extractor/Extract.cpp index 340f1697b..8ee3c97a6 100644 --- a/soh/soh/Extractor/Extract.cpp +++ b/soh/soh/Extractor/Extract.cpp @@ -609,7 +609,7 @@ std::string Extractor::Mkdtemp() { extern "C" int zapd_main(int argc, char** argv); bool Extractor::CallZapd(std::string installPath, std::string exportdir) { - constexpr int argc = 18; + constexpr int argc = 22; char xmlPath[1024]; char confPath[1024]; char portVersion[18]; // 5 digits for int16_max (x3) + separators + terminator @@ -632,8 +632,8 @@ bool Extractor::CallZapd(std::string installPath, std::string exportdir) { std::filesystem::current_path(tempdir); - snprintf(xmlPath, 1024, "assets/extractor/xmls/%s", version); - snprintf(confPath, 1024, "assets/extractor/Config_%s.xml", version); + snprintf(xmlPath, 1024, "assets/xml/%s", version); + snprintf(confPath, 1024, "assets/Config_%s.xml", version); snprintf(portVersion, 18, "%d.%d.%d", gBuildVersionMajor, gBuildVersionMinor, gBuildVersionPatch); argv[0] = "ZAPD"; @@ -643,9 +643,9 @@ bool Extractor::CallZapd(std::string installPath, std::string exportdir) { argv[4] = "-b"; argv[5] = romPath.c_str(); argv[6] = "-fl"; - argv[7] = "assets/extractor/filelists"; + argv[7] = "assets/filelists"; argv[8] = "-gsf"; - argv[9] = "1"; + argv[9] = "0"; argv[10] = "-rconf"; argv[11] = confPath; argv[12] = "-se"; @@ -654,6 +654,11 @@ bool Extractor::CallZapd(std::string installPath, std::string exportdir) { argv[15] = otrFile; argv[16] = "--portVer"; argv[17] = portVersion; + argv[18] = "-o"; + argv[19] = "placeholder"; + argv[20] = "-osf"; + argv[21] = "placeholder"; + #ifdef _WIN32 // Grab a handle to the command window. diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index 62a1972f2..6dde3073a 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -1040,10 +1040,10 @@ void DetectOTRVersion(std::string fileName, bool isMQ) { if (Extractor::ShowYesNoBox("Old OTR File Found", msgBuf) == IDYES) { std::string installPath = Ship::Context::GetAppBundlePath(); - if (!std::filesystem::exists(installPath + "/assets/extractor")) { + if (!std::filesystem::exists(installPath + "/assets")) { Extractor::ShowErrorBox( "Extractor assets not found", - "Unable to regenerate. Missing assets/extractor folder needed to generate OTR file.\n\nExiting..."); + "Unable to regenerate. Missing assets/ folder needed to generate OTR file.\n\nExiting..."); exit(1); } @@ -1163,10 +1163,10 @@ extern "C" void InitOTR() { #if not defined(__SWITCH__) && not defined(__WIIU__) std::string installPath = Ship::Context::GetAppBundlePath(); - if (!std::filesystem::exists(installPath + "/assets/extractor")) { + if (!std::filesystem::exists(installPath + "/assets")) { Extractor::ShowErrorBox( "Extractor assets not found", - "No OTR files found. Missing assets/extractor folder needed to generate OTR file.\n\nExiting..."); + "No OTR files found. Missing assets/ folder needed to generate OTR file.\n\nExiting..."); exit(1); }