electron / windows-installer

Build Windows Installers for Electron apps
MIT License
1.58k stars 261 forks source link

run long time #189

Open ibullet-chzn opened 7 years ago

ibullet-chzn commented 7 years ago

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

Fudoshiki commented 7 years ago

same, electon 1.7.4.beta

jamesjessian commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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

jamesjessian commented 7 years ago

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 commented 7 years ago

@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 commented 7 years ago

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

jamesjessian commented 7 years ago

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.

chukkwagon commented 6 years ago

@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 commented 6 years ago

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 commented 6 years ago

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

georgemcg commented 6 years ago

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

madhuni commented 6 years ago

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 commented 6 years ago

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

indianazhao commented 6 years ago

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 commented 6 years ago

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

marcelo-franco commented 6 years ago

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 commented 5 years ago

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 commented 5 years ago

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

kaunglvlv commented 5 years ago

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

sohelsd commented 5 years ago

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 commented 5 years ago

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 commented 4 years ago

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 commented 4 years ago

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

codemile commented 3 years ago

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 commented 2 years ago

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 commented 9 months ago

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