Use TelegramForcePortable for alpha versions.

This commit is contained in:
John Preston
2018-10-09 19:21:20 +03:00
parent 631e51a493
commit e8a390c251
2 changed files with 69 additions and 55 deletions

View File

@@ -332,18 +332,20 @@ void start(not_null<Core::Launcher*> launcher) {
if (cAlphaVersion()) {
workingDirChosen = true;
#if defined Q_OS_MAC || defined Q_OS_LINUX
} else {
#ifdef _DEBUG
cForceWorkingDir(cExeDir());
#else // _DEBUG
if (!cWorkingDir().isEmpty()) {
// This value must come only from the "-workdir" argument.
// This value must come from TelegramForcePortable
// or from the "-workdir" command line argument.
cForceWorkingDir(cWorkingDir());
} else {
#ifdef _DEBUG
cForceWorkingDir(cExeDir());
#else // _DEBUG
cForceWorkingDir(psAppDataPath());
}
#endif // !_DEBUG
}
workingDirChosen = true;
#if defined Q_OS_LINUX && !defined _DEBUG // fix first version
@@ -354,6 +356,7 @@ void start(not_null<Core::Launcher*> launcher) {
} else {
cForceWorkingDir(psAppDataPath());
workingDirChosen = true;
#elif defined OS_WIN_STORE // Q_OS_MAC || Q_OS_LINUX || Q_OS_WINRT
#ifdef _DEBUG
cForceWorkingDir(cExeDir());
@@ -361,13 +364,16 @@ void start(not_null<Core::Launcher*> launcher) {
cForceWorkingDir(psAppDataPath());
#endif // !_DEBUG
workingDirChosen = true;
#elif defined Q_OS_WIN
} else {
if (!cWorkingDir().isEmpty()) {
// This value must come only from the "-workdir" argument.
// This value must come from TelegramForcePortable
// or from the "-workdir" command line argument.
cForceWorkingDir(cWorkingDir());
workingDirChosen = true;
}
#endif // Q_OS_MAC || Q_OS_LINUX || Q_OS_WINRT || OS_WIN_STORE
}