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

Question: how to build separate windows installer based on architecture? why no arch option is given?

Open junjunruan opened this issue 10 years ago • 1 comments

Hi,

I used electron-packager packed two separate folder, one is for windows 32-bit, another is for windows 64-bit.

Questions: When use this package to build the installer for each architecture,

  1. what's the correct syntax should be? Why no arch option is given?
  2. can they run parallel?
  3. if want to debug this package, DEBUG=electron-windows-installer:main node tasks/electron-winstaller.js works in the command line. If I want to use an npm command to run it, it doesn't work. scripts: {"build": "DEBUG=electron-windows-installer:main node tasks/electron-winstaller.js"}

I tried the below code but doesn't work, it can only create one installer.

var electronInstaller = require('electron-winstaller');
resultPromise = electronInstaller.createWindowsInstaller({
    appDirectory: '/tmp/build/my-app-64',
    outputDirectory: '/tmp/build/installer64',
    authors: 'My App Inc.',
    exe: 'myapp.exe'
  },
{
    appDirectory: '/tmp/build/my-app-32',
    outputDirectory: '/tmp/build/installer32',
    authors: 'My App Inc.',
    exe: 'myapp.exe'
  });

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

Compared electron-windows-installer with this package: it has arch option, and can use gulp to schedule two parallel task to creating windows 32-bit and 64-bit installer at the same time, it is more efficient.

junjunruan avatar Sep 22 '16 02:09 junjunruan

@junjunruan So, you are suggesting that with electron-windows-installer one could use the following:

var gulp = require('gulp');
var winInstaller = require('electron-windows-installer');

gulp.task('create-windows-installer-32', function(done) {
  winInstaller({
    appDirectory: './build/win32',
    outputDirectory: './release-32',
    arch: 'ia32'
  }).then(done).catch(done);
});

gulp.task('create-windows-installer-64', function(done) {
  winInstaller({
    appDirectory: './build/win64',
    outputDirectory: './release-64',
    arch: 'x64'
  }).then(done).catch(done);
});

Right?

aaroncalderon avatar Apr 16 '18 21:04 aaroncalderon