From f8067a60346207d4b9b9f0c0eb5b1c3a70e28485 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Tue, 17 Dec 2013 00:37:56 +0100 Subject: [PATCH] Magical pixie dust for windows updater reliability Don't ask. --- MultiMC.manifest | 27 +++++++++++++++++++ mmc_updater/CMakeLists.txt | 8 ++++++ mmc_updater/src/resources/updater.manifest | 27 +++++++++++++++++++ mmc_updater/src/resources/updater.rc | 30 +++++++++++----------- multimc.rc | 28 ++++++++++++++++++++ 5 files changed, 105 insertions(+), 15 deletions(-) create mode 100644 MultiMC.manifest create mode 100644 mmc_updater/src/resources/updater.manifest diff --git a/MultiMC.manifest b/MultiMC.manifest new file mode 100644 index 000000000..3acf8f7f3 --- /dev/null +++ b/MultiMC.manifest @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + Custom Minecraft launcher for managing multiple installs. + + + + + + + + + + + \ No newline at end of file diff --git a/mmc_updater/CMakeLists.txt b/mmc_updater/CMakeLists.txt index 61c8cd098..971ac153f 100644 --- a/mmc_updater/CMakeLists.txt +++ b/mmc_updater/CMakeLists.txt @@ -9,6 +9,14 @@ include_directories(depends) if (WIN32) include_directories(depends/win32cpp) + # static all the things. The updater must have no dependencies, or it will fail. + if (MINGW) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static-libgcc -static") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++ -static") +#set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS} -static-libgcc -s") +#set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS} -static-libgcc -static-libstdc++ -s") + endif() + if(MSVC) # - Link the updater binary statically with the Visual C++ runtime # so that the executable can function standalone. diff --git a/mmc_updater/src/resources/updater.manifest b/mmc_updater/src/resources/updater.manifest new file mode 100644 index 000000000..cafc47d3d --- /dev/null +++ b/mmc_updater/src/resources/updater.manifest @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + Software updater for MultiMC. + + + + + + + + + + + \ No newline at end of file diff --git a/mmc_updater/src/resources/updater.rc b/mmc_updater/src/resources/updater.rc index 550970a8f..9c7c57112 100644 --- a/mmc_updater/src/resources/updater.rc +++ b/mmc_updater/src/resources/updater.rc @@ -1,30 +1,30 @@ +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif +#include + IDI_APPICON ICON DISCARDABLE "updater.ico" -1 VERSIONINFO -FILEVERSION 0,0,1,0 -PRODUCTVERSION 1,0,1,0 -FILEFLAGSMASK 0X3FL -FILEFLAGS 0X8L -FILEOS 0X40004L -FILETYPE 0X1 -FILESUBTYPE 0 +1 RT_MANIFEST "updater.manifest" + +VS_VERSION_INFO VERSIONINFO +FILEVERSION 1,0,0,0 +FILEOS VOS_NT_WINDOWS32 +FILETYPE VFT_APP BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "000004b0" BEGIN - VALUE "FileVersion", "0.0.1.0" - VALUE "ProductVersion", "1.0.1.0" - VALUE "OriginalFilename", "updater.exe" - VALUE "InternalName", "updater.exe" - VALUE "FileDescription", "Software Update Tool" VALUE "CompanyName", "MultiMC Contributors" + VALUE "FileDescription", "Software Update Tool" + VALUE "FileVersion", "1.0.0.0" VALUE "ProductName", "MultiMC Software Updater" - VALUE "PrivateBuild", "Built by BuildBot" + VALUE "ProductVersion", "1.0" END END BLOCK "VarFileInfo" BEGIN - VALUE "Translation", 0x0000, 0x04b0 + VALUE "Translation", 0x0000, 0x04b0 // Unicode END END \ No newline at end of file diff --git a/multimc.rc b/multimc.rc index decf7d3ab..2140e3f4f 100644 --- a/multimc.rc +++ b/multimc.rc @@ -1 +1,29 @@ +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif +#include + IDI_ICON1 ICON DISCARDABLE "resources/icons/MultiMC.ico" +1 RT_MANIFEST "MultiMC.manifest" + +VS_VERSION_INFO VERSIONINFO +FILEVERSION 1,0,0,0 +FILEOS VOS_NT_WINDOWS32 +FILETYPE VFT_APP +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "000004b0" + BEGIN + VALUE "CompanyName", "MultiMC Contributors" + VALUE "FileDescription", "Minecraft Launcher" + VALUE "FileVersion", "1.0.0.0" + VALUE "ProductName", "MultiMC" + VALUE "ProductVersion", "5" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0000, 0x04b0 // Unicode + END +END