From 08dd08afc1918a1ac7e6482fb977bde091056f94 Mon Sep 17 00:00:00 2001 From: arthomnix Date: Sat, 30 Jul 2022 16:43:30 +0100 Subject: [PATCH] NOISSUE Enclose all arguments in quotes, fix batch scripts --- launcher/ui/dialogs/CreateShortcutDialog.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/launcher/ui/dialogs/CreateShortcutDialog.cpp b/launcher/ui/dialogs/CreateShortcutDialog.cpp index 2f8c49cf..a5366835 100644 --- a/launcher/ui/dialogs/CreateShortcutDialog.cpp +++ b/launcher/ui/dialogs/CreateShortcutDialog.cpp @@ -116,11 +116,11 @@ QString CreateShortcutDialog::getLaunchCommand() QString CreateShortcutDialog::getLaunchArgs() { return " -d \"" + QDir::toNativeSeparators(QDir::currentPath()) + "\"" - + " -l " + m_instance->id() - + (ui->joinServerCheckBox->isChecked() ? " -s " + ui->joinServer->text() : "") - + (ui->useProfileCheckBox->isChecked() ? " -a " + ui->profileComboBox->currentText() : "") + + " -l \"" + m_instance->id() + "\"" + + (ui->joinServerCheckBox->isChecked() ? " -s \"" + ui->joinServer->text() + "\"" : "") + + (ui->useProfileCheckBox->isChecked() ? " -a \"" + ui->profileComboBox->currentText() + "\"" : "") + (ui->launchOfflineCheckBox->isChecked() ? " -o" : "") - + (ui->offlineUsernameCheckBox->isChecked() ? " -n " + ui->offlineUsername->text() : ""); + + (ui->offlineUsernameCheckBox->isChecked() ? " -n \"" + ui->offlineUsername->text() + "\"" : ""); } void CreateShortcutDialog::createShortcut() @@ -162,7 +162,7 @@ void CreateShortcutDialog::createShortcut() // Windows batch script implementation shortcutText = "@ECHO OFF\r\n" "CD \"" + QDir::toNativeSeparators(QDir::currentPath()) + "\"\r\n" - "START /B " + getLaunchCommand() + "\r\n"; + "START /B \"\" " + getLaunchCommand() + "\r\n"; #endif QFile shortcutFile(ui->shortcutPath->text()); if (shortcutFile.open(QIODevice::WriteOnly))