Keep the two Windows executables from being one file

Windows matches a filename without regard to its case, so Dikte.exe and
dikte.exe were one file in the installation directory: PyInstaller wrote
the console build second and that is the only one that landed. Every
launcher then opened a console window behind the tray, and closing it
killed the application.

The console one is dikte-cli.exe now, which the setup's shim names. The
build reads the PE subsystem of both afterwards, since a filesystem that
keeps the two names apart is exactly what the check would run on
otherwise.
This commit is contained in:
2026-08-19 11:11:30 +03:00
parent 23d56acfb5
commit 29643f26b3
6 changed files with 66 additions and 9 deletions
+3 -3
View File
@@ -84,8 +84,8 @@ Filename: "{app}\Dikte.exe"; Description: "Start Dikte"; \
{ The `dikte` command. WindowsApps is already on the user's PATH, so a .cmd
left there runs from any terminal without touching the PATH and without an
administrator; the alternative is an environment variable edit that every
open terminal misses. It names the console executable, which is the one that
can print to the terminal it was typed in. }
open terminal misses. It names dikte-cli.exe, the console executable, which
is the one that can print to the terminal it was typed in. }
function ShimDir(): String;
begin
@@ -104,7 +104,7 @@ begin
if CurStep = ssPostInstall then begin
if DirExists(ShimDir()) then begin
Shim := '@echo off' + #13#10
+ '"' + ExpandConstant('{app}\dikte.exe') + '" %*' + #13#10;
+ '"' + ExpandConstant('{app}\dikte-cli.exe') + '" %*' + #13#10;
SaveStringToFile(ShimPath(), Shim, False);
end;
end;