|
1 | 1 | import { execFile, execFileSync, spawn } from "node:child_process"; |
2 | 2 | import { createHash } from "node:crypto"; |
3 | 3 | import { chmodSync, existsSync, mkdirSync, readFileSync, renameSync, unlinkSync, writeFileSync } from "node:fs"; |
4 | | -import { homedir } from "node:os"; |
5 | 4 | import { join, resolve } from "node:path"; |
6 | | -import { expandUserPath, getConfigDir } from "../config"; |
| 5 | +import { getConfigDir } from "../config"; |
7 | 6 | import { durableBunPath } from "../lib/bun-runtime"; |
8 | 7 | import { hardenSecretDir, hardenSecretPath } from "../lib/windows-secret-acl"; |
| 8 | +import { resolveCodexHomeDir } from "../codex/home"; |
9 | 9 |
|
10 | 10 | const RUN_KEY = "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run"; |
11 | 11 | const RUN_PARENT_KEY = "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion"; |
@@ -75,8 +75,10 @@ function sourceTrayIconPaths(): string[] { |
75 | 75 | } |
76 | 76 |
|
77 | 77 | function currentCodexHome(): string { |
78 | | - const raw = process.env.CODEX_HOME?.trim(); |
79 | | - return raw ? resolve(expandUserPath(raw)) : join(homedir(), ".codex"); |
| 78 | + // Keep the tray's listener/launcher target aligned with Codex's active home. |
| 79 | + // This matters on the Windows desktop setup, where CODEX_HOME is E:\\codex |
| 80 | + // instead of the historical %USERPROFILE%\\.codex fallback. |
| 81 | + return resolveCodexHomeDir(); |
80 | 82 | } |
81 | 83 |
|
82 | 84 | function currentEntry(): WindowsTrayEntry { |
|
0 commit comments