electron / electron/forge

Issue with zip archive created on Windows but extracted on Linux

Open
#3,095 6 comments 0 reactions 0 assignees View on GitHub
blocked/upstream maker/zip platform/windows
Dominant language
TypeScript
Stars
7.1k
Forks
641
Avg merge
3d 1h
Merged PRs (30d)
30

Description

### Pre-flight checklist

- [X] I have read the [contribution documentation](https://github.com/electron/forge/blob/main/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [code of conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project uses.
- [X] I have searched the issue tracker for a bug that matches the one I want to file, without success.

### Electron Forge version

6.0.3

### Electron version

20.1.4

### Operating system

Windows 10 (22H2)

### Last known working Electron Forge version

_No response_

### Expected behavior

Subdirectories and files in subdirectories should be encoded with forward slashes instead of backward slashes in their path of the zip file entry.

### Actual behavior

Hello,

I'm running the following command on my Windows machine :

electron-forge make --platform=linux --arch=x64

Which outputs a zip archive. When uncompressing the zip archive on a linux environment, every item which is supposed to be in a subfolder is instead uncompressed flat in the root of the directory, with the subdirectories in the filename.

![image](https://user-images.githubusercontent.com/66371038/203936581-42447390-e6a7-4919-a681-a0d261efc0b8.png)

![image](https://user-images.githubusercontent.com/66371038/203936651-07e5b889-a792-4278-9ba6-dcd09e5d33a7.png)

No problem when uncompressing the archive on Windows.

The problem seem to be in the way that the entries are added to the zip archive. When created on Windows, the zip archive is encoded with backward slashes for items in subdirectories. When creating the same zip archive with 7-zip on Windows, items are properly encoded with forward slashes in their path.

Thanks, have a nice day

Antony

### Steps to reproduce

- Run the following command on your Windows machine: electron-forge make --platform=linux --arch=x64
- Try to open the generated zip archive on your Linux machine: you should see everything flat with no subdirectories

### Additional information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.