Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@
"request": "launch",
"name": "Run Unit Tests",
"program": "${workspaceFolder}/test/unit/electron/index.js",
"runtimeExecutable": "${workspaceFolder}/.build/electron/Code - OSS.app/Contents/MacOS/Electron",
"runtimeExecutable": "${workspaceFolder}/.build/electron/Code - OSS.app/Contents/MacOS/Code - OSS",
"windows": {
"runtimeExecutable": "${workspaceFolder}/.build/electron/Code - OSS.exe"
},
Expand Down Expand Up @@ -535,7 +535,7 @@
"request": "launch",
"name": "Run Unit Tests For Current File",
"program": "${workspaceFolder}/test/unit/electron/index.js",
"runtimeExecutable": "${workspaceFolder}/.build/electron/Code - OSS.app/Contents/MacOS/Electron",
"runtimeExecutable": "${workspaceFolder}/.build/electron/Code - OSS.app/Contents/MacOS/Code - OSS",
"windows": {
"runtimeExecutable": "${workspaceFolder}/.build/electron/Code - OSS.exe"
},
Expand Down Expand Up @@ -571,7 +571,7 @@
"timeout": 240000,
"args": [
"-l",
"${workspaceFolder}/.build/electron/Code - OSS.app/Contents/MacOS/Electron"
"${workspaceFolder}/.build/electron/Code - OSS.app/Contents/MacOS/Code - OSS"
],
"outFiles": [
"${cwd}/out/**/*.js"
Expand Down
1 change: 1 addition & 0 deletions build/gulpfile.vscode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ function packageTask(platform: string, arch: string, sourceFolderName: string, d
} else if (platform === 'darwin') {
const shortcut = gulp.src('resources/darwin/bin/code.sh')
.pipe(replace('@@APPNAME@@', product.applicationName))
.pipe(replace('@@NAME@@', product.nameShort))
.pipe(rename('bin/code'));
const policyDest = gulp.src('.build/policies/darwin/**', { base: '.build/policies/darwin' })
.pipe(rename(f => f.dirname = `policies/${f.dirname}`));
Expand Down
1 change: 1 addition & 0 deletions build/lib/electron.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export const config = {
productAppName: product.nameLong,
companyName: 'Microsoft Corporation',
copyright: 'Copyright (C) 2026 Microsoft. All rights reserved',
darwinExecutable: product.nameShort,
darwinIcon: 'resources/darwin/code.icns',
darwinBundleIdentifier: product.darwinBundleIdentifier,
darwinApplicationCategoryType: 'public.app-category.developer-tools',
Expand Down
2 changes: 1 addition & 1 deletion resources/darwin/bin/code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if [ -z "$APP_PATH" ]; then
exit 1
fi
CONTENTS="$APP_PATH/Contents"
ELECTRON="$CONTENTS/MacOS/Electron"
ELECTRON="$CONTENTS/MacOS/@@NAME@@"
CLI="$CONTENTS/Resources/app/out/cli.js"
export VSCODE_NODE_OPTIONS=$NODE_OPTIONS
export VSCODE_NODE_REPL_EXTERNAL_MODULE=$NODE_REPL_EXTERNAL_MODULE
Expand Down
3 changes: 2 additions & 1 deletion scripts/code-cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ function code() {

if [[ "$OSTYPE" == "darwin"* ]]; then
NAME=`node -p "require('./product.json').nameLong"`
CODE="./.build/electron/$NAME.app/Contents/MacOS/Electron"
EXE_NAME=`node -p "require('./product.json').nameShort"`
CODE="./.build/electron/$NAME.app/Contents/MacOS/$EXE_NAME"
else
NAME=`node -p "require('./product.json').applicationName"`
CODE=".build/electron/$NAME"
Expand Down
3 changes: 2 additions & 1 deletion scripts/code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ function code() {

if [[ "$OSTYPE" == "darwin"* ]]; then
NAME=`node -p "require('./product.json').nameLong"`
CODE="./.build/electron/$NAME.app/Contents/MacOS/Electron"
EXE_NAME=`node -p "require('./product.json').nameShort"`
CODE="./.build/electron/$NAME.app/Contents/MacOS/$EXE_NAME"
else
NAME=`node -p "require('./product.json').applicationName"`
CODE=".build/electron/$NAME"
Expand Down
3 changes: 2 additions & 1 deletion scripts/node-electron.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ pushd $ROOT

if [[ "$OSTYPE" == "darwin"* ]]; then
NAME=`node -p "require('./product.json').nameLong"`
CODE="$ROOT/.build/electron/$NAME.app/Contents/MacOS/Electron"
EXE_NAME=`node -p "require('./product.json').nameShort"`
CODE="$ROOT/.build/electron/$NAME.app/Contents/MacOS/$EXE_NAME"
else
NAME=`node -p "require('./product.json').applicationName"`
CODE="$ROOT/.build/electron/$NAME"
Expand Down
3 changes: 2 additions & 1 deletion scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ cd $ROOT

if [[ "$OSTYPE" == "darwin"* ]]; then
NAME=`node -p "require('./product.json').nameLong"`
CODE="./.build/electron/$NAME.app/Contents/MacOS/Electron"
EXE_NAME=`node -p "require('./product.json').nameShort"`
CODE="./.build/electron/$NAME.app/Contents/MacOS/$EXE_NAME"
else
NAME=`node -p "require('./product.json').applicationName"`
CODE=".build/electron/$NAME"
Expand Down
19 changes: 16 additions & 3 deletions test/automation/src/electron.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,18 @@ function findFilePath(root: string, path: string): string {
throw new Error(`Could not find ${path} in any subdirectory`);
}

function parseVersion(version: string) {
const [, major, minor, patch] = /^(\d+)\.(\d+)\.(\d+)/.exec(version)!;
Comment thread
deepak1556 marked this conversation as resolved.
Outdated
return { major: parseInt(major), minor: parseInt(minor), patch: parseInt(patch) };
}

export function getDevElectronPath(): string {
const buildPath = join(root, '.build');
const product = require(join(root, 'product.json'));

switch (process.platform) {
case 'darwin':
return join(buildPath, 'electron', `${product.nameLong}.app`, 'Contents', 'MacOS', 'Electron');
return join(buildPath, 'electron', `${product.nameLong}.app`, 'Contents', 'MacOS', `${product.nameShort}`);
case 'linux':
return join(buildPath, 'electron', `${product.applicationName}`);
case 'win32':
Expand All @@ -139,8 +144,16 @@ export function getDevElectronPath(): string {

export function getBuildElectronPath(root: string): string {
switch (process.platform) {
case 'darwin':
return join(root, 'Contents', 'MacOS', 'Electron');
case 'darwin': {
const packageJson = require(join(root, 'Contents', 'Resources', 'app', 'package.json'));
const product = require(join(root, 'Contents', 'Resources', 'app', 'product.json'));
const { major, minor } = parseVersion(packageJson.version);
Comment thread
deepak1556 marked this conversation as resolved.
Comment thread
deepak1556 marked this conversation as resolved.
if (major === 1 && minor <= 109) {
return join(root, 'Contents', 'MacOS', 'Electron');
} else {
return join(root, 'Contents', 'MacOS', product.nameShort);
}
}
case 'linux': {
const product = require(join(root, 'resources', 'app', 'product.json'));
return join(root, product.applicationName);
Expand Down
2 changes: 1 addition & 1 deletion test/mcp/src/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ async function ensureStableCode(): Promise<void> {
}));

if (process.platform === 'darwin') {
// Visual Studio Code.app/Contents/MacOS/Electron
// Visual Studio Code.app/Contents/MacOS/Code
stableCodePath = path.dirname(path.dirname(path.dirname(stableCodeExecutable)));
} else {
// VSCode/Code.exe (Windows) | VSCode/code (Linux)
Expand Down
2 changes: 1 addition & 1 deletion test/smoke/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ async function ensureStableCode(): Promise<void> {
});

if (process.platform === 'darwin') {
// Visual Studio Code.app/Contents/MacOS/Electron
// Visual Studio Code.app/Contents/MacOS/Code
stableCodePath = path.dirname(path.dirname(path.dirname(stableCodeExecutable)));
} else {
// VSCode/Code.exe (Windows) | VSCode/code (Linux)
Expand Down
Loading