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

run long time #189

Open
ibullet-chzn opened this issue Jul 5, 2017 · 28 comments
Open

run long time #189

ibullet-chzn opened this issue Jul 5, 2017 · 28 comments

Comments

@ibullet-chzn
Copy link

hello,
Executed more than 30 minutes according to the document,
There is no finished result, and there is no wrong information.

@Fudoshiki
Copy link

same, electon 1.7.4.beta

@jamesjessian
Copy link

Yeah, I'm currently running it for the first time and it has taken about 15 minutes so far. Did it ever finish for you? i.e. is it stuck in a loop or just takes a long time?
Out of interest, did you package your application with electron-packager and the --no-prune option? I'm wondering if that's why mine is taking so long.

@LinoleumKnife
Copy link

LinoleumKnife commented Jul 18, 2017

Same. My debug output

  electron-windows-installer:main Using Mono: 'mono' +0ms
  electron-windows-installer:main Using Wine: 'wine' +3ms
  electron-windows-installer:main Created NuSpec file:
  electron-windows-installer:main <?xml version="1.0" encoding="utf-8"?>
  ............ package information ......
  electron-windows-installer:main </package>
  electron-windows-installer:main  +36ms

Just hangs afterwards.

Edit: I am seeing similar results when running on Windows 10.

@spalenza
Copy link

spalenza commented Jul 27, 2017

Same problem with node v7.4.0, electron 1.6.11, mono 5.0.1.1 and wine 2.0.2 in OSX El Capitan 10.11.6.

I am using the simple script to create installator.

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

resultPromise = electronInstaller.createWindowsInstaller({
    appDirectory: './smart-body',
    outputDirectory: './',
    authors: 'Smart Fit',
    exe: 'smart-body.exe'
  });

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

@EFF
Copy link

EFF commented Aug 4, 2017

Someone got something working here ? Process seems to hang for ages on a mono sgen command ..

@jamesjessian
Copy link

Personally I make sure that node_modules is excluded from my package, and therefore excluded from the installer. This seems to improve the time it takes.
So these are the two scripts I have in my package:

    "package:app": "electron-packager . --version-string.ProductName=\"MyAppName\" --platform=win32 --arch=x64 --out=release/package --overwrite --ignore=\"/(release|node_modules)\" ",
    "package:installer": "cross-env DEBUG=electron-windows-installer:main node ./createWindowsInstaller.js",
    "package": "npm run build && npm run package:app && npm run package:installer"

... the --ignore=\"/(release|node_modules)\" being the important bit. This excludes the node_modules directory and also the directory that my releases are getting built into.

It takes about 10 seconds for electron-packager and 2m16s for the electron-winstaller now.

@MarshallOfSound
Copy link
Member

@bishbashbosh123 Excluding node_modules is a bad idea in general, any dependency you declare will be installed there. Without that folder 99.99% of apps won't work

@lukeapage
Copy link
Contributor

I use Rollup, then delete node_modules, makes a big difference.

@jamesjessian
Copy link

Yes, I should clarify... I am using webpack so all web app dependencies are bundled up, so I don't have any runtime dependencies in my package.json, only dev-dependencies and therefore can get away without having node_modules. In fact, I shouldn't need to ignore node_modules because electron packager runs npm prune --production as part of its process anyway. But there is currently a bug with it in npm 5.3.0 (npm/npm#17781)
Even with npm 5.2.0 I still get left with a node_modules/.cache directory after the prune for some reason.

@chukkwagon
Copy link

chukkwagon commented Nov 30, 2017

@lukeapage can i ask what your setup is for rollup? I'm having a heck of a time getting it to work with my local js other than src/main.js (config file, logger file, auth modules, etc.). It's pulling in all of my npm dependecies just fine, but my local modules aren't being picked up for some reason.

@bishbashbosh123 are you using webpack for your node modules too? Would you mind sharing your webpack config?

I've had the same problem with building the windows exe. It builds the NuSpec file and then just hangs forever. I am on Ubuntu 17.04 using node 8.9.1.

Console Output

⠋ Making for target: squirrel - On platform: win32 - For arch: x64  electron-windows-installer:main Using Mono: 'mono' +0ms
  electron-windows-installer:main Using Wine: 'wine' +1ms
  electron-windows-installer:main Created NuSpec file:
  electron-windows-installer:main <?xml version="1.0" encoding="utf-8"?>
  electron-windows-installer:main <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<...... package data ....>
  electron-windows-installer:main </package>
  electron-windows-installer:main  +17ms

@dscalzi
Copy link

dscalzi commented Jan 10, 2018

Same issue, seems to not finish.

Edit: Found the issue, was hard to find since no errors are displayed by this module...
The output path was malformed, once the issue was fixed the module ran in a more timely manor.

@lukeapage
Copy link
Contributor

It took a bit of fiddling around and debugging. the biggest issue was node modules with circular dependencies - I had to exclude those.

@georgemcg
Copy link

georgemcg commented Feb 26, 2018

For me, if I add the flag: "asar": true to electronPackagerConfig (if you're using forge, don't know otherwise) then it finishes in a couple of minutes, down from an hour.

This old issue helped: #55

@madhuni
Copy link

madhuni commented Sep 1, 2018

Hi All....can anybody please tell what it the final solution or workaround for this problem? I am facing the same issue. The script keeps on running without any output. For me, the script was never completed and I manually aborted the script in progress.

@alexanderturinske
Copy link
Contributor

I would try putting console logs throughout this module to get more information on what is causing the issue.

@indianazhao
Copy link

After I install Wine on my Macbook, I have to restart Mac. Or it will get stuck when I try to build the exe for Windows.

@marcelo-franco
Copy link

Same behavior here, as described by madhuni.
The script runs forever on my Windows 10 machine. I have to manually abort it.

@marcelo-franco
Copy link

In my case, the script was running forever without any message (even with DEBUG environment variable) because of back slashes in the value of appDirectory and outputDirectory properties.
Using slashes ("/") makes it work.

@SirBryan
Copy link

In my case, when running it as electron-forge make --platform win32 it hung for a while opening wine, then when running mono. Using the "asar":true option mentioned above helped.

Later it turned out it was having issues with a space in name of one of the directories in the output path.

@Dammmien
Copy link

Same for me, packaging with "asar": true solve the issue !

@kaunglvlv
Copy link

This happened several months ago for us. The code signing takes forever!

@sohelsd
Copy link

sohelsd commented Sep 5, 2019

Has there been a solve for this? I am going through same issue where it just takes forever (and never completes) the installer creation. I tried with both asar set to true and false when creating package using electron-packager
Here's the simple snippet I am trying to run:

var electronInstaller = require('electron-winstaller');
var settings = {
    appDirectory: './release-builds/NewApp-win32-ia32',
    outputDirectory: './NewApp-installers',
    authors: "Test",
};

resultPromise = electronInstaller.createWindowsInstaller(settings);
resultPromise.then(() => {
    console.log("The installers of your application were succesfully created !");
}, (e) => {
    console.log('Well, sometimes you are not so lucky: ${e.message}')
});

Anything else I should try?

@kaunglvlv
Copy link

I just realized that my comment was not suited for this repo. Just in case this is a similar issue, here's what we did for ours.

We're using Squirrel.Windows to package our WinApp but the code signing took forever on our AppVeyor instance. The reason being is because it's doing a round trip on each file we're shipping and we have a lot of files.

Solution: We ended up importing our cert on the AppVeyor instance to prevent the round trip. Now our builds are running much faster.

@ms-dosx86
Copy link

I use simple example from the docs https://github.com/electron/windows-installer#usage and it takes about 10 minutes on my Ryzen 5 1600

@psamim
Copy link

psamim commented Sep 4, 2020

I am having the same problem using electron-forge. I tried asar; true but got no result.

@codemile
Copy link

codemile commented Jul 2, 2021

I've been unable to build Windows 10 and "asar": true didn't help.

I tried to enable debug to see more outputs, but this had no effect?

  "scripts": {
    "make": "cross-env DEBUG=true electron-forge make"
  },

Can someone explain to me how to enable debug mode?

@sanishtj
Copy link

It worked for me. I am using Node 18 and "asar": true. I was getting a missing LICENSE error, and adding a LICENSE file solved that.


const electronInstaller = require("electron-winstaller");

// NB: Use this syntax within an async function, Node does not have support for
//     top-level await as of Node 12.
const install = async () => {
  try {
    await electronInstaller.createWindowsInstaller({
      appDirectory: "./dist/win-unpacked",
      outputDirectory: "./installer64",
      authors: "Health Record Stack",
      exe: "electrontest.exe",
    });
    console.log("It worked!");
  } catch (e) {
    console.log(`No dice: ${e.message}`);
  }
};

install();

@rlf89
Copy link

rlf89 commented Feb 16, 2024

I was stuck with that all day. End up wiping it all and using electron-forge. It set the right settings for electron-windows-installer

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