From 012b007e56c8121e5dc6434765f16647edd23585 Mon Sep 17 00:00:00 2001 From: Petr Mrázek Date: Tue, 7 Jan 2014 02:43:25 +0100 Subject: Do not log each and every possible update. Only the latest one. --- logic/updater/UpdateChecker.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'logic') diff --git a/logic/updater/UpdateChecker.cpp b/logic/updater/UpdateChecker.cpp index 489e7769..8a280dd1 100644 --- a/logic/updater/UpdateChecker.cpp +++ b/logic/updater/UpdateChecker.cpp @@ -142,8 +142,6 @@ void UpdateChecker::updateCheckFinished(bool notifyNoUpdate) if (newestVersion.value("Id").toVariant().toInt() < version.value("Id").toVariant().toInt()) { - QLOG_DEBUG() << "Found newer version with ID" - << version.value("Id").toVariant().toInt(); newestVersion = version; } } @@ -153,6 +151,7 @@ void UpdateChecker::updateCheckFinished(bool notifyNoUpdate) int newBuildNumber = newestVersion.value("Id").toVariant().toInt(); if (newBuildNumber != MMC->version().build) { + QLOG_DEBUG() << "Found newer version with ID" << newBuildNumber; // Update! emit updateAvailable(m_repoUrl, newestVersion.value("Name").toVariant().toString(), newBuildNumber); @@ -262,3 +261,4 @@ void UpdateChecker::chanListDownloadFailed() QLOG_ERROR() << "Failed to download channel list."; emit channelListLoaded(); } + -- cgit From 5fe0ed7e8fad7654f9fe61669e596fe74bac8740 Mon Sep 17 00:00:00 2001 From: Sky Date: Tue, 7 Jan 2014 03:16:47 +0000 Subject: Return a properly sorted list of checked javas --- logic/JavaChecker.cpp | 2 ++ logic/JavaChecker.h | 2 ++ logic/JavaCheckerJob.cpp | 7 +++---- logic/lists/JavaVersionList.cpp | 4 ++++ 4 files changed, 11 insertions(+), 4 deletions(-) (limited to 'logic') diff --git a/logic/JavaChecker.cpp b/logic/JavaChecker.cpp index 113974ff..a470bfa2 100644 --- a/logic/JavaChecker.cpp +++ b/logic/JavaChecker.cpp @@ -47,6 +47,7 @@ void JavaChecker::finished(int exitcode, QProcess::ExitStatus status) JavaCheckResult result; { result.path = path; + result.id = id; } if (status == QProcess::CrashExit || exitcode == 1) @@ -104,6 +105,7 @@ void JavaChecker::error(QProcess::ProcessError err) JavaCheckResult result; { result.path = path; + result.id = id; } emit checkFinished(result); diff --git a/logic/JavaChecker.h b/logic/JavaChecker.h index 291bf46c..4705381c 100644 --- a/logic/JavaChecker.h +++ b/logic/JavaChecker.h @@ -15,6 +15,7 @@ struct JavaCheckResult QString javaVersion; bool valid = false; bool is_64bit = false; + int id; }; typedef std::shared_ptr QProcessPtr; @@ -27,6 +28,7 @@ public: void performCheck(); QString path; + int id; signals: void checkFinished(JavaCheckResult result); diff --git a/logic/JavaCheckerJob.cpp b/logic/JavaCheckerJob.cpp index 36a8a050..bb39bf62 100644 --- a/logic/JavaCheckerJob.cpp +++ b/logic/JavaCheckerJob.cpp @@ -26,10 +26,8 @@ void JavaCheckerJob::partFinished(JavaCheckResult result) << javacheckers.size(); emit progress(num_finished, javacheckers.size()); - javaresults.append(result); - int result_size = javacheckers.size(); - - emit progress(num_finished, result_size); + QLOG_INFO() << "after replace" << result.id << javaresults.size(); + javaresults.replace(result.id, result); if (num_finished == javacheckers.size()) { @@ -43,6 +41,7 @@ void JavaCheckerJob::start() m_running = true; for (auto iter : javacheckers) { + javaresults.append(JavaCheckResult()); connect(iter.get(), SIGNAL(checkFinished(JavaCheckResult)), SLOT(partFinished(JavaCheckResult))); iter->performCheck(); } diff --git a/logic/lists/JavaVersionList.cpp b/logic/lists/JavaVersionList.cpp index e8c5acd0..eb1c5650 100644 --- a/logic/lists/JavaVersionList.cpp +++ b/logic/lists/JavaVersionList.cpp @@ -182,13 +182,17 @@ void JavaListLoadTask::executeTask() connect(m_job.get(), SIGNAL(progress(int, int)), this, SLOT(checkerProgress(int, int))); QLOG_DEBUG() << "Probing the following Java paths: "; + int id = 0; for(QString candidate : candidate_paths) { QLOG_DEBUG() << " " << candidate; auto candidate_checker = new JavaChecker(); candidate_checker->path = candidate; + candidate_checker->id = id; m_job->addJavaCheckerAction(JavaCheckerPtr(candidate_checker)); + + id++; } m_job->start(); -- cgit From 7773e771509935183a99e42ee61314431dd3f478 Mon Sep 17 00:00:00 2001 From: Sky Date: Tue, 7 Jan 2014 03:18:26 +0000 Subject: Don't include debugging messages :( --- logic/JavaCheckerJob.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'logic') diff --git a/logic/JavaCheckerJob.cpp b/logic/JavaCheckerJob.cpp index bb39bf62..b0aea758 100644 --- a/logic/JavaCheckerJob.cpp +++ b/logic/JavaCheckerJob.cpp @@ -26,7 +26,6 @@ void JavaCheckerJob::partFinished(JavaCheckResult result) << javacheckers.size(); emit progress(num_finished, javacheckers.size()); - QLOG_INFO() << "after replace" << result.id << javaresults.size(); javaresults.replace(result.id, result); if (num_finished == javacheckers.size()) -- cgit From 3202b972f8dac05d4464eb46724b1bd703b9b21d Mon Sep 17 00:00:00 2001 From: Forkk Date: Tue, 7 Jan 2014 18:09:05 -0600 Subject: Rework version numbering system. Again... --- CMakeLists.txt | 30 +++++++++++------ MultiMC.cpp | 4 +-- MultiMCVersion.h | 63 +++++++++++++++++++---------------- config.h.in | 12 ++++--- logic/updater/NotificationChecker.cpp | 11 +++--- logic/updater/NotificationChecker.h | 2 +- 6 files changed, 70 insertions(+), 52 deletions(-) (limited to 'logic') diff --git a/CMakeLists.txt b/CMakeLists.txt index 160d09f5..79b79734 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -128,12 +128,16 @@ SET(MultiMC_NEWS_RSS_URL "http://multimc.org/rss.xml" CACHE STRING "URL to fetch ######## Set version numbers ######## SET(MultiMC_VERSION_MAJOR 0) SET(MultiMC_VERSION_MINOR 0) +SET(MultiMC_VERSION_HOTFIX 0) # Build number SET(MultiMC_VERSION_BUILD -1 CACHE STRING "Build number. -1 for no build number.") -# Build type -SET(MultiMC_VERSION_BUILD_TYPE "custombuild" CACHE STRING "Build type. If this is set, it is appended to the end of the version string with a dash (-. It is not used for anything other than indicating in the version string what type of build this is (eg 'lin64').") +# Version type +SET(MultiMC_VERSION_TYPE "Custom" CACHE STRING "MultiMC's version type. This should be one of 'Custom', 'Release', 'ReleaseCandidate', or 'Development', depending on what type of version this is.") + +# Build platform. +SET(MultiMC_BUILD_PLATFORM "" CACHE STRING "A short string identifying the platform that this build was built for. Only used by the notification system and to display in the about dialog.") # Version channel SET(MultiMC_VERSION_CHANNEL "" CACHE STRING "The current build's channel. Included in the version string.") @@ -147,16 +151,20 @@ SET(MultiMC_UPDATER false CACHE BOOL "Whether or not the update system is enable # Notification URL SET(MultiMC_NOTIFICATION_URL "" CACHE STRING "URL for checking for notifications.") +SET(MultiMC_RELEASE_VERSION_NAME "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}") +IF (MultiMC_VERSION_HOTFIX GREATER 0) + SET(MultiMC_RELEASE_VERSION_NAME "${MultiMC_RELEASE_VERSION_NAME}.${MultiMC_VERSION_HOTFIX}") +ENDIF() + # Build a version string to display in the configure logs. -SET(MultiMC_VERSION_STRING "5.${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}") -IF (MultiMC_VERSION_BUILD GREATER -1) - SET(MultiMC_VERSION_STRING "${MultiMC_VERSION_STRING}.${MultiMC_VERSION_BUILD}") -ENDIF () -IF (NOT MultiMC_VERSION_CHANNEL STREQUAL "") - SET(MultiMC_VERSION_STRING "${MultiMC_VERSION_STRING}-${MultiMC_VERSION_CHANNEL}") -ENDIF () -IF (NOT MultiMC_VERSION_BUILD_TYPE STREQUAL "") - SET(MultiMC_VERSION_STRING "${MultiMC_VERSION_STRING}-${MultiMC_VERSION_BUILD_TYPE}") +IF (MultiMC_VERSION_TYPE STREQUAL "Custom" OR MultiMC_VERSION_TYPE STREQUAL "Release") + SET(MultiMC_VERSION_STRING "${MultiMC_RELEASE_VERSION_NAME}") +ELSEIF (MultiMC_VERSION_TYPE STREQUAL "ReleaseCandidate") + SET(MultiMC_VERSION_STRING "${MultiMC_RELEASE_VERSION_NAME}-rc${MultiMC_VERSION_BUILD}") +ELSEIF (MultiMC_VERSION_TYPE STREQUAL "Development") + SET(MultiMC_VERSION_STRING "${MultiMC_RELEASE_VERSION_NAME}-dev${MultiMC_VERSION_BUILD}") +ELSE () + MESSAGE(ERROR "Invalid build type.") ENDIF () MESSAGE(STATUS "MultiMC 5 version ${MultiMC_VERSION_STRING}") diff --git a/MultiMC.cpp b/MultiMC.cpp index 7c411693..17fc2e0a 100644 --- a/MultiMC.cpp +++ b/MultiMC.cpp @@ -38,8 +38,8 @@ using namespace Util::Commandline; MultiMC::MultiMC(int &argc, char **argv, bool root_override) - : QApplication(argc, argv), m_version{VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD, - VERSION_CHANNEL, VERSION_BUILD_TYPE} + : QApplication(argc, argv), m_version{VERSION_MAJOR, VERSION_MINOR, VERSION_HOTFIX, + VERSION_BUILD, MultiMCVersion::VERSION_TYPE, VERSION_CHANNEL, BUILD_PLATFORM} { setOrganizationName("MultiMC"); setApplicationName("MultiMC5"); diff --git a/MultiMCVersion.h b/MultiMCVersion.h index 75e017df..e205bec6 100644 --- a/MultiMCVersion.h +++ b/MultiMCVersion.h @@ -18,58 +18,63 @@ #include /*! - * \brief The Version class represents a MultiMC version number. + * \brief The Version class represents a MultiMC version. */ struct MultiMCVersion { + enum Type + { + //! Version type for stable release builds. + Release, + + //! Version type for release candidates. + ReleaseCandidate, + + //! Version type for development builds. + Development, + + //! Version type for custom builds. This is the default when no version type is specified. + Custom + }; + /*! * \brief Converts the Version to a string. * \return The version number in string format (major.minor.revision.build). */ QString toString() const { - QString vstr = QString("5.%1.%2").arg( + QString vstr = QString("%1.%2").arg( QString::number(major), QString::number(minor)); - if (build >= 0) vstr += "." + QString::number(build); - if (!channel.isEmpty()) vstr += "-" + channel; - if (!buildType.isEmpty()) vstr += "-" + buildType; + if (hotfix > 0) vstr += "." + QString::number(hotfix); + + // If the build is a development build or release candidate, add that info to the end. + if (type == Development) vstr += "-dev" + QString::number(build); + else if (type == ReleaseCandidate) vstr += "-rc" + QString::number(build); return vstr; } - /*! - * \brief The major version number. - * This is no longer going to always be 5 for MultiMC 5. Doing so is useless. - * Instead, we'll be starting major off at 1 and incrementing it with every major feature. - */ + //! The major version number. int major; - /*! - * \brief The minor version number. - * This number is incremented for major features and bug fixes. - */ + //! The minor version number. int minor; - /*! - * \brief The build number. - * This number is automatically set by Buildbot it is set to the build number of the buildbot - * build that this build came from. - * If this build didn't come from buildbot and no build number was given to CMake, this will default - * to -1, causing it to not show in this version's string representation. - */ + //! The hotfix number. + int hotfix; + + //! The build number. int build; - /*! - * \brief This build's channel. - */ + //! The build type. + Type type; + + //! The build channel. QString channel; - /*! - * \brief The build type. - * This indicates the type of build that this is. For example, lin64 or custombuild. - */ - QString buildType; + //! A short string identifying the platform that this version is for. For example, lin64 or win32. + QString platform; }; diff --git a/config.h.in b/config.h.in index 8df1fc75..16e9f54e 100644 --- a/config.h.in +++ b/config.h.in @@ -1,13 +1,17 @@ #pragma once -// Minor and major version, used to communicate changes to users. +// Version information #define VERSION_MAJOR @MultiMC_VERSION_MAJOR@ #define VERSION_MINOR @MultiMC_VERSION_MINOR@ - -// Build number, channel, and type -- number and channel are used by the updater, type is purely visual +#define VERSION_HOTFIX @MultiMC_VERSION_HOTFIX@ #define VERSION_BUILD @MultiMC_VERSION_BUILD@ +#define VERSION_TYPE @MultiMC_VERSION_TYPE@ + +// The version channel. This is used by the updater to determine what channel the current version came from. #define VERSION_CHANNEL "@MultiMC_VERSION_CHANNEL@" -#define VERSION_BUILD_TYPE "@MultiMC_VERSION_BUILD_TYPE@" + +// A short string identifying this build's platform. For example, "lin64" or "win32". +#define BUILD_PLATFORM "@MultiMC_BUILD_PLATFORM@" // URL for the updater's channel #define CHANLIST_URL "@MultiMC_CHANLIST_URL@" diff --git a/logic/updater/NotificationChecker.cpp b/logic/updater/NotificationChecker.cpp index 40367eac..b2d67632 100644 --- a/logic/updater/NotificationChecker.cpp +++ b/logic/updater/NotificationChecker.cpp @@ -5,8 +5,8 @@ #include #include "MultiMC.h" +#include "MultiMCVersion.h" #include "logic/net/CacheDownload.h" -#include "config.h" NotificationChecker::NotificationChecker(QObject *parent) : QObject(parent), m_notificationsUrl(QUrl(NOTIFICATION_URL)) @@ -66,7 +66,7 @@ void NotificationChecker::downloadSucceeded(int) entry.id = obj.value("id").toDouble(); entry.message = obj.value("message").toString(); entry.channel = obj.value("channel").toString(); - entry.buildtype = obj.value("buildtype").toString(); + entry.platform = obj.value("platform").toString(); entry.from = obj.value("from").toString(); entry.to = obj.value("to").toString(); const QString type = obj.value("type").toString("critical"); @@ -93,13 +93,14 @@ void NotificationChecker::downloadSucceeded(int) bool NotificationChecker::NotificationEntry::applies() const { - bool channelApplies = channel.isEmpty() || channel == VERSION_CHANNEL; - bool buildtypeApplies = buildtype.isEmpty() || buildtype == VERSION_BUILD_TYPE; + MultiMCVersion version = MMC->version(); + bool channelApplies = channel.isEmpty() || channel == version.channel; + bool platformApplies = platform.isEmpty() || platform == version.platform; bool fromApplies = from.isEmpty() || from == FULL_VERSION_STR || !versionLessThan(FULL_VERSION_STR, from); bool toApplies = to.isEmpty() || to == FULL_VERSION_STR || !versionLessThan(to, FULL_VERSION_STR); - return channelApplies && buildtypeApplies && fromApplies && toApplies; + return channelApplies && platformApplies && fromApplies && toApplies; } bool NotificationChecker::NotificationEntry::versionLessThan(const QString &v1, diff --git a/logic/updater/NotificationChecker.h b/logic/updater/NotificationChecker.h index 20541757..915ee54d 100644 --- a/logic/updater/NotificationChecker.h +++ b/logic/updater/NotificationChecker.h @@ -26,7 +26,7 @@ public: Information } type; QString channel; - QString buildtype; + QString platform; QString from; QString to; bool applies() const; -- cgit From fb83299e592ef7627d5914e0fbce70c570981124 Mon Sep 17 00:00:00 2001 From: Petr Mrázek Date: Wed, 8 Jan 2014 01:27:40 +0100 Subject: Deploy jars instead of extracting them at runtime, remove non-working nvidia fix --- CMakeLists.txt | 139 ++++++++++++++++++++------------------- Hacks.cpp | 8 --- depends/javacheck/CMakeLists.txt | 5 +- depends/launcher/CMakeLists.txt | 3 +- generated.qrc.in | 2 + logic/JavaChecker.cpp | 16 ++--- logic/JavaChecker.h | 2 - logic/LegacyInstance.cpp | 6 +- 8 files changed, 83 insertions(+), 98 deletions(-) delete mode 100644 Hacks.cpp (limited to 'logic') diff --git a/CMakeLists.txt b/CMakeLists.txt index 160d09f5..7ab9983d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,9 +38,7 @@ ELSEIF(MINGW) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -Wall") ENDIF() -################################ INCLUDE LIBRARIES ################################ - -######## 3rd Party Libs ######## +################################ 3rd Party Libs ################################ # Find the required Qt parts find_package(Qt5Core REQUIRED) @@ -75,41 +73,6 @@ query_qmake(QT_HOST_DATA QT_DATA_DIR) set(QT_MKSPECS_DIR ${QT_DATA_DIR}/mkspecs) -######## Included Libs ######## - -# Add quazip -add_subdirectory(depends/quazip) -include_directories(depends/quazip) - -# Add the java launcher and checker -add_subdirectory(depends/launcher) -add_subdirectory(depends/javacheck) - -# Add xz decompression -add_subdirectory(depends/xz-embedded) -include_directories(${XZ_INCLUDE_DIR}) - -# Add pack200 decompression -add_subdirectory(depends/pack200) -include_directories(${PACK200_INCLUDE_DIR}) - -######## MultiMC Libs ######## - -# Add the util library. -add_subdirectory(depends/util) -include_directories(${LIBUTIL_INCLUDE_DIR}) - -# Add the settings library. -add_subdirectory(depends/settings) -include_directories(${LIBSETTINGS_INCLUDE_DIR}) - -# Add the group view library. -add_subdirectory(depends/groupview) -include_directories(${LIBGROUPVIEW_INCLUDE_DIR}) - -# Add the updater -add_subdirectory(mmc_updater) - ################################ SET UP BUILD OPTIONS ################################ ######## Check endianness ######## @@ -209,6 +172,72 @@ ADD_DEFINITIONS(-DLIBSETTINGS_STATIC) ADD_DEFINITIONS(-DLIBUTIL_STATIC) ADD_DEFINITIONS(-DLIBGROUPVIEW_STATIC) +######## Packaging/install paths setup ######## + +IF(UNIX AND APPLE) + SET(BINARY_DEST_DIR MultiMC.app/Contents/MacOS) + SET(PLUGIN_DEST_DIR MultiMC.app/Contents/MacOS) + SET(QTCONF_DEST_DIR MultiMC.app/Contents/Resources) + SET(APPS "\${CMAKE_INSTALL_PREFIX}/MultiMC.app") + + SET(MACOSX_BUNDLE_BUNDLE_NAME "MultiMC") + SET(MACOSX_BUNDLE_INFO_STRING "MultiMC Minecraft launcher and management utility.") + SET(MACOSX_BUNDLE_GUI_IDENTIFIER "org.multimc.MultiMC5") + SET(MACOSX_BUNDLE_BUNDLE_VERSION "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}.${MultiMC_VERSION_REV}.${MultiMC_VERSION_BUILD}") + SET(MACOSX_BUNDLE_SHORT_VERSION_STRING "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}.${MultiMC_VERSION_REV}.${MultiMC_VERSION_BUILD}") + SET(MACOSX_BUNDLE_LONG_VERSION_STRING "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}.${MultiMC_VERSION_REV}.${MultiMC_VERSION_BUILD}") + SET(MACOSX_BUNDLE_ICON_FILE MultiMC.icns) + SET(MACOSX_BUNDLE_COPYRIGHT "Copyright 2013 MultiMC Contributors") +ELSEIF(UNIX) + SET(BINARY_DEST_DIR bin) + SET(PLUGIN_DEST_DIR plugins) + SET(QTCONF_DEST_DIR .) + SET(APPS "\${CMAKE_INSTALL_PREFIX}/bin/MultiMC") +ELSEIF(WIN32) + SET(BINARY_DEST_DIR .) + SET(PLUGIN_DEST_DIR .) + SET(QTCONF_DEST_DIR .) + SET(APPS "\${CMAKE_INSTALL_PREFIX}/MultiMC.exe") +ENDIF() + +# directories to look for dependencies +SET(DIRS "${QT_LIBS_DIR}") + +################################ Included Libs ################################ + +# Add quazip +add_subdirectory(depends/quazip) +include_directories(depends/quazip) + +# Add the java launcher and checker +add_subdirectory(depends/launcher) +add_subdirectory(depends/javacheck) + +# Add xz decompression +add_subdirectory(depends/xz-embedded) +include_directories(${XZ_INCLUDE_DIR}) + +# Add pack200 decompression +add_subdirectory(depends/pack200) +include_directories(${PACK200_INCLUDE_DIR}) + +######## MultiMC Libs ######## + +# Add the util library. +add_subdirectory(depends/util) +include_directories(${LIBUTIL_INCLUDE_DIR}) + +# Add the settings library. +add_subdirectory(depends/settings) +include_directories(${LIBSETTINGS_INCLUDE_DIR}) + +# Add the group view library. +add_subdirectory(depends/groupview) +include_directories(${LIBGROUPVIEW_INCLUDE_DIR}) + +# Add the updater +add_subdirectory(mmc_updater) + ################################ FILES ################################ ######## Sources and headers ######## @@ -516,8 +545,8 @@ IF(MultiMC_CODE_COVERAGE) ENDIF(MultiMC_CODE_COVERAGE) # Tell CMake that MultiMCLauncher.jar is generated. -SET_SOURCE_FILES_PROPERTIES(${PROJECT_BINARY_DIR}/depends/launcher/MultiMCLauncher.jar GENERATED) -SET_SOURCE_FILES_PROPERTIES(${PROJECT_BINARY_DIR}/depends/javacheck/JavaCheck.jar GENERATED) +#SET_SOURCE_FILES_PROPERTIES(${PROJECT_BINARY_DIR}/depends/launcher/MultiMCLauncher.jar GENERATED) +#SET_SOURCE_FILES_PROPERTIES(${PROJECT_BINARY_DIR}/depends/javacheck/JavaCheck.jar GENERATED) # Qt 5 stuff QT5_WRAP_UI(MULTIMC_UI ${MULTIMC_UIS}) @@ -529,7 +558,7 @@ QT5_ADD_RESOURCES(GRAPHICS_QRC graphics.qrc) ADD_LIBRARY(MultiMC_common STATIC ${MULTIMC_SOURCES} ${MULTIMC_UI} ${GENERATED_QRC} ${GRAPHICS_QRC}) # Add executable -ADD_EXECUTABLE(MultiMC MACOSX_BUNDLE WIN32 main.cpp Hacks.cpp ${MULTIMC_RCS}) +ADD_EXECUTABLE(MultiMC MACOSX_BUNDLE WIN32 main.cpp ${MULTIMC_RCS}) # Link TARGET_LINK_LIBRARIES(MultiMC MultiMC_common) @@ -540,34 +569,6 @@ ADD_DEPENDENCIES(MultiMC_common MultiMCLauncher JavaCheck) ################################ INSTALLATION AND PACKAGING ################################ -######## Packaging/install paths setup ######## - -IF(UNIX AND APPLE) - SET(PLUGIN_DEST_DIR MultiMC.app/Contents/MacOS) - SET(QTCONF_DEST_DIR MultiMC.app/Contents/Resources) - SET(APPS "\${CMAKE_INSTALL_PREFIX}/MultiMC.app") - - SET(MACOSX_BUNDLE_BUNDLE_NAME "MultiMC") - SET(MACOSX_BUNDLE_INFO_STRING "MultiMC Minecraft launcher and management utility.") - SET(MACOSX_BUNDLE_GUI_IDENTIFIER "org.multimc.MultiMC5") - SET(MACOSX_BUNDLE_BUNDLE_VERSION "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}.${MultiMC_VERSION_REV}.${MultiMC_VERSION_BUILD}") - SET(MACOSX_BUNDLE_SHORT_VERSION_STRING "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}.${MultiMC_VERSION_REV}.${MultiMC_VERSION_BUILD}") - SET(MACOSX_BUNDLE_LONG_VERSION_STRING "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}.${MultiMC_VERSION_REV}.${MultiMC_VERSION_BUILD}") - SET(MACOSX_BUNDLE_ICON_FILE MultiMC.icns) - SET(MACOSX_BUNDLE_COPYRIGHT "Copyright 2013 MultiMC Contributors") -ELSEIF(UNIX) - SET(PLUGIN_DEST_DIR plugins) - SET(QTCONF_DEST_DIR .) - SET(APPS "\${CMAKE_INSTALL_PREFIX}/bin/MultiMC") -ELSEIF(WIN32) - SET(PLUGIN_DEST_DIR .) - SET(QTCONF_DEST_DIR .) - SET(APPS "\${CMAKE_INSTALL_PREFIX}/MultiMC.exe") -ENDIF() - -# directories to look for dependencies -SET(DIRS "${QT_LIBS_DIR}") - ######## Install ######## #### Executable #### diff --git a/Hacks.cpp b/Hacks.cpp deleted file mode 100644 index 3c3d8191..00000000 --- a/Hacks.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include "MultiMC.h" - -#ifdef Q_OS_WIN32 -extern "C" -{ -__declspec(dllexport) uint32_t NvOptimusEnablement = 0x00000001; -} -#endif diff --git a/depends/javacheck/CMakeLists.txt b/depends/javacheck/CMakeLists.txt index e72c9552..10b9a716 100644 --- a/depends/javacheck/CMakeLists.txt +++ b/depends/javacheck/CMakeLists.txt @@ -5,10 +5,11 @@ find_package(Java 1.6 REQUIRED COMPONENTS Development) include(UseJava) set(CMAKE_JAVA_JAR_ENTRY_POINT JavaCheck) set(CMAKE_JAVA_COMPILE_FLAGS -target 1.6 -source 1.6 -Xlint:deprecation -Xlint:unchecked) -#set(CMAKE_JAVA_TARGET_OUTPUT_DIR "${PROJECT_SOURCE_DIR}/../../resources") set(SRC JavaCheck.java ) -add_jar(JavaCheck ${SRC}) \ No newline at end of file +add_jar(JavaCheck ${SRC}) + +INSTALL_JAR(JavaCheck "${BINARY_DEST_DIR}/jars") diff --git a/depends/launcher/CMakeLists.txt b/depends/launcher/CMakeLists.txt index e91d5bd6..729ebb67 100644 --- a/depends/launcher/CMakeLists.txt +++ b/depends/launcher/CMakeLists.txt @@ -5,7 +5,6 @@ find_package(Java 1.6 REQUIRED COMPONENTS Development) include(UseJava) set(CMAKE_JAVA_JAR_ENTRY_POINT MultiMCLauncher) set(CMAKE_JAVA_COMPILE_FLAGS -target 1.6 -source 1.6 -Xlint:deprecation -Xlint:unchecked) -#set(CMAKE_JAVA_TARGET_OUTPUT_DIR "${PROJECT_SOURCE_DIR}/../../resources") set(SRC MultiMCLauncher.java @@ -19,3 +18,5 @@ set(SRC ) add_jar(MultiMCLauncher ${SRC}) + +INSTALL_JAR(MultiMCLauncher "${BINARY_DEST_DIR}/jars") diff --git a/generated.qrc.in b/generated.qrc.in index 82f4db99..794943eb 100644 --- a/generated.qrc.in +++ b/generated.qrc.in @@ -1,6 +1,8 @@ + diff --git a/logic/JavaChecker.cpp b/logic/JavaChecker.cpp index a470bfa2..6ee7b4cf 100644 --- a/logic/JavaChecker.cpp +++ b/logic/JavaChecker.cpp @@ -1,26 +1,20 @@ #include "JavaChecker.h" +#include "MultiMC.h" +#include #include #include #include #include -#define CHECKER_FILE "JavaChecker.jar" - JavaChecker::JavaChecker(QObject *parent) : QObject(parent) { } void JavaChecker::performCheck() { - checkerJar.setFileTemplate("checker_XXXXXX.jar"); - checkerJar.open(); - QFile inner(":/java/checker.jar"); - inner.open(QIODevice::ReadOnly); - checkerJar.write(inner.readAll()); - inner.close(); - checkerJar.close(); + QString checkerJar = PathCombine(MMC->bin(), "jars", "JavaCheck.jar"); - QStringList args = {"-jar", checkerJar.fileName()}; + QStringList args = {"-jar", checkerJar}; process.reset(new QProcess()); process->setArguments(args); @@ -42,7 +36,6 @@ void JavaChecker::finished(int exitcode, QProcess::ExitStatus status) killTimer.stop(); QProcessPtr _process; _process.swap(process); - checkerJar.remove(); JavaCheckResult result; { @@ -100,7 +93,6 @@ void JavaChecker::error(QProcess::ProcessError err) if(err == QProcess::FailedToStart) { killTimer.stop(); - checkerJar.remove(); JavaCheckResult result; { diff --git a/logic/JavaChecker.h b/logic/JavaChecker.h index 4705381c..e19895f7 100644 --- a/logic/JavaChecker.h +++ b/logic/JavaChecker.h @@ -1,7 +1,6 @@ #pragma once #include #include -#include #include class JavaChecker; @@ -35,7 +34,6 @@ signals: private: QProcessPtr process; QTimer killTimer; - QTemporaryFile checkerJar; public slots: void timeout(); diff --git a/logic/LegacyInstance.cpp b/logic/LegacyInstance.cpp index 0bc0961e..5ab19fc9 100644 --- a/logic/LegacyInstance.cpp +++ b/logic/LegacyInstance.cpp @@ -31,8 +31,6 @@ #include "gui/dialogs/LegacyModEditDialog.h" -#define LAUNCHER_FILE "MultiMCLauncher.jar" - LegacyInstance::LegacyInstance(const QString &rootDir, SettingsObject *settings, QObject *parent) : BaseInstance(new LegacyInstancePrivate(), rootDir, settings, parent) @@ -61,7 +59,7 @@ MinecraftProcess *LegacyInstance::prepareForLaunch(MojangAccountPtr account) pixmap.save(PathCombine(minecraftRoot(), "icon.png"), "PNG"); // extract the legacy launcher - QFile(":/java/launcher.jar").copy(PathCombine(minecraftRoot(), LAUNCHER_FILE)); + QString launcherJar = PathCombine(MMC->bin(), "jars", "MultiMCLauncher.jar"); // set the process arguments { @@ -104,7 +102,7 @@ MinecraftProcess *LegacyInstance::prepareForLaunch(MojangAccountPtr account) "minecraft.exe.heapdump"); #endif - args << "-jar" << LAUNCHER_FILE; + args << "-jar" << launcherJar; args << account->currentProfile()->name; args << account->sessionId(); args << windowTitle; -- cgit