Skip to content

Commit

Permalink
Merge pull request #256 from microsoft/connor4312/fix-windows-first-run
Browse files Browse the repository at this point in the history
fix: archive extraction on Windows failing when run under Electron
  • Loading branch information
connor4312 committed Jan 19, 2024
2 parents 92c0591 + fdb7ef9 commit bc400a2
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 12 deletions.
30 changes: 19 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,58 @@
# Changelog

### 2.3.7 | 2022-11-23
### 2.3.9 | 2024-01-19

- Fix archive extraction on Windows failing when run under Electron

### 2.3.8 | 2023-11-24

- Fix archive extraction on macOS and Linux sometimes failing

### 2.3.7 | 2023-11-23

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

### 2.3.6 | 2022-10-24
### 2.3.6 | 2023-10-24

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

### 2.3.5 | 2022-10-04
### 2.3.5 | 2023-10-04

- Fix windows sometimes failing on EPERM in download

### 2.3.4 | 2022-07-31
### 2.3.4 | 2023-07-31

- Fix "insiders" string not matching correctly

### 2.3.3 | 2022-06-10
### 2.3.3 | 2023-06-10

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

### 2.3.2 | 2022-05-11
### 2.3.2 | 2023-05-11

- Fix download method not working for the vscode cli.

### 2.3.1 | 2022-04-04
### 2.3.1 | 2023-04-04

- Gracefully kill VS Code if SIGINT is received

### 2.3.0 | 2022-02-27
### 2.3.0 | 2023-02-27

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

### 2.2.4 | 2022-02-19
### 2.2.4 | 2023-02-19

- Use existing downloads if internet is inaccessible

### 2.2.3 | 2022-01-30
### 2.2.3 | 2023-01-30

- Fix tests sometimes hanging on windows

### 2.2.2 | 2022-01-09
### 2.2.2 | 2023-01-09

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

Expand Down
7 changes: 7 additions & 0 deletions lib/download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,13 @@ async function unzipVSCode(
const [buffer, JSZip] = await Promise.all([streamToBuffer(stream), import('jszip')]);
await checksum;

// Turn off Electron's special handling of .asar files, otherwise
// extraction will fail when we try to extract node_modules.asar
// under Electron's Node (i.e. in the test CLI invoked by an extension)
// https://github.com/electron/packager/issues/875
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(process as any).noAsar = true;

const content = await JSZip.loadAsync(buffer);
// extract file with jszip
for (const filename of Object.keys(content.files)) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vscode/test-electron",
"version": "2.3.8",
"version": "2.3.9",
"scripts": {
"compile": "tsc -p ./",
"watch": "tsc -w -p ./",
Expand Down

0 comments on commit bc400a2

Please sign in to comment.