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

Unable to build windows installer #56

Closed
mistermoe opened this issue Apr 2, 2016 · 15 comments
Closed

Unable to build windows installer #56

mistermoe opened this issue Apr 2, 2016 · 15 comments

Comments

@mistermoe
Copy link

development package.json has the following:

  "build": {
    "app-bundle-id": "com.datafiniti",
    "app-category-type": "public.app-category.visual-scraper",
    "iconUrl": "build/icon.ico"
  },

  "scripts": {
    "postinstall": "install-app-deps",
    "pack": "build --platform=all",
    "dist:win": "build --platform=win32"
  }

when running npm run dist:win i run into the following error:

Packaging app for platform win32 x64 using electron v0.37.3
Error: Failed with exit code: 1
Output:
Attempting to build package from 'SpiderSense.nuspec'.
Invalid URI: The URI scheme is not valid.

 at ChildProcess.<anonymous> (/SpiderSense/node_modules/electron-winstaller-fixed/lib/spawn-promise.js:59:16)
    at emitTwo (events.js:100:13)
    at ChildProcess.emit (events.js:185:7)
    at maybeClose (internal/child_process.js:850:16)
    at Socket.<anonymous> (internal/child_process.js:323:11)
    at emitOne (events.js:95:20)
    at Socket.emit (events.js:182:7)
    at Pipe._onclose (net.js:477:12)
From previous event:
    at tsAwaiter (/SpiderSense/node_modules/electron-builder/src/awaiter.ts:10:51)
    at Object.build (/SpiderSense/node_modules/electron-builder/src/builder.ts:30:59)
    at Object.<anonymous> (/SpiderSense/node_modules/electron-builder/src/build-cli.ts:41:2)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module.runMain (module.js:447:10)
    at startup (node.js:146:18)
    at node.js:404:3

Any ideas here?

i have mono version 4.2.3 and wine version 1.8.1. Let me know if you need any more information

@develar
Copy link
Contributor

develar commented Apr 2, 2016

Please set DEBUG env to electron-windows-installer:* to get debug log.

@mistermoe
Copy link
Author

thanks for the quick response. I'm running into this error through electron-builder.

so i just set up a test winstaller script:

"use strict";

var electronInstaller = require('electron-winstaller');

var resultPromise = electronInstaller.createWindowsInstaller({
    appDirectory: './app',
    outputDirectory: './test',
    authors: 'My App Inc.',
    exe: 'myapp.exe',
    description: 'test description'
  });

resultPromise.then(() => console.log("It worked!"), (e) => console.log(`No dice: ${e.message}`));

and then ran: DEBUG=electron-windows-installer:* node win_installer.js

and i run into the following:

electron-windows-installer:main Using Mono: '/usr/local/bin/mono' +0ms
electron-windows-installer:main Using Wine: '/usr/local/bin/wine' +0ms
No dice: Cannot read property 'description' of null

not too sure what description its referring to. I've got it defined in the object being passed to windowsInstaller as well as my app's package.json

@develar
Copy link
Contributor

develar commented Apr 2, 2016

I'm running into this error through electron-builder.
i just set up a test winstaller script:

electron-builder passes a lot of options, so, it will be better just to enable debug logging and then provide log here, without test script. I am sure that it is a electron-builder issue.

@develar
Copy link
Contributor

develar commented Apr 2, 2016

@havenchyk Please note — original issue about "Invalid URI: The URI scheme is not valid." I suspect that it is an electron-builder bug and want a debug log to see nuspec file.

@mistermoe
Copy link
Author

DEBUG=electron-windows-installer:* npm run dist:win

Packaging app for platform win32 x64 using electron v0.37.3
  electron-windows-installer:main mono +0ms
  electron-windows-installer:main /usr/local/lib/node_modules/npm/bin/node-gyp-bin/mono +10ms
  electron-windows-installer:main /Users/moeez/code/datafiniti/SpiderSense/node_modules/.bin/mono +2ms
  electron-windows-installer:main /usr/local/Cellar/node/5.10.0/bin/mono +1ms
  electron-windows-installer:main /Users/moeez/.gem/ruby/2.1.2/bin/mono +0ms
  electron-windows-installer:main /Users/moeez/.rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/bin/mono +1ms
  electron-windows-installer:main /Users/moeez/.rubies/ruby-2.1.2/bin/mono +1ms
  electron-windows-installer:main /opt/chefdk/bin/mono +1ms
  electron-windows-installer:main /usr/local/bin/mono +1ms
  electron-windows-installer:main wine +1ms
  electron-windows-installer:main /usr/local/lib/node_modules/npm/bin/node-gyp-bin/wine +1ms
  electron-windows-installer:main /Users/moeez/code/datafiniti/SpiderSense/node_modules/.bin/wine +1ms
  electron-windows-installer:main /usr/local/Cellar/node/5.10.0/bin/wine +0ms
  electron-windows-installer:main /Users/moeez/.gem/ruby/2.1.2/bin/wine +1ms
  electron-windows-installer:main /Users/moeez/.rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/bin/wine +1ms
  electron-windows-installer:main /Users/moeez/.rubies/ruby-2.1.2/bin/wine +1ms
  electron-windows-installer:main /opt/chefdk/bin/wine +1ms
  electron-windows-installer:main /usr/local/bin/wine +1ms
  electron-windows-installer:main Using Mono: '/usr/local/bin/mono' +0ms
  electron-windows-installer:main Using Wine: '/usr/local/bin/wine' +0ms
  electron-windows-installer:main Created NuSpec file:
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
  <metadata>
    <id>SpiderSense</id>
    <title>SpiderSense</title>
    <version>0.9.0</version>
    <authors>Datafiniti</authors>
    <owners>Datafiniti</owners>
    <iconUrl>build/icon.ico</iconUrl>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>Visual Scraper</description>
    <copyright>Copyright © 2016 Datafiniti</copyright>
  </metadata>
  <files>
    <file src="locales/**" target="lib\net45\locales" />
    <file src="resources/**" target="lib\net45\resources" />
    <file src="*.bin" target="lib\net45" />
    <file src="*.dll" target="lib\net45" />
    <file src="*.pak" target="lib\net45" />
    <file src="Update.exe" target="lib\net45\squirrel.exe" />
    <file src="icudtl.dat" target="lib\net45\icudtl.dat" />
    <file src="LICENSE" target="lib\net45\LICENSE" />
    <file src="SpiderSense.exe" target="lib\net45\SpiderSense.exe" />
  </files>
</package> +12ms
  electron-windows-installer:spawn Spawning /usr/local/bin/mono /Users/moeez/code/datafiniti/SpiderSense/node_modules/electron-winstaller-fixed/vendor/nuget.exe pack /var/folders/q2/r1brgq2131sf6556r39_5_km0000gn/T/si-11632-35541-z3v6d6/SpiderSense.nuspec -BasePath /Users/moeez/code/datafiniti/SpiderSense/dist/SpiderSense-win32-x64 -OutputDirectory /var/folders/q2/r1brgq2131sf6556r39_5_km0000gn/T/si-11632-35541-z3v6d6 -NoDefaultExcludes +4ms
Error: Failed with exit code: 1
Output:
Attempting to build package from 'SpiderSense.nuspec'.
Invalid URI: The URI scheme is not valid.

    at ChildProcess.<anonymous> (/Users/moeez/code/datafiniti/SpiderSense/node_modules/electron-winstaller-fixed/lib/spawn-promise.js:59:16)
    at emitTwo (events.js:100:13)
    at ChildProcess.emit (events.js:185:7)
    at maybeClose (internal/child_process.js:850:16)
    at Socket.<anonymous> (internal/child_process.js:323:11)
    at emitOne (events.js:95:20)
    at Socket.emit (events.js:182:7)
    at Pipe._onclose (net.js:477:12)
From previous event:
    at tsAwaiter (/Users/moeez/code/datafiniti/SpiderSense/node_modules/electron-builder/src/awaiter.ts:10:51)
    at Object.build (/Users/moeez/code/datafiniti/SpiderSense/node_modules/electron-builder/src/builder.ts:30:59)
    at Object.<anonymous> (/Users/moeez/code/datafiniti/SpiderSense/node_modules/electron-builder/src/build-cli.ts:41:2)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module.runMain (module.js:447:10)
    at startup (node.js:146:18)
    at node.js:404:3

@mistermoe
Copy link
Author

do the src attributes of the file XML Elements require a more specific path?

for example:

 <file src="resources/**" target="lib\net45\resources" />

does src need to be ./path/to/packaged-win32-x64/resources/* or does the script that attempts to build the package from xxxx.nuspec run with ./path/to/packaged-win32-x64/ as it's current working directory?

@develar
Copy link
Contributor

develar commented Apr 2, 2016

Bingo — iconUrl must be an URL. https://github.com/electron-userland/electron-builder/blob/master/docs/options.md#user-content-#BuildMetadata-iconUrl

@mistermoe
Copy link
Author

ah! stupid mistake on my part. sorry about that. Thanks!

@develar
Copy link
Contributor

develar commented Apr 2, 2016

@mistermoe Well, it is not your stupid mistake, but *** windows design issue :( electron-archive/grunt-electron-installer#73 mentioned in the docs and I hope it will be fixed someday.

@lukeapage
Copy link
Contributor

This is hitting loads of people
#29

@havenchyk
Copy link
Contributor

Maybe it makes sense to throw an exception and prevent handling on the start?

@lukeapage
Copy link
Contributor

Good idea ;)

@develar
Copy link
Contributor

develar commented Apr 3, 2016

@havenchyk electron-builder already check setupIcon (because windows *** tools throw unclear cryptic messages) and iconUrl check will be also checked.

@develar
Copy link
Contributor

develar commented Apr 3, 2016

NuGet issue — NuGet/Home#352

@MarshallOfSound
Copy link
Member

This issue appears to have been resolved in this thread, iconUrl must be a URL (think http / https)

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

5 participants