1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-23 16:25:22 +03:00

Merge pull request #2102 from McGiverGim/inno_setup

This commit is contained in:
Michael Keller 2020-07-05 20:56:57 +12:00 committed by GitHub
commit 25c918feee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 3804 additions and 634 deletions

View file

@ -13,7 +13,7 @@ const path = require('path');
const zip = require('gulp-zip');
const del = require('del');
const NwBuilder = require('nw-builder');
const makensis = require('makensis');
const innoSetup = require('@quanle94/innosetup');
const deb = require('gulp-debian');
const buildRpm = require('rpm-builder');
const commandExistsSync = require('command-exists').sync;
@ -529,33 +529,32 @@ function start_debug(done) {
// Create installer package for windows platforms
function release_win(arch, appDirectory, done) {
// Check if makensis exists
if (!commandExistsSync('makensis')) {
console.warn('makensis command not found, not generating win package for ' + arch);
done();
}
// The makensis does not generate the folder correctly, manually
createDirIfNotExists(RELEASE_DIR);
// Parameters passed to the installer script
const options = {
verbose: 2,
define: {
'VERSION': pkg.version,
'PLATFORM': arch,
'DEST_FOLDER': RELEASE_DIR,
'SOURCE_FOLDER': appDirectory,
}
const parameters = [];
// Extra parameters to replace inside the iss file
parameters.push(`/Dversion=${pkg.version}`);
parameters.push(`/DarchName=${arch}`);
parameters.push(`/DarchAllowed=${(arch === 'win32') ? 'x86 x64' : 'x64'}`);
parameters.push(`/DarchInstallIn64bit=${(arch === 'win32') ? '' : 'x64'}`);
parameters.push(`/DsourceFolder=${appDirectory}`);
parameters.push(`/DtargetFolder=${RELEASE_DIR}`);
// Show only errors in console
parameters.push(`/Q`);
// Script file to execute
parameters.push("assets/windows/installer.iss");
innoSetup(parameters, {},
function(error) {
if (error != null) {
console.error(`Installer for platform ${arch} finished with error ${error}`);
} else {
console.log(`Installer for platform ${arch} finished`);
}
var output = makensis.compileSync('./assets/windows/installer.nsi', options);
if (output.status !== 0) {
console.error('Installer for platform ' + arch + ' finished with error ' + output.status + ': ' + output.stderr);
}
done();
done();
});
}
// Create distribution package (zip) for windows and linux platforms