Skip to content

Commit bc400a2

Browse files
authored
Merge pull request #256 from microsoft/connor4312/fix-windows-first-run
fix: archive extraction on Windows failing when run under Electron
2 parents 92c0591 + fdb7ef9 commit bc400a2

File tree

3 files changed

+27
-12
lines changed

3 files changed

+27
-12
lines changed

CHANGELOG.md

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,58 @@
11
# Changelog
22

3-
### 2.3.7 | 2022-11-23
3+
### 2.3.9 | 2024-01-19
4+
5+
- Fix archive extraction on Windows failing when run under Electron
6+
7+
### 2.3.8 | 2023-11-24
8+
9+
- Fix archive extraction on macOS and Linux sometimes failing
10+
11+
### 2.3.7 | 2023-11-23
412

513
- Remove detection for unsupported win32 builds
614
- Add length and hash validation for downloaded builds
715

8-
### 2.3.6 | 2022-10-24
16+
### 2.3.6 | 2023-10-24
917

1018
- Fix windows sometimes failing on EPERM in download (again)
1119

12-
### 2.3.5 | 2022-10-04
20+
### 2.3.5 | 2023-10-04
1321

1422
- Fix windows sometimes failing on EPERM in download
1523

16-
### 2.3.4 | 2022-07-31
24+
### 2.3.4 | 2023-07-31
1725

1826
- Fix "insiders" string not matching correctly
1927

20-
### 2.3.3 | 2022-06-10
28+
### 2.3.3 | 2023-06-10
2129

2230
- Disable GPU sandbox by default, fixing failures in some CI's.
2331

24-
### 2.3.2 | 2022-05-11
32+
### 2.3.2 | 2023-05-11
2533

2634
- Fix download method not working for the vscode cli.
2735

28-
### 2.3.1 | 2022-04-04
36+
### 2.3.1 | 2023-04-04
2937

3038
- Gracefully kill VS Code if SIGINT is received
3139

32-
### 2.3.0 | 2022-02-27
40+
### 2.3.0 | 2023-02-27
3341

3442
- Automatically use the most recent version matching `engines.vscode` in extensions' package.json
3543
- Allow insiders `version`s to be specified, such as `version: "1.76.0-insider"`
3644
- Reduce the likelihood of 'broken' installations on interrupted downloads
3745
- Remove dependency on outdated `unzipper` module
3846

39-
### 2.2.4 | 2022-02-19
47+
### 2.2.4 | 2023-02-19
4048

4149
- Use existing downloads if internet is inaccessible
4250

43-
### 2.2.3 | 2022-01-30
51+
### 2.2.3 | 2023-01-30
4452

4553
- Fix tests sometimes hanging on windows
4654

47-
### 2.2.2 | 2022-01-09
55+
### 2.2.2 | 2023-01-09
4856

4957
- Add default for platform in `resolveCliPathFromVSCodeExecutablePath` to match docs
5058

lib/download.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,13 @@ async function unzipVSCode(
305305
const [buffer, JSZip] = await Promise.all([streamToBuffer(stream), import('jszip')]);
306306
await checksum;
307307

308+
// Turn off Electron's special handling of .asar files, otherwise
309+
// extraction will fail when we try to extract node_modules.asar
310+
// under Electron's Node (i.e. in the test CLI invoked by an extension)
311+
// https://github.com/electron/packager/issues/875
312+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
313+
(process as any).noAsar = true;
314+
308315
const content = await JSZip.loadAsync(buffer);
309316
// extract file with jszip
310317
for (const filename of Object.keys(content.files)) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vscode/test-electron",
3-
"version": "2.3.8",
3+
"version": "2.3.9",
44
"scripts": {
55
"compile": "tsc -p ./",
66
"watch": "tsc -w -p ./",

0 commit comments

Comments
 (0)