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

Error building appx #1559

Closed
black-snow opened this issue May 18, 2017 · 11 comments
Closed

Error building appx #1559

black-snow opened this issue May 18, 2017 · 11 comments

Comments

@black-snow
Copy link
Contributor

Hey @develar,

  • Version: 17.8.0
  • Target: win, appx

Last version I used for building appx was 11.something. Seems like the options "language" has changed.

This was my previous working build block:

{
  "appId": "...",
  "copyright": "...",
  "asar": true,
  "files": [
    "app/**/*",
    "node_modules/**/*",
    "package.json"
  ],
  "extraFiles": [
    "..."
  ],
  "win": {
    "target": [
      "appx"
    ],
    "publisher": "...",
    "backgroundColor": "transparent",
    "identityName": "...",
    "displayName": "...",
    "publisherDisplayName": "..."
  }
}

But running builder now throws:

"Invalid option object"
at xyz\node_modules\electron-builder\src\util\readPackageJson.ts:153:11

Complaining about the win part. I tried to understand the options wiki (which has changed drastically) but I don't seem to get it. It's become too nested, I think. Guess we should add some examples.

Please tell me how the config must look for building appx with the latest version of electron-builder.

Thanks

@develar
Copy link
Member

develar commented May 20, 2017

publisherDisplayName, displayName, identityName, backgroundColor and publisher must be in the appx.

@develar
Copy link
Member

develar commented May 20, 2017

@black-snow
Copy link
Contributor Author

black-snow commented May 20, 2017

Yes, I've seen that. Couldn't extract any useful information from it, though.

must be in the appx

appx is a string in my example. Should I wrap the params in an object with the index appx? Or shall target be an object with appx as a field? Gonna give both a try.

// edit: neither worked - could you give me an example?

@develar
Copy link
Member

develar commented May 20, 2017

"build": {
  "appx": {
    "publisherDisplayName": ""
  }
}

@develar
Copy link
Member

develar commented May 20, 2017

. Couldn't extract any useful information from it, though.

Could you please provide an example of useful/good docs?

@black-snow
Copy link
Contributor Author

Thanks for your quick reply (again).

That seemed to work .. at first. But then weird things happened ;)

Building NSIS installer
Packaging NSIS installer for arch ia32
Signing NSIS uninstaller (certificate file: "xyz.pfx")

Why would it build an NSIS installer if I told him to pack for appx? It then continues:

Signing xyz.exe (certificate file: "xyz.pfx")
Error: Exit code: 1. Command failed: C:\Users\xyz\AppData\Local\electron-builder\cache\winCodeSign\winCodeSign-1.7.0\windows-10\x64\signtool.exe sign /tr http://timestamp.comodoca.com/rfc3161 /f xyz.pfx /fd sha256 /td sha256 /d xxx /du http://example.org /as xyz\di
st\xyz.exe
SignTool Error: The file is being used by another process.
SignTool Error: An error occurred while attempting to sign: xyz\dist\xyzexe

Did it download and try to sign my ia32 app with a x64 singtool? Is that correct? And how come the file is being used by another process?

Should I open a new issue?


Concerning the docs: Dunno; liked the docs how they were ~half a year ago. Less segmented and with examples. Frankly, I don't quite know what to do with the json schema tool and I'm somewhat too lazy to read and understand the schema. It's like I had to learn japanese to read the manual of my car.

@black-snow black-snow changed the title Options format changed - don't see how to fix Error building appx May 22, 2017
@black-snow
Copy link
Contributor Author

black-snow commented May 23, 2017

Alright, I figured it out. I need both, config.win.target[0] = appx as well as config.appx.

Gonna close this for now.

Errored again.

Using electron-builder.json5 configuration file
No native production dependencies
Packaging for win32 ia32 using electron 1.6.8 to dist\win-ia32-unpacked
CSC_KEY_PASSWORD is not defined, empty password will be used
Signing xyz.exe (certificate file: "xyz/build/cert/xyz.pfx")
TypeError: A value [object Object] was yielded that could not be treated as a promise

 
    See http://goo.gl/MqrFmX
 
From coroutine:
    at Promise.coroutine (xyz\node_modules\bluebird\js\release\generators.js:194:17)
    at AppXTarget.build (xyz\node_modules\electron-builder\out\targets\appx.js:84:68)
    at postAsyncTasks.push.default.map.it (xyz\node_modules\electron-builder\src\platformPackager.ts:106:85)
    at tryCatcher (xyz\node_modules\bluebird\js\release\util.js:16:23)

I fear the transpiled ts/js is too much black magic for me to further investigate :| Th source is packageInDistributableFormat() inside platformPackager.ts.

// edit:
appx.ts:26

async build(appOutDir: string, arch: Arch): Promise<any> {

So build shall return a Promise but I don't see any return statement. Is the Promise implicitly returned in typescript or is this the source of evil?

// edit2:
Nailed it down to the very first yield in the transpiled targets/appx.js.

// edit3:
Changing the transpiled line (appx.js:88) from

if ((yield packager.cscInfo.) == null) {

to

if ((yield packager.cscInfo._value) == null) {

gets me past that step!

@black-snow
Copy link
Contributor Author

@develar Have you had time to look into this? Sadly, due to #1576 and me being bad in ts, I fear I cannot fix this myself.
From the simplicity of the fix I found in the transpiled code I'd guess that the fix shouldn't be hard.

@develar
Copy link
Member

develar commented May 29, 2017

Not yet. I will take a look tonight.

@black-snow
Copy link
Contributor Author

Thank you

@develar
Copy link
Member

develar commented May 30, 2017

@black-snow #1515

@develar develar closed this as completed May 30, 2017
@develar develar reopened this May 30, 2017
@develar develar closed this as completed May 30, 2017
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

No branches or pull requests

2 participants