Compare commits

..
35 Commits
Author SHA1 Message Date
Chris Bessent 004135b33d Merge pull request #7 from ModOrganizer2/Develop
Stage for release 2.2.2
2020-01-06 05:02:19 -07:00
Silarn 17fa43b0c1 Update Appveyor to official VS 2019 image 2019-09-28 00:41:34 -05:00
Jeremy Rimpo 9633afaeed Merge pull request #6 from ModOrganizer2/Develop
Stage for release 2.2.1
2019-07-14 17:55:38 -05:00
Silarn 122c3d275c Set optimization for release builds 2019-05-22 02:04:14 -05:00
Silarn cef3001f30 Add logs to build artifacts on CI fail, commit translation changes 2019-05-21 23:46:01 -05:00
Silarn 74f9eb6241 Switch to local build files as appveyor can't use installed files 2019-05-21 02:27:51 -05:00
Silarn 4f4b3a0068 Unify artifacts source path to install path 2019-05-21 01:37:11 -05:00
Silarn aa7f56f1de Set appveyor image to VS 2019 Preview 2019-05-08 23:10:29 -05:00
LostDragonist 64982ed25f Merge pull request #5 from ModOrganizer2/Develop
Stage for Release 2.2.0
2019-05-03 20:55:37 -05:00
Brian Munro d4f562041e Merge pull request #4 from ModOrganizer2/Appveyor
Support Appveyor.
2019-04-28 13:42:07 +02:00
LePresidente 8e971e8c3e Support Appveyor. 2019-04-28 10:08:42 +02:00
LostDragonist bc0465f4dc Merge pull request #3 from ModOrganizer2/Develop
Stage for release 2.1.6
2018-12-20 14:01:24 -06:00
LostDragonist 6a28610a4d Update version to 1.1.0.0 2018-12-12 01:57:11 -06:00
Silarn ab61d00c64 Allow installs to pass Mod ID through (fixes NCC installs losing ID) 2018-09-09 04:12:22 -05:00
Brian Munro f449bd3afe Merge pull request #2 from Modorganizer2/Develop
Stage for 2.1.3 release
2018-05-08 12:21:29 +02:00
Silarn 7222892a10 Updating gitignore 2018-05-04 00:28:36 -05:00
Brian Munro 00c515bace Merge pull request #1 from Modorganizer2/Develop
Merge to Master for Release
2018-04-13 08:55:21 +02:00
Jeremy Rimpo b7d1d4fe9b Remove extraneous search code 2018-04-13 00:38:19 -05:00
Silarn 0b6b898edf Prep for Qt 5.11 (backward-compatible) 2018-04-10 23:28:23 -05:00
Silarn 9c1fb3cb21 Fix up CMAKE to use /MP and allow building through umbrella 2018-04-07 17:12:13 -05:00
LePresidente a6085f8ecc Updated cmakelists to get the QT5 location from the QT_ROOT variable, instead of expecting it in DEPENDENCIES_DIR. 2017-09-21 16:53:16 +02:00
Tannin 907c61cd6f translation 2016-06-04 20:36:04 +02:00
Tannin e86aed98db updated cmake script 2016-05-06 23:11:23 +02:00
Tannin 2af8182e4f using optimization flags from cmake settings 2016-01-10 19:54:20 +01:00
TanninOne ce0063bd50 Merge pull request #1 from ThosRTanner/master
Look harder for bundled archive.
2015-12-06 18:29:03 +01:00
Thomas Tanner f509d34693 Merge remote-tracking branch 'refs/remotes/TanninOne/master' 2015-11-18 20:48:27 +00:00
Tannin 4eef76e09c updated build scripts 2015-11-16 21:39:51 +01:00
ThosRTanner 4fd0260f62 remove trace. 2015-10-10 14:03:30 +01:00
Thomas Tanner eaa12dddf2 Merge remote-tracking branch 'TanninOne/master' 2015-10-10 13:57:08 +01:00
Thomas Tanner 131c91099b Fixes #1269
This makes the bundle installer recurse through (single) directories looking for a valid archive.
2015-10-10 13:49:40 +01:00
Tannin 45b3e8b099 more work on build system 2015-10-09 19:53:52 +02:00
Thomas Tanner 92c42d3545 Merge remote-tracking branch 'TanninOne/master' 2015-10-02 21:51:38 +01:00
Tannin 64dc934891 fixed build system 2015-09-26 23:57:04 +02:00
Tannin 87d1421dd7 updated build system 2015-09-26 12:06:26 +02:00
convert-repo 31052f53b2 update tags 2015-09-07 17:12:37 +00:00
7 changed files with 270 additions and 121 deletions
+5
View File
@@ -0,0 +1,5 @@
edit
CMakeLists.txt.user
/msbuild.log
/*std*.log
/*build
+14
View File
@@ -0,0 +1,14 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12)
ADD_COMPILE_OPTIONS($<$<CXX_COMPILER_ID:MSVC>:/MP> $<$<CXX_COMPILER_ID:MSVC>:$<$<CONFIG:RELEASE>:/O2>> $<$<CXX_COMPILER_ID:MSVC>:$<$<CONFIG:RELWITHDEBINFO>:/O2>>)
SET(PROJ_NAME installer_bundle)
PROJECT(${PROJ_NAME})
SET(DEPENDENCIES_DIR CACHE PATH "")
# hint to find qt in dependencies path
LIST(APPEND CMAKE_PREFIX_PATH ${QT_ROOT}/lib/cmake)
ADD_SUBDIRECTORY(src)
+32
View File
@@ -0,0 +1,32 @@
version: 1.0.{build}
skip_branch_with_pr: true
image: Visual Studio 2019
environment:
WEBHOOK_URL:
secure: gOKbXaZM9ImtMD5XrYITvdyZUW/az082G9OIN1EC1Vbg57wBaeLhi49uGjxPw5GVujHku6kxN6ab89zhbS5GVeluR76GM83IbKV4Sh7udXzoYZZdg6YudtYHzdhCgUeiedpswbuczTq9ceIkkfSEWZuh/lMAAVVwvcGsJAnoPFw=
build_script:
- cmd: >-
git clone --depth=1 --branch=%APPVEYOR_REPO_BRANCH% https://github.com/ModOrganizer2/modorganizer-umbrella.git c:\projects\modorganizer-umbrella 2> $null
mkdir c:\projects\modorganizer-build -type directory
cd c:\projects\modorganizer-umbrella
C:\Python37-x64\python.exe unimake.py -d c:\projects\modorganizer-build -s Appveyor_Build=True %APPVEYOR_PROJECT_NAME%
artifacts:
- path: build\src\installer_bundle.dll
name: installer_bundle_dll
- path: build\src\installer_bundle.pdb
name: installer_bundle_pdb
- path: build\src\installer_bundle.lib
name: installer_bundle_lib
on_success:
- ps: Set-Location -Path $env:APPVEYOR_BUILD_FOLDER
- ps: Invoke-RestMethod https://raw.githubusercontent.com/DiscordHooks/appveyor-discord-webhook/master/send.ps1 -o send.ps1
- ps: ./send.ps1 success $env:WEBHOOK_URL
on_failure:
- ps: Set-Location -Path $env:APPVEYOR_BUILD_FOLDER
- ps: Push-AppveyorArtifact ${env:APPVEYOR_BUILD_FOLDER}\stdout.log
- ps: Push-AppveyorArtifact ${env:APPVEYOR_BUILD_FOLDER}\stderr.log
- ps: Invoke-RestMethod https://raw.githubusercontent.com/DiscordHooks/appveyor-discord-webhook/master/send.ps1 -o send.ps1
- ps: ./send.ps1 failure $env:WEBHOOK_URL
+63
View File
@@ -0,0 +1,63 @@
CMAKE_MINIMUM_REQUIRED (VERSION 2.8.11)
CMAKE_POLICY(SET CMP0020 NEW)
CMAKE_POLICY(SET CMP0043 NEW)
FILE(GLOB ${PROJ_NAME}_SRCS *.cpp)
FILE(GLOB ${PROJ_NAME}_HDRS *.h)
FILE(GLOB ${PROJ_NAME}_FORMS *.ui)
SET(CMAKE_INCLUDE_CURRENT_DIR ON)
SET(CMAKE_AUTOMOC ON)
SET(CMAKE_AUTOUIC ON)
FIND_PACKAGE(Qt5Widgets REQUIRED)
QT5_WRAP_UI(${PROJ_NAME}_UIHDRS ${${PROJ_NAME}_FORMS})
FIND_PACKAGE(Qt5LinguistTools)
QT5_CREATE_TRANSLATION(${PROJ_NAME}_translations_qm ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/src/${PROJ_NAME}_en.ts)
SET(Boost_USE_STATIC_LIBS ON)
SET(Boost_USE_MULTITHREADED ON)
SET(Boost_USE_STATIC_RUNTIME OFF)
FIND_PACKAGE(Boost)
IF (Boost_FOUND)
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
ENDIF (Boost_FOUND)
SET(default_project_path "${DEPENDENCIES_DIR}/modorganizer_super")
GET_FILENAME_COMPONENT(${default_project_path} ${default_project_path} REALPATH)
SET(project_path "${default_project_path}" CACHE PATH "path to the other mo projects")
SET(lib_path "${project_path}/../../install/libs")
INCLUDE_DIRECTORIES(${project_path}/uibase/src)
LINK_DIRECTORIES(${lib_path})
ADD_LIBRARY(${PROJ_NAME} SHARED ${${PROJ_NAME}_HDRS} ${${PROJ_NAME}_SRCS} ${${PROJ_NAME}_UIHDRS} ${${PROJ_NAME}_translations_qm})
TARGET_LINK_LIBRARIES(${PROJ_NAME}
Qt5::Widgets
${Boost_LIBRARIES}
uibase)
IF(MSVC)
SET_TARGET_PROPERTIES(${PROJ_NAME} PROPERTIES LINK_FLAGS "/LARGEADDRESSAWARE")
ELSE(MSVC)
SET_TARGET_PROPERTIES(${PROJ_NAME} PROPERTIES LINK_FLAGS "-std=c++11")
ENDIF(MSVC)
IF (NOT "${OPTIMIZE_COMPILE_FLAGS}" STREQUAL "")
SET_TARGET_PROPERTIES(${PROJ_NAME} PROPERTIES COMPILE_FLAGS_RELWITHDEBINFO ${OPTIMIZE_COMPILE_FLAGS})
ENDIF()
IF (NOT "${OPTIMIZE_LINK_FLAGS}" STREQUAL "")
SET_TARGET_PROPERTIES(${PROJ_NAME} PROPERTIES LINK_FLAGS_RELWITHDEBINFO ${OPTIMIZE_LINK_FLAGS})
ENDIF()
###############
## Installation
INSTALL(TARGETS ${PROJ_NAME}
RUNTIME DESTINATION bin/plugins)
INSTALL(FILES $<TARGET_PDB_FILE:${PROJ_NAME}>
DESTINATION pdb)
+12
View File
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="en_US">
<context>
<name>InstallerBundle</name>
<message>
<location filename="installerbundle.cpp" line="50"/>
<source>Proxy-Installer to handle bundles containing the actual mod archive</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
+135 -119
View File
@@ -1,119 +1,135 @@
/*
Copyright (C) 2012 Sebastian Herbord. All rights reserved.
This file is part of Mod Organizer.
Mod Organizer is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Mod Organizer is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
*/
#include "installerbundle.h"
#include "iinstallationmanager.h"
#include <QtPlugin>
using namespace MOBase;
InstallerBundle::InstallerBundle()
{
}
bool InstallerBundle::init(IOrganizer*)
{
return true;
}
QString InstallerBundle::name() const
{
return "Bundle Installer";
}
QString InstallerBundle::author() const
{
return "Tannin";
}
QString InstallerBundle::description() const
{
return tr("Proxy-Installer to handle bundles containing the actual mod archive");
}
VersionInfo InstallerBundle::version() const
{
return VersionInfo(1, 0, 1, VersionInfo::RELEASE_FINAL);
}
bool InstallerBundle::isActive() const
{
return true;
}
QList<PluginSetting> InstallerBundle::settings() const
{
return QList<PluginSetting>();
}
unsigned int InstallerBundle::priority() const
{
return 10;
}
bool InstallerBundle::isManualInstaller() const
{
return false;
}
bool InstallerBundle::isArchiveSupported(const DirectoryTree &tree) const
{
for (DirectoryTree::const_leaf_iterator fileIter = tree.leafsBegin();
fileIter != tree.leafsEnd(); ++fileIter) {
if (fileIter->getName().endsWith(".fomod")) {
return true;
}
}
if ((tree.numNodes() == 0)
&& (tree.numLeafs() == 1)
&& (tree.leafsBegin()->getName().endsWith(".7z")
|| tree.leafsBegin()->getName().endsWith(".rar"))) {
// nested archive
return true;
}
return false;
}
IPluginInstaller::EInstallResult InstallerBundle::install(GuessedValue<QString> &modName, DirectoryTree &tree,
QString&, int&)
{
for (DirectoryTree::const_leaf_iterator fileIter = tree.leafsBegin();
fileIter != tree.leafsEnd(); ++fileIter) {
FileNameString name = fileIter->getName();
if (name.endsWith(".fomod")
|| name.endsWith(".7z")
|| name.endsWith(".rar")) {
QString tempFile = manager()->extractFile(name.toQString());
IPluginInstaller::EInstallResult res = manager()->installArchive(modName, tempFile);
if (res == IPluginInstaller::RESULT_SUCCESS) {
res = IPluginInstaller::RESULT_SUCCESSCANCEL;
}
return res;
}
}
return IPluginInstaller::RESULT_NOTATTEMPTED;
}
#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
Q_EXPORT_PLUGIN2(installerBundle, InstallerBundle)
#endif
/*
Copyright (C) 2012 Sebastian Herbord. All rights reserved.
This file is part of Mod Organizer.
Mod Organizer is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Mod Organizer is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
*/
#include "installerbundle.h"
#include "iinstallationmanager.h"
#include <QtPlugin>
using namespace MOBase;
InstallerBundle::InstallerBundle()
{
}
bool InstallerBundle::init(IOrganizer*)
{
return true;
}
QString InstallerBundle::name() const
{
return "Bundle Installer";
}
QString InstallerBundle::author() const
{
return "Tannin";
}
QString InstallerBundle::description() const
{
return tr("Proxy-Installer to handle bundles containing the actual mod archive");
}
VersionInfo InstallerBundle::version() const
{
return VersionInfo(1, 1, 0, VersionInfo::RELEASE_FINAL);
}
bool InstallerBundle::isActive() const
{
return true;
}
QList<PluginSetting> InstallerBundle::settings() const
{
return QList<PluginSetting>();
}
unsigned int InstallerBundle::priority() const
{
return 10;
}
bool InstallerBundle::isManualInstaller() const
{
return false;
}
bool InstallerBundle::findObject(DirectoryTree const *tree) const
{
for (;;) {
DirectoryTree::const_leaf_iterator fileIter = tree->leafsBegin();
//Really truly we should use the supported extensions from the installation
//manager here
if (tree->numNodes() == 0 && tree->numLeafs() == 1 &&
(fileIter->getName().endsWith(".7z") ||
fileIter->getName().endsWith(".zip") ||
fileIter->getName().endsWith(".rar"))) {
// nested archive
m_found_dir = tree;
m_found_leaf = fileIter;
return true;
}
for (; fileIter != tree->leafsEnd(); ++fileIter) {
if (fileIter->getName().endsWith(".fomod")) {
m_found_dir = tree;
m_found_leaf = fileIter;
return true;
}
}
//Arguably this should also check the name of the directory we're looking at
//is the same as the module name
if (tree->numNodes() != 1) {
return false;
}
tree = *(tree->nodesBegin());
}
}
bool InstallerBundle::isArchiveSupported(const DirectoryTree &tree) const
{
return findObject(&tree);
}
IPluginInstaller::EInstallResult InstallerBundle::install(GuessedValue<QString> &modName,
DirectoryTree &tree,
QString&, int &modId)
{
if (! findObject(&tree)) {
return IPluginInstaller::RESULT_NOTATTEMPTED;
}
FileNameString name = m_found_dir->getFullPath(&(*m_found_leaf));
QString tempFile = manager()->extractFile(name.toQString());
IPluginInstaller::EInstallResult res = manager()->installArchive(modName, tempFile, modId);
if (res == IPluginInstaller::RESULT_SUCCESS) {
res = IPluginInstaller::RESULT_SUCCESSCANCEL;
}
return res;
}
#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
Q_EXPORT_PLUGIN2(installerBundle, InstallerBundle)
#endif
+9 -2
View File
@@ -23,7 +23,6 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include <iplugininstallersimple.h>
class InstallerBundle : public MOBase::IPluginInstallerSimple
{
@@ -49,8 +48,16 @@ public:
virtual bool isManualInstaller() const;
virtual bool isArchiveSupported(const MOBase::DirectoryTree &tree) const;
virtual EInstallResult install(MOBase::GuessedValue<QString> &modName, MOBase::DirectoryTree &tree,
virtual EInstallResult install(MOBase::GuessedValue<QString> &modName,
MOBase::DirectoryTree &tree,
QString &version, int &modID);
private:
//Stash the results of findObject.
//FIXME return a tuple?
mutable MOBase::DirectoryTree const *m_found_dir;
mutable MOBase::DirectoryTree::const_leaf_iterator m_found_leaf;
bool findObject(MOBase::DirectoryTree const *tree) const;
};