aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt88
-rw-r--r--MultiMC.cpp76
-rw-r--r--MultiMC.h25
-rw-r--r--MultiMCVersion.h13
-rw-r--r--config.h.in18
-rw-r--r--gui/MainWindow.cpp54
-rw-r--r--gui/MainWindow.h7
-rw-r--r--gui/MainWindow.ui28
-rw-r--r--gui/dialogs/UpdateDialog.cpp28
-rw-r--r--gui/dialogs/UpdateDialog.h46
-rw-r--r--gui/dialogs/UpdateDialog.ui70
-rw-r--r--logic/net/MD5EtagDownload.cpp9
-rw-r--r--logic/updater/DownloadUpdateTask.cpp398
-rw-r--r--logic/updater/DownloadUpdateTask.h192
-rw-r--r--logic/updater/UpdateChecker.cpp247
-rw-r--r--logic/updater/UpdateChecker.h106
-rw-r--r--mmc_updater/CMakeLists.txt44
-rw-r--r--mmc_updater/LICENSE19
-rw-r--r--mmc_updater/README.md138
-rw-r--r--mmc_updater/cmake/modules/GenerateCppResourceFile.cmake23
-rw-r--r--mmc_updater/depends/AnyOption/CMakeLists.txt9
-rw-r--r--mmc_updater/depends/AnyOption/README16
-rw-r--r--mmc_updater/depends/AnyOption/anyoption.cpp1176
-rw-r--r--mmc_updater/depends/AnyOption/anyoption.h270
-rw-r--r--mmc_updater/depends/tinyxml/CMakeLists.txt24
-rw-r--r--mmc_updater/depends/tinyxml/readme.txt530
-rw-r--r--mmc_updater/depends/tinyxml/tinystr.cpp111
-rw-r--r--mmc_updater/depends/tinyxml/tinystr.h305
-rw-r--r--mmc_updater/depends/tinyxml/tinyxml.cpp1886
-rw-r--r--mmc_updater/depends/tinyxml/tinyxml.h1805
-rw-r--r--mmc_updater/depends/tinyxml/tinyxmlerror.cpp52
-rw-r--r--mmc_updater/depends/tinyxml/tinyxmlparser.cpp1638
-rw-r--r--mmc_updater/depends/win32cpp/controls.h1074
-rw-r--r--mmc_updater/depends/win32cpp/copyright.txt33
-rw-r--r--mmc_updater/depends/win32cpp/cstring.h905
-rw-r--r--mmc_updater/depends/win32cpp/default_resource.h94
-rw-r--r--mmc_updater/depends/win32cpp/default_resource.rc250
-rw-r--r--mmc_updater/depends/win32cpp/dialog.h876
-rw-r--r--mmc_updater/depends/win32cpp/docking.h4214
-rw-r--r--mmc_updater/depends/win32cpp/file.h392
-rw-r--r--mmc_updater/depends/win32cpp/frame.h3303
-rw-r--r--mmc_updater/depends/win32cpp/gdi.h3944
-rw-r--r--mmc_updater/depends/win32cpp/info.txt205
-rw-r--r--mmc_updater/depends/win32cpp/listview.h867
-rw-r--r--mmc_updater/depends/win32cpp/mdi.h783
-rw-r--r--mmc_updater/depends/win32cpp/menu.h600
-rw-r--r--mmc_updater/depends/win32cpp/propertysheet.h960
-rw-r--r--mmc_updater/depends/win32cpp/rebar.h709
-rw-r--r--mmc_updater/depends/win32cpp/release notes.txt116
-rw-r--r--mmc_updater/depends/win32cpp/ribbon.h527
-rw-r--r--mmc_updater/depends/win32cpp/shared_ptr.h199
-rw-r--r--mmc_updater/depends/win32cpp/socket.h778
-rw-r--r--mmc_updater/depends/win32cpp/statusbar.h226
-rw-r--r--mmc_updater/depends/win32cpp/stdcontrols.h1000
-rw-r--r--mmc_updater/depends/win32cpp/tab.h1658
-rw-r--r--mmc_updater/depends/win32cpp/taskdialog.h811
-rw-r--r--mmc_updater/depends/win32cpp/thread.h241
-rw-r--r--mmc_updater/depends/win32cpp/toolbar.h1361
-rw-r--r--mmc_updater/depends/win32cpp/treeview.h624
-rw-r--r--mmc_updater/depends/win32cpp/wceframe.h420
-rw-r--r--mmc_updater/depends/win32cpp/wcestddef.h58
-rw-r--r--mmc_updater/depends/win32cpp/webbrowser.h760
-rw-r--r--mmc_updater/depends/win32cpp/wincore.h2977
-rw-r--r--mmc_updater/depends/win32cpp/winutils.h649
-rw-r--r--mmc_updater/src/AppInfo.cpp23
-rw-r--r--mmc_updater/src/AppInfo.h39
-rw-r--r--mmc_updater/src/CMakeLists.txt121
-rw-r--r--mmc_updater/src/DirIterator.cpp85
-rw-r--r--mmc_updater/src/DirIterator.h43
-rw-r--r--mmc_updater/src/FileUtils.cpp557
-rw-r--r--mmc_updater/src/FileUtils.h141
-rw-r--r--mmc_updater/src/Log.cpp65
-rw-r--r--mmc_updater/src/Log.h46
-rw-r--r--mmc_updater/src/MacBundle.cpp53
-rw-r--r--mmc_updater/src/MacBundle.h35
-rw-r--r--mmc_updater/src/Platform.h32
-rw-r--r--mmc_updater/src/ProcessUtils.cpp536
-rw-r--r--mmc_updater/src/ProcessUtils.h97
-rw-r--r--mmc_updater/src/StandardDirs.cpp63
-rw-r--r--mmc_updater/src/StandardDirs.h22
-rw-r--r--mmc_updater/src/StandardDirs.mm18
-rw-r--r--mmc_updater/src/StlSymbolsLeopard.cpp75
-rw-r--r--mmc_updater/src/StringUtils.h46
-rw-r--r--mmc_updater/src/UpdateDialog.cpp25
-rw-r--r--mmc_updater/src/UpdateDialog.h29
-rw-r--r--mmc_updater/src/UpdateDialogAscii.cpp70
-rw-r--r--mmc_updater/src/UpdateDialogAscii.h32
-rw-r--r--mmc_updater/src/UpdateDialogCocoa.h32
-rw-r--r--mmc_updater/src/UpdateDialogCocoa.mm194
-rw-r--r--mmc_updater/src/UpdateDialogGtk.cpp155
-rw-r--r--mmc_updater/src/UpdateDialogGtk.h42
-rw-r--r--mmc_updater/src/UpdateDialogGtkFactory.cpp59
-rw-r--r--mmc_updater/src/UpdateDialogGtkFactory.h13
-rw-r--r--mmc_updater/src/UpdateDialogWin32.cpp215
-rw-r--r--mmc_updater/src/UpdateDialogWin32.h39
-rw-r--r--mmc_updater/src/UpdateInstaller.cpp426
-rw-r--r--mmc_updater/src/UpdateInstaller.h72
-rw-r--r--mmc_updater/src/UpdateMessage.h42
-rw-r--r--mmc_updater/src/UpdateObserver.h15
-rw-r--r--mmc_updater/src/UpdateScript.cpp99
-rw-r--r--mmc_updater/src/UpdateScript.h85
-rw-r--r--mmc_updater/src/UpdaterOptions.cpp154
-rw-r--r--mmc_updater/src/UpdaterOptions.h28
-rw-r--r--mmc_updater/src/main.cpp203
-rw-r--r--mmc_updater/src/resources/Info.plist38
-rw-r--r--mmc_updater/src/resources/icon128.pngbin0 -> 3802 bytes
-rw-r--r--mmc_updater/src/resources/icon64.pngbin0 -> 2182 bytes
-rw-r--r--mmc_updater/src/resources/mac.icnsbin0 -> 43606 bytes
-rw-r--r--mmc_updater/src/resources/updater.icobin0 -> 82726 bytes
-rw-r--r--mmc_updater/src/resources/updater.rc30
-rw-r--r--mmc_updater/src/tests/CMakeLists.txt51
-rw-r--r--mmc_updater/src/tests/TestFileUtils.cpp50
-rw-r--r--mmc_updater/src/tests/TestFileUtils.h10
-rw-r--r--mmc_updater/src/tests/TestUpdateScript.cpp27
-rw-r--r--mmc_updater/src/tests/TestUpdateScript.h8
-rw-r--r--mmc_updater/src/tests/TestUpdaterOptions.cpp68
-rw-r--r--mmc_updater/src/tests/TestUpdaterOptions.h8
-rw-r--r--mmc_updater/src/tests/TestUtils.h108
-rw-r--r--mmc_updater/src/tests/file_list.xml52
-rw-r--r--mmc_updater/src/tests/new_app.cpp8
-rw-r--r--mmc_updater/src/tests/old_app.cpp7
-rwxr-xr-xmmc_updater/src/tests/test-update.rb218
-rw-r--r--mmc_updater/src/tests/v2_file_list.xml67
123 files changed, 45872 insertions, 69 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7df7967f..ccf2bde3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -97,6 +97,9 @@ include_directories(${LIBSETTINGS_INCLUDE_DIR})
add_subdirectory(depends/groupview)
include_directories(${LIBGROUPVIEW_INCLUDE_DIR})
+# Add the updater
+add_subdirectory(mmc_updater)
+
################################ SET UP BUILD OPTIONS ################################
######## Check endianness ########
@@ -115,24 +118,54 @@ SET(MultiMC_VERSION_MINOR 0)
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. Usually corresponds to the buildbot build name. Empty string for no 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 (<version string>-<build type>. It is not used for anything other than indicating in the version string what type of build this is (eg 'lin64').")
-SET(MultiMC_VERSION_STRING "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}")
+# Version channel
+SET(MultiMC_VERSION_CHANNEL "" CACHE STRING "The current build's channel. Included in the version string.")
+
+# Channel list URL
+SET(MultiMC_CHANLIST_URL "" CACHE STRING "URL for the channel list.")
+# Updater enabled?
+SET(MultiMC_UPDATER false CACHE BOOL "Whether or not the update system is enabled. If this is enabled, you must also set MultiMC_CHANLIST_URL and MultiMC_VERSION_CHANNEL in order for it to work properly.")
+
+
+# Build a version string to display in the configure logs.
+SET(MultiMC_VERSION_STRING "${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}")
ENDIF ()
MESSAGE(STATUS "MultiMC 5 version ${MultiMC_VERSION_STRING}")
-# Custom target to just print the version.
+# If the update system is enabled, make sure MultiMC_CHANLIST_URL and MultiMC_VERSION_CHANNEL are set.
+IF (MultiMC_UPDATER)
+ IF (MultiMC_VERSION_CHANNEL STREQUAL "")
+ MESSAGE(FATAL_ERROR "Update system is enabled, but MultiMC_VERSION_CHANNEL is not set.\n"
+ "Please ensure the CMake variables MultiMC_VERSION_CHANNEL, MultiMC_CHANLIST_URL, and MultiMC_VERSION_BUILD are set.")
+ ENDIF ()
+ IF (MultiMC_CHANLIST_URL STREQUAL "")
+ MESSAGE(FATAL_ERROR "Update system is enabled, but MultiMC_CHANLIST_URL is not set.\n"
+ "Please ensure the CMake variables MultiMC_VERSION_CHANNEL, MultiMC_CHANLIST_URL, and MultiMC_VERSION_BUILD are set.")
+ ENDIF ()
+ IF (MultiMC_VERSION_BUILD LESS 0)
+ MESSAGE(FATAL_ERROR "Update system is enabled, but MultiMC_VERSION_BUILD is not set.\n"
+ "Please ensure the CMake variables MultiMC_VERSION_CHANNEL, MultiMC_CHANLIST_URL, and MultiMC_VERSION_BUILD are set.")
+ ENDIF ()
+
+ MESSAGE(STATUS "Updater is enabled. Channel list URL: ${MultiMC_CHANLIST_URL}")
+ENDIF ()
+
+#### Custom target to just print the version.
ADD_CUSTOM_TARGET(version echo "Version: ${MultiMC_VERSION_STRING}")
-# Check the current Git commit
+#### Check the current Git commit
execute_process(COMMAND git rev-parse HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
RESULT_VARIABLE GIT_COMMIT_CHECK_RESULTVAR
@@ -140,7 +173,6 @@ execute_process(COMMAND git rev-parse HEAD
OUTPUT_STRIP_TRAILING_WHITESPACE
)
-# If Git executed successfully
IF(GIT_COMMIT_CHECK_RESULTVAR EQUAL 0)
SET(MultiMC_GIT_COMMIT "${GIT_COMMIT_CHECK_OUTVAR}")
MESSAGE(STATUS "Git commit: ${MultiMC_GIT_COMMIT}")
@@ -149,41 +181,8 @@ ELSE()
MESSAGE(STATUS "Failed to check Git commit. ${GIT_COMMIT_CHECK_RESULTVAR}")
ENDIF()
-
-######## Set Jenkins info ########
-# Jenkins build tag
-IF(DEFINED MultiMC_BUILD_TAG)
- MESSAGE(STATUS "Build tag: ${MultiMC_BUILD_TAG}")
-ELSE()
- MESSAGE(STATUS "No build tag specified.")
- SET(MultiMC_BUILD_TAG custom)
-ENDIF()
-
-# Architecture detection
-IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
- SET(MultiMC_ARCH "x64" CACHE STRING "Architecture we're building for.")
-ELSE()
- SET(MultiMC_ARCH "x86" CACHE STRING "Architecture we're building for.")
-ENDIF()
-MESSAGE(STATUS "Architecture is ${MultiMC_ARCH}")
-
-# Jenkins job name
-IF(WIN32)
- SET(MultiMC_JOB_NAME "MultiMC5Windows" CACHE STRING "Jenki