2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-01 15:05:56 +00:00

Try to restore updater-dependent binary path logic

Now that the file generating logic is simplier, it may be not that hard to maintain
This commit is contained in:
Ilya Fedin
2023-04-01 22:56:09 +04:00
committed by John Preston
parent 40e65eb1e6
commit 3064a41014
4 changed files with 18 additions and 9 deletions

View File

@@ -422,7 +422,11 @@ bool GenerateDesktopFile(
target->set_string(
group,
"TryExec",
KShell::joinArgs({ cExeDir() + cExeName() }).replace(
KShell::joinArgs({
!Core::UpdaterDisabled()
? (cExeDir() + cExeName())
: cExeName()
}).replace(
'\\',
qstr("\\\\")).toStdString());
}
@@ -430,7 +434,9 @@ bool GenerateDesktopFile(
if (target->has_key(group, "Exec")) {
if (group == "Desktop Entry" && !args.isEmpty()) {
QStringList exec;
exec.append(cExeDir() + cExeName());
exec.append(!Core::UpdaterDisabled()
? (cExeDir() + cExeName())
: cExeName());
if (Core::Sandbox::Instance().customWorkingDir()) {
exec.append(u"-workdir"_q);
exec.append(cWorkingDir());
@@ -451,7 +457,9 @@ bool GenerateDesktopFile(
qstr("\\")));
if (!exec.isEmpty()) {
exec[0] = cExeDir() + cExeName();
exec[0] = !Core::UpdaterDisabled()
? (cExeDir() + cExeName())
: cExeName();
if (Core::Sandbox::Instance().customWorkingDir()) {
exec.insert(1, u"-workdir"_q);
exec.insert(2, cWorkingDir());