From 524cde67cc527f103136edca2737638adc2488e4 Mon Sep 17 00:00:00 2001 From: Peter Repukat Date: Fri, 18 Nov 2016 04:29:45 +0100 Subject: [PATCH] fix: file copying in release builds --- GloSC/GloSC.cpp | 24 ++++++++++++++++++++++-- GloSC/GloSC.vcxproj | 2 ++ SteamTarget/SteamTargetRenderer.cpp | 7 +------ 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/GloSC/GloSC.cpp b/GloSC/GloSC.cpp index 6591bce..f0f2275 100644 --- a/GloSC/GloSC.cpp +++ b/GloSC/GloSC.cpp @@ -33,7 +33,7 @@ void GloSC::updateEntryList() for (auto &dirName : dirNames) { - if (dirName != "." && dirName != "..") + if (dirName != "." && dirName != ".." && dirName != "platforms") ui.lwInstances->addItem(dirName); } @@ -89,6 +89,18 @@ void GloSC::on_pbSave_clicked() if (!dir.exists()) dir.mkdir("."); +#ifdef NDEBUG + QString fileNames[] = { + "Qt5Core.dll", + "Qt5Gui.dll", + "Qt5Widgets.dll", + "sfml-system-2.dll", + "sfml-window-2.dll", + "sfml-graphics-2.dll", + "ViGEmUM.dll", + "SteamTargetUserWindow.exe", + "TargetConfig.ini" }; +#else QString fileNames[] = { "Qt5Cored.dll", "Qt5Guid.dll", @@ -98,12 +110,20 @@ void GloSC::on_pbSave_clicked() "sfml-graphics-d-2.dll", "ViGEmUM.dll", "SteamTargetUserWindow.exe", - "TargetConfig.ini"}; + "TargetConfig.ini" +}; +#endif for (auto &fileName : fileNames) { QFile::copy(fileName, dir.path() + "\\" + fileName); } + QDir platformdir(name + "\\platforms"); + if (!platformdir.exists()) + platformdir.mkdir("."); + + + QFile::copy("platforms\\qwindows.dll", dir.path() + "\\" + "platforms\\qwindows.dll"); QFile::copy("SteamTarget.exe", dir.path() + "\\" + name + ".exe"); writeIni(name); diff --git a/GloSC/GloSC.vcxproj b/GloSC/GloSC.vcxproj index 04af241..ba9a46d 100644 --- a/GloSC/GloSC.vcxproj +++ b/GloSC/GloSC.vcxproj @@ -49,6 +49,7 @@ $(QTDIR)\lib;%(AdditionalLibraryDirectories) true qtmaind.lib;Qt5Cored.lib;Qt5Guid.lib;Qt5Widgetsd.lib;%(AdditionalDependencies) + RequireAdministrator @@ -65,6 +66,7 @@ $(QTDIR)\lib;%(AdditionalLibraryDirectories) false qtmain.lib;Qt5Core.lib;Qt5Gui.lib;Qt5Widgets.lib;%(AdditionalDependencies) + RequireAdministrator diff --git a/SteamTarget/SteamTargetRenderer.cpp b/SteamTarget/SteamTargetRenderer.cpp index 4fb792f..3beab9a 100644 --- a/SteamTarget/SteamTargetRenderer.cpp +++ b/SteamTarget/SteamTargetRenderer.cpp @@ -23,13 +23,8 @@ SteamTargetRenderer::SteamTargetRenderer() getSteamOverlay(); -#ifdef NDEBUG - if (overlayPtr != NULL) - openUserWindow(); - else - exit(1); -#else openUserWindow(); +#ifndef NDEBUG bDrawDebugEdges = true; #endif // NDEBUG