Compare commits

...
Author SHA1 Message Date
Tannin d81a26aef0 post-merge cleanup 2015-06-08 19:55:00 +02:00
Tom Tanner d2ee67f6a9 Addition of FileNameString clase which ignores case during compares.
Affects rather a lot of stuff.
2015-06-06 15:56:44 +01:00
Tannin 4b1dd8fb81 Merge 2015-05-09 21:46:40 +02:00
Tannin 17c3bc3450 Merge in changes by Tom Tanner 2015-03-27 18:24:37 +01:00
Tom Tanner 8f9b8cf564 Fixed Scons build for existing bits.
Changed pynedit.pro to fetch from 'standard' install location
Changed saveas code to use organizer report rather than uibase - this way it's
not dependant on the vagaries of the include path, and works the same as the
rest of the organiser directory
2015-03-20 10:34:30 +00:00
Tom Tanner 6ef78cf305 Merge with branch1.2 2015-03-18 17:40:29 +00:00
Tom Tanner 729a2d2856 Refactoring and cleanup. 2015-03-18 14:16:04 +00:00
Tom Tanner dc7d96ec8e Every plugin now built 2015-03-17 16:31:15 +00:00
Tannin 6797d50370 Merge with branch1.2 2015-01-03 15:58:52 +01:00
Tannin 1e359abd46 normalized eol style (all files should now have windows line endings) 2014-07-17 22:02:15 +02:00
Tannin 89e0c258e3 - added an option to show meta info on downloads instead of filenames
- MO will now cancel if user tries to run MO vfs-injected
- when saving the MO ini file it is now written to a tmp file first and then overwritten
- updated to link against boost python 1.55
2014-04-23 23:59:30 +02:00
Tannin dbbed655a1 - improved NCC compatibility
- crude support for multi-volume archives
- updated imageformats plugins
- nxmhandler now puts the exe to the top of the list when registering an MO instance, even if it is already in the list
- bugfix: WritePrivateProfileString hook attempted to access lpKeyName even when it is null
2014-03-26 15:35:59 +01:00
4 changed files with 193 additions and 163 deletions
+15
View File
@@ -0,0 +1,15 @@
Import('qt_env')
env = qt_env.Clone()
env.DisableQtModules('Gui')
env.AppendUnique(CPPDEFINES = [ 'INSTALLERBUNDLE_LIBRARY' ])
# Sigh
env['CPPPATH'] += [ '.' ]
lib = env.SharedLibrary('installerBundle', env.Glob('*.cpp'))
env.InstallModule(lib)
res = env['QT_USED_MODULES']
Return('res')
+2 -1
View File
@@ -27,4 +27,5 @@ HEADERS += installerbundle.h
include(../plugin_template.pri)
OTHER_FILES += \
installerbundle.json
installerbundle.json\
SConscript
+119 -105
View File
@@ -1,105 +1,119 @@
/*
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, 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::isArchiveSupported(const DirectoryTree &tree) const
{
for (DirectoryTree::const_leaf_iterator fileIter = tree.leafsBegin();
fileIter != tree.leafsEnd(); ++fileIter) {
if (fileIter->getName().endsWith(".fomod", Qt::CaseInsensitive)) {
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) {
if (fileIter->getName().endsWith(".fomod", Qt::CaseInsensitive)) {
QString tempFile = manager()->extractFile(fileIter->getName());
return manager()->installArchive(modName, tempFile);
}
}
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, 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
+57 -57
View File
@@ -1,57 +1,57 @@
/*
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/>.
*/
#ifndef INSTALLERBUNDLE_H
#define INSTALLERBUNDLE_H
#include <iplugininstallersimple.h>
class InstallerBundle : public MOBase::IPluginInstallerSimple
{
Q_OBJECT
Q_INTERFACES(MOBase::IPlugin MOBase::IPluginInstaller MOBase::IPluginInstallerSimple)
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
Q_PLUGIN_METADATA(IID "org.tannin.InstallerBundle" FILE "installerbundle.json")
#endif
public:
InstallerBundle();
virtual bool init(MOBase::IOrganizer *moInfo);
virtual QString name() const;
virtual QString author() const;
virtual QString description() const;
virtual MOBase::VersionInfo version() const;
virtual bool isActive() const;
virtual QList<MOBase::PluginSetting> settings() const;
virtual unsigned int priority() const;
virtual bool isManualInstaller() const;
virtual bool isArchiveSupported(const MOBase::DirectoryTree &tree) const;
virtual EInstallResult install(MOBase::GuessedValue<QString> &modName, MOBase::DirectoryTree &tree,
QString &version, int &modID);
};
#endif // INSTALLERBUNDLE_H
/*
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/>.
*/
#ifndef INSTALLERBUNDLE_H
#define INSTALLERBUNDLE_H
#include <iplugininstallersimple.h>
class InstallerBundle : public MOBase::IPluginInstallerSimple
{
Q_OBJECT
Q_INTERFACES(MOBase::IPlugin MOBase::IPluginInstaller MOBase::IPluginInstallerSimple)
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
Q_PLUGIN_METADATA(IID "org.tannin.InstallerBundle" FILE "installerbundle.json")
#endif
public:
InstallerBundle();
virtual bool init(MOBase::IOrganizer *moInfo);
virtual QString name() const;
virtual QString author() const;
virtual QString description() const;
virtual MOBase::VersionInfo version() const;
virtual bool isActive() const;
virtual QList<MOBase::PluginSetting> settings() const;
virtual unsigned int priority() const;
virtual bool isManualInstaller() const;
virtual bool isArchiveSupported(const MOBase::DirectoryTree &tree) const;
virtual EInstallResult install(MOBase::GuessedValue<QString> &modName, MOBase::DirectoryTree &tree,
QString &version, int &modID);
};
#endif // INSTALLERBUNDLE_H