Move all settings to Windows64/Settings & Ensure the folder exists

This commit is contained in:
2026-05-13 01:11:43 -04:00
parent e0c09e7afb
commit 590556ae49
3 changed files with 14 additions and 1 deletions
+1
View File
@@ -85,4 +85,5 @@ add_copyredist_target(Minecraft.Client)
# Make sure GameHDD exists on Windows
if(PLATFORM_NAME STREQUAL "Windows64")
add_gamehdd_target(Minecraft.Client)
add_settings_target(Minecraft.Client)
endif()
+1 -1
View File
@@ -788,7 +788,7 @@ static void Win64_GetSettingsPath(char *outPath, DWORD size)
GetModuleFileNameA(nullptr, outPath, size);
char *lastSlash = strrchr(outPath, '\\');
if (lastSlash) *(lastSlash + 1) = '\0';
strncat_s(outPath, size, "settings.dat", _TRUNCATE);
strncat_s(outPath, size, "Windows64/Settings/settings.dat", _TRUNCATE);
}
static void Win64_SaveSettings(GAME_SETTINGS *gs)
{
+12
View File
@@ -10,6 +10,18 @@ function(add_gamehdd_target TARGET_NAME)
set_property(TARGET EnsureGameHDD_${TARGET_NAME} PROPERTY FOLDER "Build")
endfunction()
# Make sure the Settings directory exists
function(add_settings_target TARGET_NAME)
add_custom_target(EnsureSettings_${TARGET_NAME} ALL
COMMAND ${CMAKE_COMMAND}
-E make_directory "$<TARGET_FILE_DIR:${TARGET_NAME}>/Windows64/Settings"
COMMENT "Ensuring Settings directory exists..."
VERBATIM
)
add_dependencies(${TARGET_NAME} EnsureSettings_${TARGET_NAME})
set_property(TARGET EnsureSettings_${TARGET_NAME} PROPERTY FOLDER "Build")
endfunction()
# Copy any needed redist files to the output directory
function(add_copyredist_target TARGET_NAME)
set(COPY_SCRIPT "${CMAKE_SOURCE_DIR}/cmake/CopyFolderScript.cmake")