GLosSITarget: Fix configs/shortcuts with spaces in name

main
Peter Repukat 3 years ago
parent 09c5accf29
commit 68bd55d678

@ -51,8 +51,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,0,0,0605500
PRODUCTVERSION 0,0,0,0605500
FILEVERSION 0,0,1,0
PRODUCTVERSION 0,0,1,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -69,12 +69,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "Peter Repukat - FlatspotSoftware"
VALUE "FileDescription", "GlosSI - Config"
VALUE "FileVersion", "0.0.0.f6b550c"
VALUE "FileVersion", "0.0.1.0"
VALUE "InternalName", "GlosSIConfig"
VALUE "LegalCopyright", "Copyright (C) 2021 Peter Repukat - FlatspotSoftware"
VALUE "OriginalFilename", "GlosSIConfig.exe"
VALUE "ProductName", "GlosSi"
VALUE "ProductVersion", "0.0.0.f6b550c"
VALUE "ProductVersion", "0.0.1.0"
END
END
BLOCK "VarFileInfo"
@ -209,6 +209,18 @@ END

@ -51,8 +51,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,0,0,0605500
PRODUCTVERSION 0,0,0,0605500
FILEVERSION 0,0,1,0
PRODUCTVERSION 0,0,1,0
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.f6b550c"
VALUE "FileVersion", "0.0.1.0"
VALUE "InternalName", "GlosSITarget"
VALUE "LegalCopyright", "Copyright (C) 2021 Peter Repukat - FlatspotSoftware"
VALUE "OriginalFilename", "GlosSITarget.exe"
VALUE "ProductName", "GlosSI"
VALUE "ProductVersion", "0.0.0.f6b550c"
VALUE "ProductVersion", "0.0.1.0"
END
END
BLOCK "VarFileInfo"
@ -564,6 +564,34 @@ END

@ -40,8 +40,11 @@ inline struct Window {
float scale = 0.f;
} window;
inline void Parse(const std::string& arg1)
inline void Parse(std::string arg1)
{
if (!arg1.ends_with(".json")) {
arg1 += ".json";
}
std::filesystem::path path(arg1);
if (path.has_extension() && !std::filesystem::exists(path)) {
path = std::filesystem::temp_directory_path()

@ -73,10 +73,20 @@ int main(int argc, char* argv[])
logger->flush_on(spdlog::level::info);
spdlog::set_default_logger(logger);
#ifdef _WIN32
Settings::Parse(__argc > 1 ? __argv[1] : "");
std::string argsv = "";
if (__argc > 1) {
for (int i = 1; i < __argc; i++)
argsv += i == 1 ? __argv[i] : std::string(" ") + __argv[i];
}
Settings::Parse(argsv);
SteamTarget target(__argc, __argv);
#else
Settings::Parse(argc > 1 ? argv[1] : "");
std::string argsv = "";
if (argc > 1) {
for (int i = 1; i < argc; i++)
argsv += i == 1 ? argv[i] : std::string(" ") + argv[i];
}
Settings::Parse(argsv);
SteamTarget target(argc, argv);
#endif
const auto exit = target.run();

Loading…
Cancel
Save