Mailspring/app/build/create-signed-windows-installer.js

42 lines
1.3 KiB
JavaScript
Raw Normal View History

/* 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');
2017-09-27 02:33:08 +08:00
const { createWindowsInstaller } = require('electron-winstaller');
2017-09-27 02:33:08 +08:00
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',
2017-09-30 03:12:02 +08:00
certificateFile: process.env.WINDOWS_CODESIGN_CERT,
certificatePassword: process.env.WINDOWS_CODESIGN_CERT_PASSWORD,
2017-09-27 02:33:08 +08:00
description: 'Mailspring',
version: version,
2017-09-30 03:12:02 +08:00
title: 'Mailspring',
authors: 'Foundry 376, LLC',
setupIcon: path.join(appDir, 'build', 'resources', 'win', 'mailspring.ico'),
setupExe: 'MailspringSetup.exe',
exe: 'mailspring.exe',
name: 'Mailspring',
2017-09-27 02:33:08 +08:00
};
console.log(config);
2017-09-27 02:33:08 +08:00
console.log('---> Starting');
2017-09-27 02:33:08 +08:00
createWindowsInstaller(config)
.then(() => {
console.log('createWindowsInstaller succeeded.');
process.exit(0);
})
.catch(e => {
console.error(`createWindowsInstaller failed: ${e.message}`);
process.exit(1);
});