diff --git a/mainwindow.cpp b/mainwindow.cpp index 3aa048e..1a32494 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -58,7 +58,6 @@ void MainWindow::UpdateProgress(qint64 read, qint64 total) { void MainWindow::FinishedDownloading() { QByteArray data = reply->readAll(); - downloadLocation = "/home/jesse/Downloads/mods.zip"; QFile file(downloadLocation); @@ -81,12 +80,11 @@ void MainWindow::FinishedDownloading() { std::string MainWindow::BuildUnzipCmd() { std::stringstream ss; -#ifdef _WINDOWS +#ifdef WIN64 ss << "tar -xf " << downloadLocation.toStdString() << " -C " << modsDir.toStdString(); #elif __unix__ ss << "unzip " << downloadLocation.toStdString() << " -d " << modsDir.toStdString(); #endif - qDebug() << "Tar command is: " << ss.str(); return ss.str(); } @@ -139,8 +137,9 @@ void MainWindow::UpdateOSAgnosticInformation() { char* appDataLoc = std::getenv("APPDATA"); if (appDataLoc) { std::filesystem::path execPath(appDataLoc); - downloadLocation = QString(execPath.c_str()); // Stick the mods inside the roaming directory; but not the .minecraft directory itself. + downloadLocation = QString::fromStdString(execPath.string()); // Stick the mods inside the roaming directory; but not the .minecraft directory itself. modsDir = downloadLocation + "\\.minecraft\\"; + downloadLocation.append("\\mods.zip"); // Should point to %APPDATA%\mods.zip } #elif __unix__ isLinux = true; @@ -175,7 +174,6 @@ void MainWindow::on_changeInstallPathButton_clicked() modsDir = directory; } - qDebug() << "New active .minecraft dir is: " << modsDir; ui->mcInstallDir->setText(modsDir); }