mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-23 08:15:22 +03:00
Replace NSIS by Inno Setup installer
This commit is contained in:
parent
ea880840a8
commit
2051c67dde
18 changed files with 3804 additions and 634 deletions
51
gulpfile.js
51
gulpfile.js
|
@ -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;
|
||||
|
@ -510,33 +510,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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue