Skip to content

Commit d3b21da

Browse files
feat(Wind): Extend ResolveConfiguration with complete INativeWindowConfiguration
Add full Electron workbench configuration to ResolveConfiguration() including: - appRoot set to embedded assets path (/Static/Application/) - INativeWindowConfiguration fields: mainPid, machineId, sqmId, devDeviceId, isPortable, execPath, homeDir, tmpDir, userDataDir, logLevel, loggers, perfMarks, colorScheme, autoDetectHighContrast, autoDetectColorScheme - profiles configuration with default user data paths - product metadata (nameShort, nameLong) This provides the complete configuration interface that the Electron workbench expects, enabling proper window initialization and workspace setup.
1 parent dc79311 commit d3b21da

2 files changed

Lines changed: 125 additions & 3 deletions

File tree

Source/Function/Install.ts

Lines changed: 68 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,78 @@ export function CreateProcess(
155155
};
156156
}
157157

158-
// Configuration resolution with VSCode typing
158+
// Configuration resolution with VSCode typing.
159+
// Returns ISandboxConfiguration extended with INativeWindowConfiguration
160+
// fields that the Electron workbench reads (appRoot, colorScheme, etc.).
161+
// The browser workbench ignores the extra fields — additive only.
159162
export async function ResolveConfiguration(): Promise<ISandboxConfiguration> {
163+
// Use pathname only — the Electron workbench passes appRoot through
164+
// fileUriFromPath which prepends vscode-file://. The Step 5 build
165+
// patch replaces that with a direct URL using _VSCODE_FILE_ROOT,
166+
// so appRoot is no longer used for URL computation. Keep it as a
167+
// clean path for any other code that reads it.
168+
const FileRoot = "/Static/Application/";
169+
160170
return {
161171
windowId: 1,
162-
appRoot: "file:///app",
172+
// Electron workbench computes baseUrl from appRoot:
173+
// new URL(`${fileUriFromPath(appRoot, {scheme:'vscode-file'})}/out/`)
174+
// We override _VSCODE_FILE_ROOT after load, but appRoot is still
175+
// read for path construction. Point it at the embedded assets root.
176+
appRoot: FileRoot,
163177
userEnv: { PATH: "/usr/bin:/bin", HOME: "/" },
178+
179+
// INativeWindowConfiguration fields for Electron workbench
180+
mainPid: 0,
181+
machineId: "tauri-machine",
182+
sqmId: "",
183+
devDeviceId: "",
184+
isPortable: false,
185+
execPath: "/",
186+
homeDir: "/",
187+
tmpDir: "/tmp",
188+
userDataDir: "/",
189+
logLevel: 2,
190+
loggers: [],
191+
perfMarks: [],
192+
colorScheme: { dark: true, highContrast: false },
193+
autoDetectHighContrast: false,
194+
autoDetectColorScheme: false,
195+
profiles: {
196+
home: { scheme: "vscode-userdata", path: "/User" },
197+
all: [],
198+
profile: {
199+
id: "__default__profile__",
200+
isDefault: true,
201+
name: "Default",
202+
location: undefined,
203+
globalStorageHome: {
204+
scheme: "vscode-userdata",
205+
path: "/User/globalStorage",
206+
},
207+
settingsResource: {
208+
scheme: "vscode-userdata",
209+
path: "/User/settings.json",
210+
},
211+
keybindingsResource: {
212+
scheme: "vscode-userdata",
213+
path: "/User/keybindings.json",
214+
},
215+
tasksResource: {
216+
scheme: "vscode-userdata",
217+
path: "/User/tasks.json",
218+
},
219+
snippetsHome: {
220+
scheme: "vscode-userdata",
221+
path: "/User/snippets",
222+
},
223+
extensionsResource: undefined,
224+
cacheHome: {
225+
scheme: "vscode-userdata",
226+
path: "/User/cacheHome",
227+
},
228+
},
229+
},
164230
product: {
165231
nameShort: "VSCode Wind",
166232
nameLong: "VSCode Wind",

Target/Function/Install.js

Lines changed: 57 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)