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

Windows Installer Hanging on Mono Command #55

Closed
danlopez opened this issue Apr 1, 2016 · 42 comments
Closed

Windows Installer Hanging on Mono Command #55

danlopez opened this issue Apr 1, 2016 · 42 comments

Comments

@danlopez
Copy link

danlopez commented Apr 1, 2016

I'm using windows-installer through electron-builder. My installation appears to be hanging at the step seen in https://github.com/electron/windows-installer/blob/master/src/index.js#L151. I'm running windows-installer with the debug flag, and I very quickly get to the output for 'Created NuSpec file'.

Running ps | grep mono, I see that the mono pack command continues to run indefinitely (At the time of writing this, it's been going for over 10 minutes). Any ideas what might be causing this? I'm running this on a mac and have installed mono using brew. Mono version is 4.2.0.

@develar
Copy link
Contributor

develar commented Apr 1, 2016

Please try update mono (develar-home-imac:electron-builder develar$ mono --version Mono JIT compiler version 4.2.3 (Stable 4.2.3.4/832de4b Wed Mar 30 13:57:48 PDT 2016) ).

@develar
Copy link
Contributor

develar commented Apr 1, 2016

brew update && brew upgrade

@danlopez
Copy link
Author

danlopez commented Apr 1, 2016

Still hanging with:

Mono JIT compiler version 4.2.3 (Stable 4.2.3.4/832de4b Wed Mar 30 13:57:48 PDT 2016)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
    TLS:           normal
    SIGSEGV:       altstack
    Notification:  kqueue
    Architecture:  amd64
    Disabled:      none
    Misc:          softdebug
    LLVM:          supported, not enabled.
    GC:            sgen

@develar
Copy link
Contributor

develar commented Apr 1, 2016

Is your app config is simple? Or custom? Please specify CPU and RAM of your Mac (well... on slow machine it can took 15 minutes...)

@danlopez
Copy link
Author

danlopez commented Apr 1, 2016

Interesting, I'll let it run for a while longer and see what happens. It's a Late 2013 Macbook Pro with 2.4 GHz i5 and 8GB Ram.

As for the app config, it's pretty simple - the mac installer from electron-builder runs in about 30 seconds.

@danlopez
Copy link
Author

danlopez commented Apr 1, 2016

If it's helpful, I'm running electron builder with the following command:

DEBUG=electron-windows-installer:main build -- --platform win32 --arch ia32 --dist --appDir ./build/app

@develar
Copy link
Contributor

develar commented Apr 1, 2016

Why app (do you use two-package json project structure?) is located under build directory (./build/app)?

@danlopez
Copy link
Author

danlopez commented Apr 1, 2016

I'm using two package.json project structure - Here's where the config is a bit fancy - although again, everything here worked with my dmg installed.

I do have a src/app directory, but I'm building everything there with webpack into a single bundle.js file. In build/app, I'm symlinking node_modules, my entry point (app.html), my electron entry (main.js), and package.json. I'm then including bundle.js there directly.

I'll give it a try using my app directory itself, though, and let you know if that works for me. I'm also going to try to let the mono command run for a while now that it's been updated. How long does it take on a quick machine?

@develar
Copy link
Contributor

develar commented Apr 1, 2016

I'll give it a try using my app directory itself, though, and let you know if that works for me

It seems that your setup is correct. Please provide full debug log (including nuspec template).

How long does it take on a quick machine?

It takes 20 secs on my iMac (Retina 5K, 27-inch, Late 2015), on your Late 2013 Macbook Pro it should take < 2 minutes.

New version of electron-builder will be in a few hours. Maybe it will help.

@danlopez
Copy link
Author

danlopez commented Apr 1, 2016

electron-windows-installer:main mono +0ms
electron-windows-installer:main /usr/local/lib/node_modules/npm/bin/node-gyp-bin/mono +8ms
electron-windows-installer:main /Users/danlopez/Documents/testapp/node_modules/.bin/mono +3ms
electron-windows-installer:main /usr/local/sbin/mono +1ms
electron-windows-installer:main /Users/danlopez/.rvm/gems/ruby-2.0.0-p0/bin/mono +0ms
electron-windows-installer:main /Users/danlopez/.rvm/gems/ruby-2.0.0-p0@global/bin/mono +1ms
electron-windows-installer:main /Users/danlopez/.rvm/rubies/ruby-2.0.0-p0/bin/mono +0ms
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/danlopez/Documents/testapp/node_modules/.bin/wine +1ms
electron-windows-installer:main /usr/local/sbin/wine +0ms
electron-windows-installer:main /Users/danlopez/.rvm/gems/ruby-2.0.0-p0/bin/wine +1ms
electron-windows-installer:main /Users/danlopez/.rvm/gems/ruby-2.0.0-p0@global/bin/wine +0ms
electron-windows-installer:main /Users/danlopez/.rvm/rubies/ruby-2.0.0-p0/bin/wine +1ms
electron-windows-installer:main /usr/local/bin/wine +0ms
electron-windows-installer:main Using Mono: '/usr/local/bin/mono' +1ms
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>an-desktop-app</id>
  <title>TestApp</title>
  <version>0.0.1</version>
  <authors>TestApp</authors>
  <owners>TestApp</owners>
  <iconUrl>https://raw.githubusercontent.com/testapp/testapp/master/build/icon.ico</iconUrl>
  <requireLicenseAcceptance>false</requireLicenseAcceptance>
  <description>[object Object]</description>
  <copyright>Copyright © 2016 TestApp</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="TestApp.exe" target="lib\net45\TestApp.exe" />
</files>
</package> +10ms

@develar
Copy link
Contributor

develar commented Apr 1, 2016

Just to be sure: wine --version?

@danlopez
Copy link
Author

danlopez commented Apr 1, 2016

wine-1.8.1

@develar
Copy link
Contributor

develar commented Apr 1, 2016

Please try 3.1.2 (will be published in 5 minutes). If still hangs, is it possible to send me a project?

@danlopez
Copy link
Author

danlopez commented Apr 2, 2016

No luck. Perhaps related to NuGet/Home#348?

@danlopez
Copy link
Author

danlopez commented Apr 2, 2016

Okay, running for 25 min:

  electron-windows-installer:main Attempting to build package from 'an-desktop-app.nuspec'.
Successfully created package '/var/folders/f5/2h68_f7521xg7vwdj0z_tqz00000gn/T/si-11632-35896-hlecsm/an-desktop-app.0.0.1.nupkg'.
 +16m
  electron-windows-installer:main fixme:heap:RtlSetHeapInformation 0x0 1 0x0 0 stub
 +10m

Additionally, I ran the mono command independently and that appeared to successfully create a nupkg (after about 17 minutes)...

@develar
Copy link
Contributor

develar commented Apr 2, 2016

@paulcbetts Why we use nuget 2.x if nuget 3 is available?

@develar
Copy link
Contributor

develar commented Apr 2, 2016

@danlopez Try to grab latest nuget.exe 3.4.0-rc (https://dist.nuget.org/win-x86-commandline/v3.4.0-rc/nuget.exe) and replace existing in the node_modules/electron-winstaller-fixed/vendor/nuget.exe.

electron-builder tests passed, so, I don't understand why 2 is used if 3 is available. I hope @kevinsawicki or @paulcbetts shed light on this.

@develar
Copy link
Contributor

develar commented Apr 2, 2016

@danlopez electron-winstaller-fixed 2.0.6-beta.6 published, please try npm update and build.

@anaisbetts
Copy link
Contributor

@develar NuGet 3.x is broken and weird

@develar
Copy link
Contributor

develar commented Apr 3, 2016

@paulcbetts Tests passed and application runs. Could you please clarify? I read http://praeclarum.org/post/128347388533/my-complaints-with-nuget-3 and did not understand. Maybe it is related to NET world, but to pack electron app is ok (if NuGet will pack faster than 2.x)?

Or do you mean that Squirrel.Windows supports only 2.x packages?

@anaisbetts
Copy link
Contributor

Or do you mean that Squirrel.Windows supports only 2.x packages?

Squirrel itself embeds a fork of NuGet 2.x, but actually doesn't use it to unzip packages because it's too slow. I'm not excited to change this aspect of Squirrel, we'll probably move to some other distribution format tbh because for example, 7zip is cross-platform and compresses Electron to 1/2 the size.

If you want to upgrade the vendored nuget.exe in this project it's probably fine, but I doubt that this will solve OPs problem, and In General, above is why we're only using 2.x vs 3.x

@develar
Copy link
Contributor

develar commented Apr 3, 2016

@paulcbetts Thanks for explanation.

we'll probably move to some other distribution format tbh because for example, 7zip is cross-platform and compresses Electron to 1/2 the size.

Yeah... That will be cool. Squirrel.mac uses ZIP and doesn't require additional slow tool. BTW, to compress Linux DEB we use xz and it provides the best compression.

I will also try to use Octo instead of NuGet.

@danlopez
Copy link
Author

danlopez commented Apr 4, 2016

@develar - no luck with the beta release. I haven't tried to use the 3.x release, but I can give that a shot as well. It sounds like Octo also may be a decent substitute. Do you have a command you've been running in octo for this?

@develar
Copy link
Contributor

develar commented Apr 4, 2016

@danlopez electron-winstaller-fixed 2.0.6-beta.6 includes nuget 3.x. Please set env DEBUG=electron-windows-installer:* and run dist. Attach here debug log (debug log includes timestamps).

@develar
Copy link
Contributor

develar commented Apr 4, 2016

Do you have a command you've been running in octo for this

No. I am going to get rid of NuGet and zip files directly. It is possible to create nupkg file without additional tools, so, I think it will be a solution (but again — debug log is required, please provide it).

@danlopez
Copy link
Author

danlopez commented Apr 5, 2016

@develar - sorry for the delay. Here's what happens the latest run. I'm omitting the earlier part of the log, but let me know if it's useful.

Successfully created package '/var/folders/f5/2h68_f7521xg7vwdj0z_tqz00000gn/T/si-11635-21361-y420y7/an-desktop-app.0.0.1.nupkg'.
  electron-windows-installer:spawn Spawning /usr/local/bin/mono /Users/danlopez/Documents/ApprenNet/an-desktop-app/node_modules/electron-builder/node_modules/electron-winstaller-fixed/vendor/Update-Mono.exe --releasify /var/folders/f5/2h68_f7521xg7vwdj0z_tqz00000gn/T/si-11635-21361-y420y7/an-desktop-app.0.0.1.nupkg --releaseDir /Users/danlopez/Documents/ApprenNet/an-desktop-app/dist/win --loadingGif /Users/danlopez/Documents/ApprenNet/an-desktop-app/node_modules/electron-builder/node_modules/electron-winstaller-fixed/resources/install-spinner.gif --setupIcon /Users/danlopez/Documents/ApprenNet/an-desktop-app/build/icon.ico --no-msi +19s
fixme:heap:RtlSetHeapInformation 0x0 1 0x0 0 stub

@danlopez
Copy link
Author

danlopez commented Apr 5, 2016

^^ This was using an asar archive following a comment about Windows path lengths that I read elsewhere. Looks to be an improvement, but still failing, as you can see.

@develar
Copy link
Contributor

develar commented Apr 5, 2016

@danlopez I see that Squirrel.windows is not an issue (19 seconds). As expected, it seems, it is nuget pack issue.

I am sure that part of the log doesn't contain important information — nuspec, spawn of nuget. Please provide full log (you can send by email if you don't want to share it here).

but still failing, as you can see.

path of the log doesn't show error. And this issue about slow (10 minutes) nuget pack, right?

@danlopez
Copy link
Author

danlopez commented Apr 5, 2016

@develar - I removed and reinstalled all of my node_modules (which includes the electron-winstaller-fixed 2.0.6-beta.7 dependency of electron-builder) and the runtime no longer became an issue - it's getting through Squirrel.windows just fine. It's actually failing at the last line of the log (fixme:heap:RtlSetHeapInformation 0x0 1 0x0 0 stub) - after the command that uses Update-Mono.exe.

Looks like it's getting closer...

@develar
Copy link
Contributor

develar commented Apr 5, 2016

fixme:heap:RtlSetHeapInformation 0x0 1 0x0 0 stub means nothing. It is ok.

@danlopez
Copy link
Author

danlopez commented Apr 5, 2016

Yup - you're right. it looks like that run actually produced an Installer. Testing it now, but I'm going to close this - it's definitely gotten past the hanging mono.

I'm not sure what fixed it, but it could be one of the following:

  1. Using asar=true
  2. Clearing and reinstalling all dependencies.
  3. windows-installer updates.

@develar - thanks so much for your help getting through this!

@danlopez danlopez closed this as completed Apr 5, 2016
@develar
Copy link
Contributor

develar commented Apr 5, 2016

Using asar=true

electron-builder does the best for you and this option is enabled by default.

windows-installer updates

It will be cool if you remove node_modules/electron-winstaller-fixed and install old version npm install electron-winstaller-fixed 2.0.6-beta.5 and build again to see — will be it slow or not.

@danlopez
Copy link
Author

danlopez commented Apr 5, 2016

No problem. Will give that a try and let you know.

@develar
Copy link
Contributor

develar commented Apr 19, 2016

In the next electron-builder release it is fixed — we don't use nuget to pack anymore. 4x-8x speedup. PR to windows-installer will be this/next week.

@Expert0126
Copy link

I am going to create installer electron app following https://www.youtube.com/watch?v=IuYFDwPKE3c.
But I have some errors.

Tiger@DESKTOP-JMF3JE8 MINGW64 ~/Desktop/workspace/electron
$ node build.js
Well, sometimes you are not so lucky: Failed with exit code: 1
Output:
Attempting to build package from 'electron_quick_start.nuspec'.
Description is required.

@Nowaker
Copy link

Nowaker commented Aug 2, 2017

So sad to see the PR #77 from @develar closed. Our Mono builds are extremely slow. 32 minutes and counting. Not sure how long it will even take.

@develar
Copy link
Contributor

develar commented Aug 3, 2017

@Nowaker Just use electron-builder.

@Nowaker
Copy link

Nowaker commented Aug 3, 2017

@develar What do you mean? Or... why? electron-builder builds Windows binaries, then electron-winstaller does a one-click installer of it... or I'm missing something? Thanks.

@develar
Copy link
Contributor

develar commented Aug 3, 2017

@Nowaker electron-builder can build for or Squirrel.Windows (not recommended), or nsis installer (default target). electron-builder doesn't use nuget to produce Squirrel.Windows installer.

@Nowaker
Copy link

Nowaker commented Aug 3, 2017

@develar Thanks. I've had a look and looks impressive. (FYI - I was asked by a colleague to help them with making their builds automated on CI, and that's how they did it - electron-builder + electron-winstaller, now I'm wondering why)

@hyunchel
Copy link

hyunchel commented Sep 5, 2017

Before using electron-builder, I tried with --asar=true when building the package, and the installer ran fine.

@dereklieu
Copy link

FWIW, I also had to set asar:true when building with electron-packager for this to work. The whole thing took about a minute. When set to false, it hung for about an hour before I stopped it.

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

7 participants