From 5665be7fd126c435ed4ad4ceb8c01f0e6eb16975 Mon Sep 17 00:00:00 2001 From: Tannin Date: Sun, 15 May 2016 14:58:54 +0200 Subject: fixed calls to helper.exe using wrong path --- src/helper.cpp | 10 +++++----- src/helper.h | 8 ++++---- src/main.cpp | 3 ++- src/settingsdialog.cpp | 2 +- src/version.rc | 4 ++-- 5 files changed, 14 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/helper.cpp b/src/helper.cpp index 41784fe5..b7fc866c 100644 --- a/src/helper.cpp +++ b/src/helper.cpp @@ -62,7 +62,7 @@ static bool helperExec(LPCWSTR moDirectory, LPCWSTR commandLine) } -bool init(const std::wstring &moDirectory) +bool init(const std::wstring &moPath, const std::wstring &dataPath) { DWORD userNameLen = UNLEN + 1; wchar_t userName[UNLEN + 1]; @@ -74,22 +74,22 @@ bool init(const std::wstring &moDirectory) wchar_t *commandLine = new wchar_t[32768]; _snwprintf(commandLine, 32768, L"init \"%ls\" \"%ls\"", - moDirectory.c_str(), userName); + dataPath.c_str(), userName); - bool res = helperExec(moDirectory.c_str(), commandLine); + bool res = helperExec(moPath.c_str(), commandLine); delete [] commandLine; return res; } -bool backdateBSAs(const std::wstring &moDirectory, const std::wstring &dataPath) +bool backdateBSAs(const std::wstring &moPath, const std::wstring &dataPath) { wchar_t *commandLine = new wchar_t[32768]; _snwprintf(commandLine, 32768, L"backdateBSA \"%ls\"", dataPath.c_str()); - bool res = helperExec(moDirectory.c_str(), commandLine); + bool res = helperExec(moPath.c_str(), commandLine); delete [] commandLine; return res; diff --git a/src/helper.h b/src/helper.h index 410e2527..cd4b7883 100644 --- a/src/helper.h +++ b/src/helper.h @@ -38,17 +38,17 @@ namespace Helper { * This will create all required sub-directories and give the user running ModOrganizer * write-access * - * @param moDirectory absolute path to the ModOrganizer base directory + * @param moPath absolute path to the ModOrganizer base directory * @return true on success **/ -bool init(const std::wstring &moDirectory); +bool init(const std::wstring &moPath, const std::wstring &dataPath); /** * @brief sets the last modified time for all .bsa-files in the target directory well into the past - * @param moDirectory absolute path to the modOrganizer base directory + * @param moPath absolute path to the modOrganizer base directory * @param dataPath the path taht contains the .bsa-files, usually the data directory of the game **/ -bool backdateBSAs(const std::wstring &moDirectory, const std::wstring &dataPath); +bool backdateBSAs(const std::wstring &moPath, const std::wstring &dataPath); } diff --git a/src/main.cpp b/src/main.cpp index 6db5a50e..3cced2a1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -104,7 +104,8 @@ bool createAndMakeWritable(const std::wstring &subPath) "will be made writable for the current user account). You will be asked to run " "\"helper.exe\" with administrative rights."), QMessageBox::Yes | QMessageBox::Cancel) == QMessageBox::Yes) { - if (!Helper::init(dataPath.toStdWString())) { + if (!Helper::init(qApp->applicationDirPath().toStdWString(), + dataPath.toStdWString())) { return false; } } else { diff --git a/src/settingsdialog.cpp b/src/settingsdialog.cpp index d354b29b..e528f478 100644 --- a/src/settingsdialog.cpp +++ b/src/settingsdialog.cpp @@ -96,7 +96,7 @@ void SettingsDialog::on_bsaDateBtn_clicked() = qApp->property("managed_game").value(); QDir dir = game->dataDirectory(); - Helper::backdateBSAs(qApp->property("dataPath").toString().toStdWString(), + Helper::backdateBSAs(qApp->applicationDirPath().toStdWString(), dir.absolutePath().toStdWString()); } diff --git a/src/version.rc b/src/version.rc index 872c65d7..445f7c19 100644 --- a/src/version.rc +++ b/src/version.rc @@ -1,7 +1,7 @@ #include "Winver.h" -#define VER_FILEVERSION 2,0,5 -#define VER_FILEVERSION_STR "2.0.5beta\0" +#define VER_FILEVERSION 2,0,6 +#define VER_FILEVERSION_STR "2.0.6beta\0" VS_VERSION_INFO VERSIONINFO FILEVERSION VER_FILEVERSION -- cgit v1.3.1