mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-05 08:55:59 +00:00
Add a method to calculate instance hash to Launcher
This commit is contained in:
@@ -504,6 +504,22 @@ uint64 Launcher::installationTag() const {
|
||||
return InstallationTag;
|
||||
}
|
||||
|
||||
QByteArray Launcher::instanceHash() const {
|
||||
static const auto Result = [&] {
|
||||
QByteArray h(32, 0);
|
||||
if (customWorkingDir()) {
|
||||
const auto d = QFile::encodeName(
|
||||
QDir(cWorkingDir()).absolutePath());
|
||||
hashMd5Hex(d.constData(), d.size(), h.data());
|
||||
} else {
|
||||
const auto f = QFile::encodeName(cExeDir() + cExeName());
|
||||
hashMd5Hex(f.constData(), f.size(), h.data());
|
||||
}
|
||||
return h;
|
||||
}();
|
||||
return Result;
|
||||
}
|
||||
|
||||
void Launcher::processArguments() {
|
||||
enum class KeyFormat {
|
||||
NoValues,
|
||||
|
Reference in New Issue
Block a user