Skip to content

Commit 3640b74

Browse files
authored
Merge branch 'main' into fix-178017
2 parents 393d160 + c125687 commit 3640b74

File tree

88 files changed

+1472
-833
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+1472
-833
lines changed

build/.webignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,5 @@ xterm-addon-webgl/out/**
4949
!@microsoft/applicationinsights-core-js/browser/applicationinsights-core-js.min.js
5050
!@microsoft/applicationinsights-shims/dist/umd/applicationinsights-shims.min.js
5151

52-
53-
54-
52+
vsda/**
53+
!vsda/rust/web/**

build/gulpfile.vscode.win32.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ function buildWin32Setup(arch, target) {
9999
RegValueName: product.win32RegValueName,
100100
ShellNameShort: product.win32ShellNameShort,
101101
AppMutex: product.win32MutexName,
102+
TunnelMutex: product.win32TunnelMutex,
103+
TunnelServiceMutex: product.win32TunnelServiceMutex,
104+
ApplicationName: product.applicationName,
102105
Arch: arch,
103106
AppId: { 'ia32': ia32AppId, 'x64': x64AppId, 'arm64': arm64AppId }[arch],
104107
IncompatibleTargetAppId: { 'ia32': product.win32AppId, 'x64': product.win32x64AppId, 'arm64': product.win32arm64AppId }[arch],

build/lib/util.js

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

build/lib/util.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,13 @@ export function acquireWebNodePaths() {
394394
const root = path.join(__dirname, '..', '..');
395395
const webPackageJSON = path.join(root, '/remote/web', 'package.json');
396396
const webPackages = JSON.parse(fs.readFileSync(webPackageJSON, 'utf8')).dependencies;
397+
398+
const distroWebPackageJson = path.join(root, '.build/distro/npm/remote/web/package.json');
399+
if (fs.existsSync(distroWebPackageJson)) {
400+
const distroWebPackages = JSON.parse(fs.readFileSync(distroWebPackageJson, 'utf8')).dependencies;
401+
Object.assign(webPackages, distroWebPackages);
402+
}
403+
397404
const nodePaths: { [key: string]: string } = {};
398405
for (const key of Object.keys(webPackages)) {
399406
const packageJSON = path.join(root, 'node_modules', key, 'package.json');

build/win32/code.iss

Lines changed: 81 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ Name: "hungarian"; MessagesFile: "{#RepoDir}\build\win32\i18n\Default.hu.isl,{#R
6262
Name: "turkish"; MessagesFile: "compiler:Languages\Turkish.isl,{#RepoDir}\build\win32\i18n\messages.tr.isl" {#LocalizedLanguageFile("trk")}
6363

6464
[InstallDelete]
65-
Type: filesandordirs; Name: "{app}\resources\app\out"; Check: IsNotUpdate
66-
Type: filesandordirs; Name: "{app}\resources\app\plugins"; Check: IsNotUpdate
67-
Type: filesandordirs; Name: "{app}\resources\app\extensions"; Check: IsNotUpdate
68-
Type: filesandordirs; Name: "{app}\resources\app\node_modules"; Check: IsNotUpdate
69-
Type: filesandordirs; Name: "{app}\resources\app\node_modules.asar.unpacked"; Check: IsNotUpdate
70-
Type: files; Name: "{app}\resources\app\node_modules.asar"; Check: IsNotUpdate
71-
Type: files; Name: "{app}\resources\app\Credits_45.0.2454.85.html"; Check: IsNotUpdate
65+
Type: filesandordirs; Name: "{app}\resources\app\out"; Check: IsNotBackgroundUpdate
66+
Type: filesandordirs; Name: "{app}\resources\app\plugins"; Check: IsNotBackgroundUpdate
67+
Type: filesandordirs; Name: "{app}\resources\app\extensions"; Check: IsNotBackgroundUpdate
68+
Type: filesandordirs; Name: "{app}\resources\app\node_modules"; Check: IsNotBackgroundUpdate
69+
Type: filesandordirs; Name: "{app}\resources\app\node_modules.asar.unpacked"; Check: IsNotBackgroundUpdate
70+
Type: files; Name: "{app}\resources\app\node_modules.asar"; Check: IsNotBackgroundUpdate
71+
Type: files; Name: "{app}\resources\app\Credits_45.0.2454.85.html"; Check: IsNotBackgroundUpdate
7272

7373
[UninstallDelete]
7474
Type: filesandordirs; Name: "{app}\_"
@@ -1299,6 +1299,16 @@ Root: {#SoftwareClassesRootKey}; Subkey: "Software\Classes\Drive\shell\{#RegValu
12991299
Root: {#EnvironmentRootKey}; Subkey: "{#EnvironmentKey}"; ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app}\bin"; Tasks: addtopath; Check: NeedsAddPath(ExpandConstant('{app}\bin'))
13001300

13011301
[Code]
1302+
function IsBackgroundUpdate(): Boolean;
1303+
begin
1304+
Result := ExpandConstant('{param:update|false}') <> 'false';
1305+
end;
1306+
1307+
function IsNotBackgroundUpdate(): Boolean;
1308+
begin
1309+
Result := not IsBackgroundUpdate();
1310+
end;
1311+
13021312
// Don't allow installing conflicting architectures
13031313
function InitializeSetup(): Boolean;
13041314
var
@@ -1351,6 +1361,13 @@ begin
13511361
MsgBox('Please uninstall the ' + AltArch + '-bit version of {#NameShort} before installing this ' + ThisArch + '-bit version.', mbInformation, MB_OK);
13521362
end;
13531363
end;
1364+
1365+
if IsNotBackgroundUpdate() and CheckForMutexes('{#TunnelMutex}') then
1366+
begin
1367+
MsgBox('{#NameShort} is still running a tunnel. Please stop the tunnel before installing.', mbInformation, MB_OK);
1368+
Result := false
1369+
end;
1370+
13541371
end;
13551372
13561373
function WizardNotSilent(): Boolean;
@@ -1359,14 +1376,44 @@ begin
13591376
end;
13601377
13611378
// Updates
1362-
function IsBackgroundUpdate(): Boolean;
1379+
1380+
var
1381+
ShouldRestartTunnelService: Boolean;
1382+
1383+
procedure StopTunnelServiceIfNeeded();
1384+
var
1385+
StopServiceResultCode: Integer;
1386+
WaitCounter: Integer;
13631387
begin
1364-
Result := ExpandConstant('{param:update|false}') <> 'false';
1388+
ShouldRestartTunnelService := False;
1389+
if CheckForMutexes('{#TunnelServiceMutex}') then begin
1390+
// stop the tunnel service
1391+
Log('Stopping the tunnel service using ' + ExpandConstant('"{app}\bin\{#ApplicationName}.cmd"'));
1392+
ShellExec('', ExpandConstant('"{app}\bin\{#ApplicationName}.cmd"'), 'tunnel service uninstall', '', SW_HIDE, ewWaitUntilTerminated, StopServiceResultCode);
1393+
1394+
Log('Stopping the tunnel service completed with result code ' + IntToStr(StopServiceResultCode));
1395+
1396+
WaitCounter := 10;
1397+
while (WaitCounter > 0) and CheckForMutexes('{#TunnelServiceMutex}') do
1398+
begin
1399+
Log('Tunnel service is still running, waiting');
1400+
Sleep(500);
1401+
WaitCounter := WaitCounter - 1
1402+
end;
1403+
if CheckForMutexes('{#TunnelServiceMutex}') then
1404+
Log('Unable to stop tunnel service')
1405+
else
1406+
ShouldRestartTunnelService := True;
1407+
end
13651408
end;
13661409
1367-
function IsNotUpdate(): Boolean;
1410+
1411+
// called before the wizard checks for running application
1412+
function PrepareToInstall(var NeedsRestart: Boolean): String;
13681413
begin
1369-
Result := not IsBackgroundUpdate();
1414+
if IsNotBackgroundUpdate() then
1415+
StopTunnelServiceIfNeeded();
1416+
Result := ''
13701417
end;
13711418
13721419
// VS Code will create a flag file before the update starts (/update=C:\foo\bar)
@@ -1450,18 +1497,33 @@ end;
14501497
procedure CurStepChanged(CurStep: TSetupStep);
14511498
var
14521499
UpdateResultCode: Integer;
1500+
StartServiceResultCode: Integer;
14531501
begin
1454-
if IsBackgroundUpdate() and (CurStep = ssPostInstall) then
1502+
if CurStep = ssPostInstall then
14551503
begin
1456-
CreateMutex('{#AppMutex}-ready');
1457-
1458-
while (CheckForMutexes('{#AppMutex}')) do
1504+
if IsBackgroundUpdate() then
14591505
begin
1460-
Log('Application is still running, waiting');
1461-
Sleep(1000);
1506+
CreateMutex('{#AppMutex}-ready');
1507+
1508+
while (CheckForMutexes('{#AppMutex}')) do
1509+
begin
1510+
Log('Application is still running, waiting');
1511+
Sleep(1000)
1512+
end;
1513+
1514+
StopTunnelServiceIfNeeded();
1515+
1516+
Exec(ExpandConstant('{app}\tools\inno_updater.exe'), ExpandConstant('"{app}\{#ExeBasename}.exe" ' + BoolToStr(LockFileExists())), '', SW_SHOW, ewWaitUntilTerminated, UpdateResultCode);
14621517
end;
14631518
1464-
Exec(ExpandConstant('{app}\tools\inno_updater.exe'), ExpandConstant('"{app}\{#ExeBasename}.exe" ' + BoolToStr(LockFileExists())), '', SW_SHOW, ewWaitUntilTerminated, UpdateResultCode);
1519+
if ShouldRestartTunnelService then
1520+
begin
1521+
// start the tunnel service
1522+
Log('Restarting the tunnel service...');
1523+
ShellExec('', ExpandConstant('"{app}\bin\{#ApplicationName}.cmd"'), 'tunnel service install', '', SW_HIDE, ewWaitUntilTerminated, StartServiceResultCode);
1524+
Log('Starting the tunnel service completed with result code ' + IntToStr(StartServiceResultCode));
1525+
ShouldRestartTunnelService := False
1526+
end;
14651527
end;
14661528
end;
14671529
@@ -1545,4 +1607,4 @@ begin
15451607
#endif
15461608
15471609
Exec(ExpandConstant('{sys}\icacls.exe'), ExpandConstant('"{app}" /inheritancelevel:r ') + Permissions, '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
1548-
end;
1610+
end;

extensions/git/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"diffCommand",
1414
"contribEditorContentMenu",
1515
"contribEditSessions",
16-
"canonicalUriIdentityProvider",
16+
"canonicalUriProvider",
1717
"contribViewsWelcome",
1818
"editSessionIdentityProvider",
1919
"quickDiffProvider",

extensions/git/src/editSessionIdentityProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export class GitEditSessionIdentityProvider implements vscode.EditSessionIdentit
3535
}
3636

3737
const remoteUrl = repository.remotes.find((remote) => remote.name === repository.HEAD?.upstream?.remote)?.pushUrl?.replace(/^(git@[^\/:]+)(:)/i, 'ssh://$1/');
38-
const remote = remoteUrl ? await vscode.workspace.provideCanonicalUriIdentity(vscode.Uri.parse(remoteUrl), token) : null;
38+
const remote = remoteUrl ? await vscode.workspace.getCanonicalUri(vscode.Uri.parse(remoteUrl), { targetScheme: 'https' }, token) : null;
3939

4040
return JSON.stringify({
4141
remote: remote?.toString() ?? remoteUrl,

extensions/git/src/typings/vscode.proposed.canonicalUriIdentityProvider.d.ts

Lines changed: 0 additions & 38 deletions
This file was deleted.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
declare module 'vscode' {
7+
8+
// https://github.com/microsoft/vscode/issues/180582
9+
10+
export namespace workspace {
11+
/**
12+
*
13+
* @param scheme The URI scheme that this provider can provide canonical URIs for.
14+
* A canonical URI represents the conversion of a resource's alias into a source of truth URI.
15+
* Multiple aliases may convert to the same source of truth URI.
16+
* @param provider A provider which can convert URIs of scheme @param scheme to
17+
* a canonical URI which is stable across machines.
18+
*/
19+
export function registerCanonicalUriProvider(scheme: string, provider: CanonicalUriProvider): Disposable;
20+
21+
/**
22+
*
23+
* @param uri The URI to provide a canonical URI for.
24+
* @param token A cancellation token for the request.
25+
*/
26+
export function getCanonicalUri(uri: Uri, options: CanonicalUriRequestOptions, token: CancellationToken): ProviderResult<Uri>;
27+
}
28+
29+
export interface CanonicalUriProvider {
30+
/**
31+
*
32+
* @param uri The URI to provide a canonical URI for.
33+
* @param options Options that the provider should honor in the URI it returns.
34+
* @param token A cancellation token for the request.
35+
* @returns The canonical URI for the requested URI or undefined if no canonical URI can be provided.
36+
*/
37+
provideCanonicalUri(uri: Uri, options: CanonicalUriRequestOptions, token: CancellationToken): ProviderResult<Uri>;
38+
}
39+
40+
export interface CanonicalUriRequestOptions {
41+
/**
42+
*
43+
* The desired scheme of the canonical URI.
44+
*/
45+
targetScheme: string;
46+
}
47+
}

extensions/github/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"enabledApiProposals": [
2929
"contribShareMenu",
3030
"contribEditSessions",
31-
"canonicalUriIdentityProvider"
31+
"canonicalUriProvider"
3232
],
3333
"contributes": {
3434
"commands": [

0 commit comments

Comments
 (0)