fix: don't allow portable builds on macOS

This commit is contained in:
Sefa Eyeoglu 2022-03-23 14:38:58 +01:00
parent 90d4acd1a1
commit 6ed130fc16
No known key found for this signature in database
GPG Key ID: C10411294912A422
2 changed files with 6 additions and 2 deletions

View File

@ -169,8 +169,10 @@ add_subdirectory(program_info)
# Target install directory, relative to CMAKE_INSTALL_PREFIx # Target install directory, relative to CMAKE_INSTALL_PREFIx
set(BUNDLE_DEST_DIR ".") set(BUNDLE_DEST_DIR ".")
# Install "portable.txt" if selected component is "portable" if(NOT (UNIX AND APPLE))
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/${Launcher_Portable_File}" DESTINATION ${BUNDLE_DEST_DIR} COMPONENT portable EXCLUDE_FROM_ALL) # Install "portable.txt" if selected component is "portable"
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/${Launcher_Portable_File}" DESTINATION ${BUNDLE_DEST_DIR} COMPONENT portable EXCLUDE_FROM_ALL)
endif()
if(UNIX AND APPLE) if(UNIX AND APPLE)
set(BINARY_DEST_DIR "${Launcher_Name}.app/Contents/MacOS") set(BINARY_DEST_DIR "${Launcher_Name}.app/Contents/MacOS")

View File

@ -363,10 +363,12 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
} }
#endif #endif
#ifndef Q_OS_MACOS
if (QFile::exists(FS::PathCombine(m_rootPath, "portable.txt"))) { if (QFile::exists(FS::PathCombine(m_rootPath, "portable.txt"))) {
dataPath = m_rootPath; dataPath = m_rootPath;
adjustedBy = "Portable data path"; adjustedBy = "Portable data path";
} }
#endif
} }
if (!FS::ensureFolderPathExists(dataPath)) if (!FS::ensureFolderPathExists(dataPath))