electron / electron/windows-installer

Cannot create an installer with electron-winstaller: “Stream was too long”

Open
#308 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.6k
Forks
267
Avg merge
5h 38m
Merged PRs (30d)
1

Description

I've been trying to create a Windows installer for my Electron application with the electron-winstaller module by running the following code:

```javascript
const createWindowsInstaller = require('electron-winstaller').createWindowsInstaller
const path = require('path')

getInstallerConfig()
.then(createWindowsInstaller)
.catch((error) => {
console.error(error.message || error)
process.exit(1)
})

function getInstallerConfig () {
const installerPath = path.join('.');
const releaseBuildsPath = path.join('..', '..', 'release-builds');
const assetsPath = path.join('..', '..', 'assets');

return Promise.resolve({
appDirectory: path.join(releaseBuildsPath, '[application name]-win32-x64'),
authors: '[my name]',
noMsi: true,
outputDirectory: installerPath,
exe: '[application name].exe',
setupExe: '[application name].exe',
setupIcon: path.join(assetsPath, 'demo.ico'),
})
}
```
However, I keep getting the following error:
```
Failed with exit code: 1
Output:
Attempting to build package from '[application name].nuspec'.
lib/net45/resources/app.asar
Stream was too long.
```
The script I ran to create the windows package is this:
```
electron-packager . [application name] --overwrite --asar --platform=win32 --arch=x64 --icon=assets/demo.ico --prune=true --out=release-builds
```
With the `asar` option enabled and the `prune` flag set to true, I don't see any other options for reducing the size of the app.asar file, which supposedly is too large and causing this issue.

I also don't quite understand where the lib/net45/resources/app.asar file shown in the above error message is located; there is no directory named "lib" or "net45" on my system (macOS Mojave).

Here is the detailed result of running the script with the debugging output enabled:

```
electron-windows-installer:main Using Mono: 'mono' +0ms
electron-windows-installer:main Using Wine: 'wine' +2ms
electron-windows-installer:main Created NuSpec file:
electron-windows-installer:main
electron-windows-installer:main
electron-windows-installer:main
electron-windows-installer:main [application name]
electron-windows-installer:main [application name]
electron-windows-installer:main 1.0.0
electron-windows-installer:main tg
electron-windows-installer:main tg
electron-windows-installer:main https://raw.githubusercontent.com/atom/electron/master/atom/browser/resources/win/atom.ico
electron-windows-installer:main false
electron-windows-installer:main A desktop vocabulary builder app
electron-windows-installer:main Copyright © 2019 tg
electron-windows-installer:main
electron-windows-installer:main
electron-windows-installer:main
electron-windows-installer:main
electron-windows-installer:main
electron-windows-installer:main
electron-windows-installer:main
electron-windows-installer:main
electron-windows-installer:main
electron-windows-installer:main
electron-windows-installer:main
electron-windows-installer:main
electron-windows-installer:main
electron-windows-installer:main
electron-windows-installer:main
electron-windows-installer:main +7s
Failed with exit code: 1
Output:
Attempting to build package from '[application name].nuspec'.
lib/net45/resources/app.asar
Stream was too long.
```
Any suggestion will be greatly appreciated.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.