Mailspring/app/build/create-signed-windows-installer.js
2017-09-29 14:12:02 -05:00

41 lines
1.3 KiB
JavaScript

/* eslint import/no-dynamic-require:0 */
/**
* NOTE: Due to path issues, this script must be run outside of grunt
* directly from a powershell command.
*/
const path = require('path');
const { createWindowsInstaller } = require('electron-winstaller');
const appDir = path.join(__dirname, '..');
const { version } = require(path.join(appDir, 'package.json'));
const config = {
usePackageJson: false,
outputDirectory: path.join(appDir, 'dist'),
appDirectory: path.join(appDir, 'dist', 'mailspring-win32-ia32'),
loadingGif: path.join(appDir, 'build', 'resources', 'win', 'loading.gif'),
iconUrl: 'http://edgehill.s3.amazonaws.com/static/mailspring.ico',
certificateFile: process.env.WINDOWS_CODESIGN_CERT,
certificatePassword: process.env.WINDOWS_CODESIGN_CERT_PASSWORD,
description: 'Mailspring',
version: version,
title: 'Mailspring',
authors: 'Foundry 376, LLC',
setupIcon: path.join(appDir, 'build', 'resources', 'win', 'mailspring.ico'),
setupExe: 'MailspringSetup.exe',
exe: 'mailspring.exe',
name: 'Mailspring',
};
console.log(config);
console.log('---> Starting');
createWindowsInstaller(config)
.then(() => {
console.log('createWindowsInstaller succeeded.');
process.exit(0);
})
.catch(e => {
console.error(`createWindowsInstaller failed: ${e.message}`);
process.exit(1);
});