# HG changeset patch # User Chris Cannam # Date 1580397349 0 # Node ID eeab56dd59d6f35f15c260d02bcb8c85f94716b3 # Parent cf2840ba1e077b589a8d659aa619985d6f354f17 Copy in metadata files as well diff -r cf2840ba1e07 -r eeab56dd59d6 installer.cpp --- a/installer.cpp Thu Jan 30 13:28:32 2020 +0000 +++ b/installer.cpp Thu Jan 30 15:15:49 2020 +0000 @@ -196,8 +196,10 @@ void installLibrary(QString library, QString target) { - QFile f(":out/" + library); + QString source = ":out"; + QFile f(source + "/" + library); QString destination = target + "/" + library; + SVCERR << "Copying " << library.toStdString() << " to " << destination.toStdString() << "..." << endl; if (!f.copy(destination)) { @@ -214,6 +216,21 @@ << library.toStdString() << endl; return; } + + QString base = QFileInfo(library).baseName(); + QDir dir(source); + auto entries = dir.entryList({ base + "*" }); + for (auto e: entries) { + if (e == library) continue; + QString destination = target + "/" + e; + SVCERR << "Copying " << e.toStdString() << " to " + << destination.toStdString() << "..." << endl; + if (!QFile(source + "/" + e).copy(destination)) { + SVCERR << "Failed to copy " << e.toStdString() + << " to target " << destination.toStdString() + << " (ignoring)" << endl; + } + } } QStringList @@ -370,6 +387,12 @@ auto info = getLibraryInfo(*rdfStore, libraries); QStringList toInstall = getUserApprovedPluginLibraries(info); + + if (!toInstall.empty()) { + if (!QDir(target).exists()) { + QDir().mkpath(target); + } + } for (auto lib: toInstall) { installLibrary(lib, target);