Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some files in app.asar get corrupted #662

Closed
pmoleri opened this issue Aug 10, 2016 · 4 comments · May be fixed by qcif/data-curator#563
Closed

Some files in app.asar get corrupted #662

pmoleri opened this issue Aug 10, 2016 · 4 comments · May be fixed by qcif/data-curator#563

Comments

@pmoleri
Copy link

pmoleri commented Aug 10, 2016

electron-builder v5.24.0 (it doesn't happen in 5.16.0)
Target: windows

The built app fails during startup page loading due a corrupted dependency in the app.asar file.

Steps:

  • create a new project with this package.json
{
  "name": "test",
  "version": "1.0.0",
  "description": "test",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "build": {
    "appId": "your.id",
    "category": "your.app.category.type",
    "icon": "icon.ico",
    "iconUrl": "https://github.com/favicon.ico"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "debug": "^2.2.0",
    "edge-cs": "^1.0.0"
  },
  "devDependencies": {
    "electron": ""^1.3.3",
    "electron-builder": "^5.24.0"
  }
}
  • Add required files:
    • icon.ico (at least 256x256)
    • index.js (can be empty)
  • Exec:
npm install
node_modules/electron-builder/out/build-cli.js
cd dist/win-unpacked/resources
asar extract app.asar app.asar.extracted
  • Open app.asar.extracted/node_modules/debug/package.json
    This file and others in the same package are corrupted.

I think the problem may have something to do with having modules with "executable code":

node_modules\edge-cs is not packed into asar archive - contains executable code
node_modules\electron is not packed into asar archive - contains executable code

@develar
Copy link
Member

develar commented Aug 10, 2016

electron must be in the devDependencies.

@pmoleri
Copy link
Author

pmoleri commented Aug 10, 2016

Thanks @develar , I corrected the package.json, still it doesn't seem to be the root of the problem as I have another dependency with "executable code".

@develar
Copy link
Member

develar commented Aug 10, 2016

@pmoleri Thanks a lot for STR, reproduced.

@pmoleri
Copy link
Author

pmoleri commented Aug 10, 2016

Wow, that was quick! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants