feat: enhance Windows compatibility with process handling and UI improvements

This commit is contained in:
sudipnext 2026-03-23 16:58:25 +05:45
parent 7a56045db3
commit 5ccf5bbb57
5 changed files with 10 additions and 2 deletions

View file

@ -211,6 +211,7 @@ async function installWindows(wc: WebContents): Promise<void> {
const ps = `$p = Start-Process -FilePath "msiexec" -ArgumentList "/i", '${destEscaped}', "/qn", "/norestart" -Verb RunAs -Wait -PassThru; if ($p) { exit $p.ExitCode } else { exit 1 }`;
const child = spawn("powershell", ["-NoProfile", "-ExecutionPolicy", "Bypass", "-Command", ps], {
stdio: ["ignore", "pipe", "pipe"],
windowsHide: true,
});
child.stdout?.on("data", (d: Buffer) => sendLog(wc, "info", d.toString()));
child.stderr?.on("data", (d: Buffer) => sendLog(wc, "warn", d.toString()));

View file

@ -30,6 +30,10 @@ ipcMain.handle("startup:get-status", () => startupStatus);
app.commandLine.appendSwitch('gtk-version', '3');
// Work around Chromium/Electron GPU compositor issues that can cause
// startup white screens on some Linux/driver combinations.
app.disableHardwareAcceleration();
// Mitigate "Unable to move the cache: Access is denied" on Windows (Chromium disk cache).
// Use explicit cache paths and remove stale old_* dirs that cause move failures.
if (process.platform === "win32") {

View file

@ -280,6 +280,7 @@ export async function isLibreOfficeInstalled(): Promise<LibreOfficeCheckResult>
const quoted = `"${candidate}"`;
const { stdout } = await execAsync(`${quoted} --version`, {
timeout: 8_000,
windowsHide: process.platform === "win32",
});
return { installed: true, version: stdout.trim(), path: candidate };
} catch {
@ -293,6 +294,7 @@ export async function isLibreOfficeInstalled(): Promise<LibreOfficeCheckResult>
try {
const { stdout } = await execAsync("soffice --version", {
timeout: 8_000,
windowsHide: process.platform === "win32",
});
// Found via PATH record the bare command name as the path so callers
// can pass it directly to subprocess invocations.

View file

@ -40,8 +40,9 @@ export async function startFastApiServer(
args,
{
cwd: directory,
stdio: ["inherit", "pipe", "pipe"],
stdio: ["ignore", "pipe", "pipe"],
env: { ...process.env, ...env },
windowsHide: process.platform === "win32" && !isDev,
}
);
fastApiProcess.stdout.on("data", (data: any) => {

View file

@ -72,7 +72,7 @@ exe = EXE(
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=True,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,