windows-installer icon indicating copy to clipboard operation
windows-installer copied to clipboard

run long time

Open ibullet-chzn opened this issue 7 years ago • 28 comments

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

ibullet-chzn avatar Jul 05 '17 12:07 ibullet-chzn

same, electon 1.7.4.beta

Fudoshiki avatar Jul 12 '17 23:07 Fudoshiki

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.

jamesjessian avatar Jul 17 '17 15:07 jamesjessian

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.

LinoleumKnife avatar Jul 18 '17 19:07 LinoleumKnife

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}`));

spalenza avatar Jul 27 '17 16:07 spalenza

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

EFF avatar Aug 04 '17 15:08 EFF

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.

jamesjessian avatar Aug 18 '17 17:08 jamesjessian

@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

MarshallOfSound avatar Aug 18 '17 17:08 MarshallOfSound

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

lukeapage avatar Aug 18 '17 19:08 lukeapage

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 (https://github.com/npm/npm/issues/17781) Even with npm 5.2.0 I still get left with a node_modules/.cache directory after the prune for some reason.

jamesjessian avatar Aug 18 '17 20:08 jamesjessian

@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

chukkwagon avatar Nov 30 '17 14:11 chukkwagon

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.

dscalzi avatar Jan 10 '18 10:01 dscalzi

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

lukeapage avatar Jan 11 '18 06:01 lukeapage

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: https://github.com/electron/windows-installer/issues/55

georgemcg avatar Feb 26 '18 15:02 georgemcg

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.

madhuni avatar Sep 01 '18 15:09 madhuni

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

alexanderturinske avatar Sep 01 '18 23:09 alexanderturinske

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.

indianazhao avatar Sep 01 '18 23:09 indianazhao

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

marcelo-franco avatar Sep 08 '18 14:09 marcelo-franco

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.

marcelo-franco avatar Sep 08 '18 16:09 marcelo-franco

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.

SirBryan avatar Nov 27 '18 21:11 SirBryan

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

Dammmien avatar Dec 13 '18 12:12 Dammmien

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

kaunglvlv avatar Feb 02 '19 01:02 kaunglvlv

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?

sohelsd avatar Sep 05 '19 17:09 sohelsd

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.

kaunglvlv avatar Sep 05 '19 22:09 kaunglvlv

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

ms-dosx86 avatar Jun 29 '20 08:06 ms-dosx86

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

psamim avatar Sep 04 '20 14:09 psamim

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?

codemile avatar Jul 02 '21 13:07 codemile

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();

sanishtj avatar Oct 20 '22 03:10 sanishtj

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

rlf89 avatar Feb 16 '24 06:02 rlf89