Open ibullet-chzn opened 7 years ago
same, electon 1.7.4.beta
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.
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.
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}`));
Someone got something working here ? Process seems to hang for ages on a mono sgen command ..
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.
@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
I use Rollup, then delete node_modules, makes a big difference.
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.
@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.
⠋ 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
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.
It took a bit of fiddling around and debugging. the biggest issue was node modules with circular dependencies - I had to exclude those.
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
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.
I would try putting console logs throughout this module to get more information on what is causing the issue.
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.
Same behavior here, as described by madhuni. The script runs forever on my Windows 10 machine. I have to manually abort it.
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.
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.
Same for me, packaging with "asar": true
solve the issue !
This happened several months ago for us. The code signing takes forever!
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?
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.
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
I am having the same problem using electron-forge
. I tried asar; true
but got no result.
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?
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();
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
hello, Executed more than 30 minutes according to the document, There is no finished result, and there is no wrong information.