From ed785c23b22438313b94817a21df9967ab174667 Mon Sep 17 00:00:00 2001 From: Peter Repukat Date: Thu, 28 Oct 2021 20:42:48 +0200 Subject: [PATCH] SteamTarget: Also handle only config-file name as launch arg ...as well as absolute paths --- GlosSITarget/GlosSITarget.vcxproj | 5 ----- GlosSITarget/GlosSITarget.vcxproj.filters | 3 --- GlosSITarget/Resource.rc | 24 +++++++++++++++++++---- GlosSITarget/Settings.h | 14 ++++++++++++- 4 files changed, 33 insertions(+), 13 deletions(-) diff --git a/GlosSITarget/GlosSITarget.vcxproj b/GlosSITarget/GlosSITarget.vcxproj index ba96f2f..5a72ee9 100644 --- a/GlosSITarget/GlosSITarget.vcxproj +++ b/GlosSITarget/GlosSITarget.vcxproj @@ -216,11 +216,6 @@ - - - true - - diff --git a/GlosSITarget/GlosSITarget.vcxproj.filters b/GlosSITarget/GlosSITarget.vcxproj.filters index 6a687ba..a3bfd4d 100644 --- a/GlosSITarget/GlosSITarget.vcxproj.filters +++ b/GlosSITarget/GlosSITarget.vcxproj.filters @@ -140,7 +140,4 @@ Resource Files - - - \ No newline at end of file diff --git a/GlosSITarget/Resource.rc b/GlosSITarget/Resource.rc index a361fc2..440f5c1 100644 --- a/GlosSITarget/Resource.rc +++ b/GlosSITarget/Resource.rc @@ -51,8 +51,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,0,0,0333006 - PRODUCTVERSION 0,0,0,0333006 + FILEVERSION 0,0,0,0657006 + PRODUCTVERSION 0,0,0,0657006 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -69,12 +69,12 @@ BEGIN BEGIN VALUE "CompanyName", "Peter Repukat - FlatspotSoftware" VALUE "FileDescription", "GlosSI - SteamTarget" - VALUE "FileVersion", "0.0.0.c333bd6" + VALUE "FileVersion", "0.0.0.f657dd6" VALUE "InternalName", "GlosSITarget" VALUE "LegalCopyright", "Copyright (C) 2021 Peter Repukat - FlatspotSoftware" VALUE "OriginalFilename", "GlosSITarget.exe" VALUE "ProductName", "GlosSI" - VALUE "ProductVersion", "0.0.0.c333bd6" + VALUE "ProductVersion", "0.0.0.f657dd6" END END BLOCK "VarFileInfo" @@ -299,6 +299,22 @@ END + + + + + + + + + + + + + + + + diff --git a/GlosSITarget/Settings.h b/GlosSITarget/Settings.h index 809cb1f..9b1026d 100644 --- a/GlosSITarget/Settings.h +++ b/GlosSITarget/Settings.h @@ -42,8 +42,20 @@ inline struct Window { inline void Parse(const std::string& arg1) { + std::filesystem::path path(arg1); + if (path.has_extension() && !std::filesystem::exists(path)) { + path = std::filesystem::temp_directory_path() + .parent_path() + .parent_path() + .parent_path(); + + path /= "Roaming"; + path /= "GlosSI"; + path /= "Targets"; + path /= arg1; + } std::ifstream json_file; - json_file.open(arg1); + json_file.open(path); if (!json_file.is_open()) { spdlog::error("Couldn't open settings file {}", arg1); return;