2
0
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:
Ilya Fedin
2025-03-11 05:26:12 +00:00
committed by John Preston
parent ff0f7f49da
commit 0fb67c78a9
4 changed files with 24 additions and 27 deletions

View File

@@ -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,