diff --git a/scripts/buildWindows.js b/scripts/buildWindows.js index f25eeb86a..bd21748d5 100644 --- a/scripts/buildWindows.js +++ b/scripts/buildWindows.js @@ -14,8 +14,18 @@ async function afterPackageBuilt (packagePath) { fs.mkdirSync('dist/app') } + let archSuffix + + if (packagePath.includes('ia32')) { + archSuffix = '-ia32' + } else if (packagePath.includes('arm64')) { + archSuffix = '-arm64' + } else { + archSuffix = '' + } + /* create zip files */ - var output = fs.createWriteStream('dist/app/' + 'Min-v' + version + '-windows' + (packagePath.includes('ia32') ? '-ia32' : '') + '.zip') + var output = fs.createWriteStream('dist/app/' + 'Min-v' + version + '-windows' + archSuffix + '.zip') var archive = archiver('zip', { zlib: { level: 9 } }) @@ -23,32 +33,30 @@ async function afterPackageBuilt (packagePath) { archive.pipe(output) await archive.finalize() - /* create installer for 64-bit */ - if (!packagePath.includes('ia32')) { - const installer = require('electron-installer-windows') - - const options = { - src: packagePath, - dest: 'dist/app/min-installer-x64', - icon: 'icons/icon256.ico', - animation: 'icons/windows-installer.gif', - licenseUrl: 'https://github.com/minbrowser/min/blob/master/LICENSE.txt', - noMsi: true - } - - console.log('Creating package (this may take a while)') - - fs.copyFileSync('LICENSE.txt', packagePath + '/LICENSE') - - await installer(options) - .then(function () { - fs.renameSync('./dist/app/min-installer-x64/min-' + version + '-setup.exe', './dist/app/min-' + version + '-setup.exe') - }) - .catch(err => { - console.error(err, err.stack) - process.exit(1) - }) + /* create installer */ + const installer = require('electron-installer-windows') + + const options = { + src: packagePath, + dest: 'dist/app/min-installer' + archSuffix, + icon: 'icons/icon256.ico', + animation: 'icons/windows-installer.gif', + licenseUrl: 'https://github.com/minbrowser/min/blob/master/LICENSE.txt', + noMsi: true } + + console.log('Creating package (this may take a while)') + + fs.copyFileSync('LICENSE.txt', packagePath + '/LICENSE') + + await installer(options) + .then(function () { + fs.renameSync('./dist/app/min-installer' + archSuffix + '/min-' + version + '-setup.exe', './dist/app/min-' + version + archSuffix + '-setup.exe') + }) + .catch(err => { + console.error(err, err.stack) + process.exit(1) + }) } // creating multiple packages simultaneously causes errors in electron-rebuild, so do one arch at a time instead @@ -58,3 +66,7 @@ createPackage('win32', { arch: Arch.x64 }) return createPackage('win32', { arch: Arch.ia32 }) }) .then(afterPackageBuilt) + .then(function () { + return createPackage('win32', { arch: Arch.arm64 }) + }) + .then(afterPackageBuilt)