2017-03-14 06:48:45 +08:00
|
|
|
/* eslint import/no-dynamic-require:0 */
|
|
|
|
/**
|
|
|
|
* NOTE: Due to path issues, this script must be run outside of grunt
|
|
|
|
* directly from a powershell command.
|
|
|
|
*/
|
2017-08-11 15:16:11 +08:00
|
|
|
const path = require('path');
|
2017-09-27 02:33:08 +08:00
|
|
|
const { createWindowsInstaller } = require('electron-winstaller');
|
2017-03-14 06:48:45 +08:00
|
|
|
|
2017-09-27 02:33:08 +08:00
|
|
|
const appDir = path.join(__dirname, '..');
|
|
|
|
const { version } = require(path.join(appDir, 'package.json'));
|
2017-03-14 06:48:45 +08:00
|
|
|
|
|
|
|
const config = {
|
|
|
|
usePackageJson: false,
|
|
|
|
outputDirectory: path.join(appDir, 'dist'),
|
2017-09-06 04:37:40 +08:00
|
|
|
appDirectory: path.join(appDir, 'dist', 'mailspring-win32-ia32'),
|
2017-03-14 06:48:45 +08:00
|
|
|
loadingGif: path.join(appDir, 'build', 'resources', 'win', 'loading.gif'),
|
2017-09-06 04:37:40 +08:00
|
|
|
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',
|
2017-03-14 06:48:45 +08:00
|
|
|
version: version,
|
2017-09-30 03:12:02 +08:00
|
|
|
title: 'Mailspring',
|
2017-08-11 14:56:36 +08:00
|
|
|
authors: 'Foundry 376, LLC',
|
2017-09-06 04:37:40 +08:00
|
|
|
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
|
|
|
};
|
2017-08-11 16:44:50 +08:00
|
|
|
|
2017-03-14 06:48:45 +08:00
|
|
|
console.log(config);
|
2017-09-27 02:33:08 +08:00
|
|
|
console.log('---> Starting');
|
2017-08-11 16:44:50 +08:00
|
|
|
|
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);
|
|
|
|
});
|