Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
157 changes: 99 additions & 58 deletions patches/11-update-use-github-release.patch
Original file line number Diff line number Diff line change
Expand Up @@ -269,14 +269,20 @@ index 2be53f61..8776a7f6 100644
+
this.setState(State.Idle(UpdateType.Archive, message));
diff --git a/src/vs/platform/update/electron-main/updateService.win32.ts b/src/vs/platform/update/electron-main/updateService.win32.ts
index 222db559..0037e002 100644
index 1911ac0a6bc..8fe1d1e1cf0 100644
--- a/src/vs/platform/update/electron-main/updateService.win32.ts
+++ b/src/vs/platform/update/electron-main/updateService.win32.ts
@@ -14,3 +14,2 @@ import { CancellationToken, CancellationTokenSource } from '../../../base/common
@@ -12,7 +12,6 @@ import { Delayer, ProcessTimeRunOnceScheduler, timeout } from '../../../base/com
import { VSBuffer } from '../../../base/common/buffer.js';
import { CancellationToken, CancellationTokenSource } from '../../../base/common/cancellation.js';
import { memoize } from '../../../base/common/decorators.js';
-import { hash } from '../../../base/common/hash.js';
import * as path from '../../../base/common/path.js';
@@ -32,7 +31,7 @@ import { INativeHostMainService } from '../../native/electron-main/nativeHostMai
import { basename } from '../../../base/common/path.js';
import { transform } from '../../../base/common/stream.js';
@@ -29,11 +28,11 @@ import { ILogService } from '../../log/common/log.js';
import { IMeteredConnectionService } from '../../meteredConnection/common/meteredConnection.js';
import { INativeHostMainService } from '../../native/electron-main/nativeHostMainService.js';
import { IProductService } from '../../product/common/productService.js';
-import { asJson, IRequestService } from '../../request/common/request.js';
+import { IRequestService, NO_FETCH_TELEMETRY } from '../../request/common/request.js';
Expand All @@ -287,7 +293,11 @@ index 222db559..0037e002 100644
+import { AvailableForDownload, DisablementReason, IUpdate, State, StateType, Target, UpdateType } from '../common/update.js';
+import { AbstractUpdateService, createUpdateURL, IUpdateURLOptions } from './abstractUpdateService.js';

@@ -50,5 +49,9 @@ function getUpdateType(): UpdateType {
interface IAvailableUpdate {
packagePath: string;
@@ -47,9 +46,13 @@ interface IAvailableUpdate {
let _updateType: UpdateType | undefined = undefined;
function getUpdateType(): UpdateType {
if (typeof _updateType === 'undefined') {
- _updateType = existsSync(path.join(path.dirname(process.execPath), 'unins000.exe'))
- ? UpdateType.Setup
Expand All @@ -300,12 +310,20 @@ index 222db559..0037e002 100644
+ _updateType = UpdateType.Archive;
+ }
}
@@ -158,3 +161,3 @@ export class Win32UpdateService extends AbstractUpdateService implements IRelaun

return _updateType;
@@ -168,7 +171,7 @@ export class Win32UpdateService extends AbstractUpdateService implements IRelaun
// updatingVersionPath will be deleted by inno setup.
}
} else {
- const fastUpdatesEnabled = this.configurationService.getValue('update.enableWindowsBackgroundUpdates');
+ const fastUpdatesEnabled = getUpdateType() === UpdateType.Setup && this.configurationService.getValue('update.enableWindowsBackgroundUpdates');
// GC for background updates in system setup happens via inno_setup since it requires
@@ -178,12 +181,22 @@ export class Win32UpdateService extends AbstractUpdateService implements IRelaun
// elevated permissions.
if (fastUpdatesEnabled && this.productService.target === 'user' && this.productService.commit) {
@@ -187,16 +190,26 @@ export class Win32UpdateService extends AbstractUpdateService implements IRelaun
}
}

- protected buildUpdateFeedUrl(quality: string, commit: string, options?: IUpdateURLOptions): string | undefined {
- let platform = `win32-${process.arch}`;
Expand Down Expand Up @@ -336,14 +354,20 @@ index 222db559..0037e002 100644
- return createUpdateURL(this.productService.updateUrl!, platform, quality, commit, options);
+ return createUpdateURL(this.productService, quality, process.platform, process.arch, target);
}
@@ -195,6 +208,2 @@ export class Win32UpdateService extends AbstractUpdateService implements IRelaun

protected doCheckForUpdates(explicit: boolean, pendingCommit?: string): void {
@@ -204,22 +217,22 @@ export class Win32UpdateService extends AbstractUpdateService implements IRelaun
return;
}

- const internalOrg = this.getInternalOrg();
- const background = !explicit && !internalOrg;
- const url = this.buildUpdateFeedUrl(this.quality, pendingCommit ?? this.productService.commit!, { background, internalOrg });
-
// Only set CheckingForUpdates if we're not already in Overwriting state
@@ -204,9 +213,13 @@ export class Win32UpdateService extends AbstractUpdateService implements IRelaun
if (this.state.type !== StateType.Overwriting) {
this.setState(State.CheckingForUpdates(explicit));
}

- const headers = getUpdateRequestHeaders(this.productService.version);
- this.requestService.request({ url, headers, callSite: 'updateService.win32.checkForUpdates' }, CancellationToken.None)
Expand All @@ -362,7 +386,11 @@ index 222db559..0037e002 100644
- if (!update || !update.url || !update.version || !update.productVersion) {
+ if(!result) {
// If we were checking for an overwrite update and found nothing newer,
@@ -222,2 +235,9 @@ export class Win32UpdateService extends AbstractUpdateService implements IRelaun
// restore the Ready state with the pending update
if (this.state.type === StateType.Overwriting) {
@@ -231,6 +244,13 @@ export class Win32UpdateService extends AbstractUpdateService implements IRelaun
return Promise.resolve(null);
}

+ const { lastest, update } = result;
+
Expand All @@ -372,12 +400,20 @@ index 222db559..0037e002 100644
+ }
+
if (updateType === UpdateType.Archive) {
@@ -247,3 +267,3 @@ export class Win32UpdateService extends AbstractUpdateService implements IRelaun
this.setState(State.AvailableForDownload(update));
return Promise.resolve(null);
@@ -256,7 +276,7 @@ export class Win32UpdateService extends AbstractUpdateService implements IRelaun

const downloadPath = `${updatePackagePath}.tmp`;

- return this.requestService.request({ url: update.url, callSite: 'updateService.win32.downloadUpdate' }, CancellationToken.None)
+ return this.requestService.request({ url: update.url, callSite: NO_FETCH_TELEMETRY }, CancellationToken.None)
.then(context => {
@@ -292,8 +312,7 @@ export class Win32UpdateService extends AbstractUpdateService implements IRelaun
// Get total size from Content-Length header
const contentLengthHeader = context.res.headers['content-length'];
@@ -301,12 +321,11 @@ export class Win32UpdateService extends AbstractUpdateService implements IRelaun
});
});
})
- .then(undefined, err => {
- this.telemetryService.publicLog2<{ messageHash: string }, UpdateErrorClassification>('update:error', { messageHash: String(hash(String(err))) });
Expand All @@ -389,52 +425,57 @@ index 222db559..0037e002 100644
- const message: string | undefined = explicit ? (err.message || err) : undefined;
+ const message: string | undefined = explicit ? (error.message || error) : undefined;

@@ -357,20 +376,31 @@ export class Win32UpdateService extends AbstractUpdateService implements IRelaun
await pfs.Promises.writeFile(this.availableUpdate.updateFilePath, 'flag');
- const child = spawn(this.availableUpdate.packagePath,
- [
- '/verysilent',
- '/log',
- `/update="${this.availableUpdate.updateFilePath}"`,
- `/progress="${progressFilePath}"`,
- `/sessionend="${sessionEndFlagPath}"`,
- `/cancel="${cancelFilePath}"`,
- '/nocloseapplications',
- '/mergetasks=runcode,!desktopicon,!quicklaunchicon'
- ],
- {
+
+ let child: ChildProcess
// If we were checking for an overwrite update and it failed,
// restore the Ready state with the pending update
@@ -373,24 +392,34 @@ export class Win32UpdateService extends AbstractUpdateService implements IRelaun
await this.unlink(progressFilePath);
await pfs.Promises.writeFile(this.availableUpdate.updateFilePath, 'flag');

- const child = spawn(this.availableUpdate.packagePath,
- [
- '/verysilent',
- '/log',
- `/update="${this.availableUpdate.updateFilePath}"`,
- `/progress="${progressFilePath}"`,
- `/sessionend="${sessionEndFlagPath}"`,
- `/cancel="${cancelFilePath}"`,
- '/nocloseapplications',
- '/mergetasks=runcode,!desktopicon,!quicklaunchicon'
- ],
- {
+ let child: ChildProcess
+
+ const type = getUpdateType();
+ if (type == UpdateType.WindowsInstaller) {
+ child = spawn('msiexec.exe', ['/i', this.availableUpdate.packagePath], {
detached: true,
- stdio: ['ignore', 'ignore', 'ignore'],
- windowsVerbatimArguments: true,
- env: { ...process.env, __COMPAT_LAYER: 'RunAsInvoker' }
- }
- );
+ stdio: ['ignore', 'ignore', 'ignore']
+ });
+ } else {
+ child = spawn(this.availableUpdate.packagePath,
+ [
+ '/verysilent',
+ '/log',
+ `/update="${this.availableUpdate.updateFilePath}"`,
+ `/progress="${progressFilePath}"`,
+ `/sessionend="${sessionEndFlagPath}"`,
+ `/cancel="${cancelFilePath}"`,
+ '/nocloseapplications',
+ '/mergetasks=runcode,!desktopicon,!quicklaunchicon'
+ ],
+ {
+ detached: true,
+ stdio: ['ignore', 'ignore', 'ignore'],
+ windowsVerbatimArguments: true,
+ env: { ...process.env, __COMPAT_LAYER: 'RunAsInvoker' }
+ }
+ );
+ }
+ const type = getUpdateType();
+ if (type == UpdateType.WindowsInstaller) {
+ child = spawn('msiexec.exe', ['/i', this.availableUpdate.packagePath], {
detached: true,
- stdio: ['ignore', 'ignore', 'ignore'],
- windowsVerbatimArguments: true,
- env: { ...process.env, __COMPAT_LAYER: 'RunAsInvoker' }
- }
- );
+ stdio: ['ignore', 'ignore', 'ignore']
+ });
+ } else {
+ child = spawn(this.availableUpdate.packagePath,
+ [
+ '/verysilent',
+ '/log',
+ `/update="${this.availableUpdate.updateFilePath}"`,
+ `/progress="${progressFilePath}"`,
+ `/sessionend="${sessionEndFlagPath}"`,
+ `/cancel="${cancelFilePath}"`,
+ '/nocloseapplications',
+ '/mergetasks=runcode,!desktopicon,!quicklaunchicon'
+ ],
+ {
+ detached: true,
+ stdio: ['ignore', 'ignore', 'ignore'],
+ windowsVerbatimArguments: true,
+ env: { ...process.env, __COMPAT_LAYER: 'RunAsInvoker' }
+ }
+ );
+ }

// Track the process so we can cancel it if needed
this.availableUpdate.updateProcess = child;
36 changes: 18 additions & 18 deletions patches/20-keymap-use-custom-lib.patch
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
diff --git a/.npmrc b/.npmrc
index 025e4b04..5e409d87 100644
index 8c21e58ef14..25a93f408ad 100644
--- a/.npmrc
+++ b/.npmrc
@@ -4,5 +4,6 @@ ms_build_id="13870025"
@@ -4,5 +4,6 @@ ms_build_id="14159160"
runtime="electron"
ignore-scripts=false
build_from_source="true"
+build_from_source_native_keymap="no"
legacy-peer-deps="true"
timeout=180000
diff --git a/build/.moduleignore b/build/.moduleignore
index 00779f06..4e809334 100644
index 90780acffa9..b226373f632 100644
--- a/build/.moduleignore
+++ b/build/.moduleignore
@@ -63,11 +63,11 @@ fsevents/test/**
Expand All @@ -31,10 +31,10 @@ index 00779f06..4e809334 100644
native-is-elevated/binding.gyp
native-is-elevated/build/**
diff --git a/eslint.config.js b/eslint.config.js
index 7ff8a911..5080ac33 100644
index fda37713fee..a2150a119a6 100644
--- a/eslint.config.js
+++ b/eslint.config.js
@@ -1516,7 +1516,7 @@ export default tseslint.config(
@@ -1530,7 +1530,7 @@ export default defineConfig(
'inspector',
'minimist',
'node:module',
Expand All @@ -44,26 +44,26 @@ index 7ff8a911..5080ac33 100644
'node-pty',
'os',
diff --git a/package-lock.json b/package-lock.json
index c8cb435d..f5b21ba4 100644
index 38d50ffa4de..cad1ae14f2c 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -39,6 +39,7 @@
@@ -41,6 +41,7 @@
"@vscode/windows-mutex": "^0.5.0",
"@vscode/windows-process-tree": "^0.7.0",
"@vscode/windows-registry": "^1.2.0",
+ "@vscodium/native-keymap": "3.3.7-258424",
"@xterm/addon-clipboard": "^0.3.0-beta.220",
"@xterm/addon-image": "^0.10.0-beta.220",
"@xterm/addon-ligatures": "^0.11.0-beta.220",
@@ -57,7 +58,6 @@
@@ -59,7 +60,6 @@
"kerberos": "2.1.1",
"minimist": "^1.2.8",
"native-is-elevated": "0.9.0",
- "native-keymap": "^3.3.5",
"node-addon-api": "^6.0.0",
"node-pty": "^1.2.0-beta.13",
"open": "^10.1.2",
"playwright-core": "1.59.1",
@@ -4122,6 +4122,13 @@
@@ -4466,6 +4466,13 @@
"hasInstallScript": true,
"license": "MIT"
},
Expand All @@ -77,7 +77,7 @@ index c8cb435d..f5b21ba4 100644
"node_modules/@webgpu/types": {
"version": "0.1.66",
"resolved": "https://registry.npmjs.org/@webgpu/types/-/types-0.1.66.tgz",
@@ -13843,9 +13850,10 @@
@@ -14114,9 +14121,10 @@
}
},
"node_modules/napi-build-utils": {
Expand All @@ -91,7 +91,7 @@ index c8cb435d..f5b21ba4 100644
},
"node_modules/native-is-elevated": {
"version": "0.9.0",
@@ -13854,13 +13862,6 @@
@@ -14125,13 +14133,6 @@
"hasInstallScript": true,
"license": "MIT"
},
Expand All @@ -105,7 +105,7 @@ index c8cb435d..f5b21ba4 100644
"node_modules/natural-compare": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
@@ -15257,16 +15258,17 @@
@@ -15526,16 +15527,17 @@
"license": "ISC"
},
"node_modules/prebuild-install": {
Expand All @@ -128,20 +128,20 @@ index c8cb435d..f5b21ba4 100644
"pump": "^3.0.0",
"rc": "^1.2.7",
diff --git a/package.json b/package.json
index 0db7d834..b904799d 100644
index a43d079633a..508acdfb4dd 100644
--- a/package.json
+++ b/package.json
@@ -134,7 +134,7 @@
@@ -141,7 +141,7 @@
"kerberos": "2.1.1",
"minimist": "^1.2.8",
"native-is-elevated": "0.9.0",
- "native-keymap": "^3.3.5",
+ "@vscodium/native-keymap": "3.3.7-258424",
"node-addon-api": "^6.0.0",
"node-pty": "^1.2.0-beta.13",
"open": "^10.1.2",
"playwright-core": "1.59.1",
diff --git a/src/vs/platform/environment/test/node/nativeModules.integrationTest.ts b/src/vs/platform/environment/test/node/nativeModules.integrationTest.ts
index 50360a79..93df77af 100644
index 9b11a712c25..975c312747a 100644
--- a/src/vs/platform/environment/test/node/nativeModules.integrationTest.ts
+++ b/src/vs/platform/environment/test/node/nativeModules.integrationTest.ts
@@ -42,12 +42,12 @@ flakySuite('Native Modules (all platforms)', () => {
Expand All @@ -162,7 +162,7 @@ index 50360a79..93df77af 100644

test('@vscode/native-watchdog', async () => {
diff --git a/src/vs/platform/keyboardLayout/electron-main/keyboardLayoutMainService.ts b/src/vs/platform/keyboardLayout/electron-main/keyboardLayoutMainService.ts
index 8950ce21..f31cea62 100644
index 8950ce2184a..f31cea623bc 100644
--- a/src/vs/platform/keyboardLayout/electron-main/keyboardLayoutMainService.ts
+++ b/src/vs/platform/keyboardLayout/electron-main/keyboardLayoutMainService.ts
@@ -3,7 +3,7 @@
Expand Down
Loading
Loading