mirror of
https://github.com/MultiMC/MultiMC5.git
synced 2024-10-06 06:50:16 +00:00
NOISSUE Enclose all arguments in quotes, fix batch scripts
This commit is contained in:
parent
6307689cf1
commit
08dd08afc1
@ -116,11 +116,11 @@ QString CreateShortcutDialog::getLaunchCommand()
|
|||||||
QString CreateShortcutDialog::getLaunchArgs()
|
QString CreateShortcutDialog::getLaunchArgs()
|
||||||
{
|
{
|
||||||
return " -d \"" + QDir::toNativeSeparators(QDir::currentPath()) + "\""
|
return " -d \"" + QDir::toNativeSeparators(QDir::currentPath()) + "\""
|
||||||
+ " -l " + m_instance->id()
|
+ " -l \"" + m_instance->id() + "\""
|
||||||
+ (ui->joinServerCheckBox->isChecked() ? " -s " + ui->joinServer->text() : "")
|
+ (ui->joinServerCheckBox->isChecked() ? " -s \"" + ui->joinServer->text() + "\"" : "")
|
||||||
+ (ui->useProfileCheckBox->isChecked() ? " -a " + ui->profileComboBox->currentText() : "")
|
+ (ui->useProfileCheckBox->isChecked() ? " -a \"" + ui->profileComboBox->currentText() + "\"" : "")
|
||||||
+ (ui->launchOfflineCheckBox->isChecked() ? " -o" : "")
|
+ (ui->launchOfflineCheckBox->isChecked() ? " -o" : "")
|
||||||
+ (ui->offlineUsernameCheckBox->isChecked() ? " -n " + ui->offlineUsername->text() : "");
|
+ (ui->offlineUsernameCheckBox->isChecked() ? " -n \"" + ui->offlineUsername->text() + "\"" : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreateShortcutDialog::createShortcut()
|
void CreateShortcutDialog::createShortcut()
|
||||||
@ -162,7 +162,7 @@ void CreateShortcutDialog::createShortcut()
|
|||||||
// Windows batch script implementation
|
// Windows batch script implementation
|
||||||
shortcutText = "@ECHO OFF\r\n"
|
shortcutText = "@ECHO OFF\r\n"
|
||||||
"CD \"" + QDir::toNativeSeparators(QDir::currentPath()) + "\"\r\n"
|
"CD \"" + QDir::toNativeSeparators(QDir::currentPath()) + "\"\r\n"
|
||||||
"START /B " + getLaunchCommand() + "\r\n";
|
"START /B \"\" " + getLaunchCommand() + "\r\n";
|
||||||
#endif
|
#endif
|
||||||
QFile shortcutFile(ui->shortcutPath->text());
|
QFile shortcutFile(ui->shortcutPath->text());
|
||||||
if (shortcutFile.open(QIODevice::WriteOnly))
|
if (shortcutFile.open(QIODevice::WriteOnly))
|
||||||
|
Loading…
Reference in New Issue
Block a user