Electron - Create Single App for Windows, Linux, and macOS article
There is one method that works on Linux and Mac, using Java. You can also use osslsigncode on both systems, for Linux and Mac a how-to is included. This documents finishes with some remarks and how to integrate the signing process with Electron Builder. Signing Windows app on Mac/Linux using JSign¶ This method requires Java. Jun 04, 2019 I got invited to talk about Electron at QCon San Francisco in November and the video and transcript of the presentation are now available. Electron gives you the power to write a single application for Windows, MacOS and Linux. But Electron apps can easily feel out of place among other applications, exactly because you have. Dec 15, 2017 Writing cross-platform UI applications is hard, and there are a bunch of little problems, like packaging. You probably want to distribute your app in a DMG. One of the problems with creating a DMG, though, is that you need a Mac to do it. You can't easily create DMGs on a Linux box or a Windows VM. You need a proper Mac, and historically, it's been hard to find Macs in the cloud for CI hosts. Dec 30, 2016 Packaging an electron app simply means creating a desktop installer (dmg, exe, deb etc). Now if you decide to go around manually packaging your app, you’re gonna have a. Create.dmg files free download. Etcher Etcher is a powerful OS image flasher. Written with Electron for cross. Downloads: 670 This Week Last Update. On Qt5, runs on a variety of platforms, such as Microsoft Windows, Mac OS X 10.9 and later and several Unix flavors (Linux, FreeBSD and others). Input images can be supplied.
electronBuilder.js
Create Dmg File On Windows
constpackagejson=require('../package.json'); |
constbuilder=require('electron-builder'); |
constmimes=newMap(); |
mimes.set('exe','exe'); |
mimes.set('dmg','dmg'); |
mimes.set('zip','zip'); |
mimes.set('AppImage','x-executable'); |
//Development package.json, see https://goo.gl/5jVxoO |
constdevMetadata=packagejson.electronBuilder; |
//Application package.json |
constappMetadata={ |
name: packagejson.name, |
version: packagejson.version, |
description: packagejson.description, |
author: packagejson.author |
}; |
functionbuildPromise(){ |
returnnewPromise((resolve,reject)=>{ |
builder |
.build({projectDir: './', devMetadata, appMetadata }) |
.then(args=>{ |
constfilePath=args[0]; |
constfileName=filePath.substr(filePath.replace(//g,'/').lastIndexOf('/')+1); |
constext=fileName.substr(fileName.lastIndexOf('.')+1); |
letmimeType; |
if(mimes.has(ext)) |
mimeType=`application/${mimes.get(ext)}, application/octet-stream`; |
else |
console.warn(`Unsupported file type '${ext}' in file '${filePath}'; mime type will be null`); |
resolve({fileName, filePath, mimeType}); |
}).catch((error)=>{ |
console.error(error); |
}); |
}); |
} |
module.exports=buildPromise; |
electronBuilder.json
'electronBuilder': { |
'build': { |
'productName': 'Node Performance Measure', |
'appId': 'EikosPartners.NodePerformanceMeasure', |
'asar': false, |
'win': { |
'iconUrl': 'http://localhost:5000/images/eikos-logo-multi.ico', |
'target': 'nsis' |
}, |
'nsis': { |
'oneClick': false, |
'allowElevation': false |
}, |
'linux': { |
'target': 'AppImage', |
'category': 'Development' |
}, |
'mac': { |
'target': 'dmg' |
} |
}, |
'directories': { |
'output': 'electron/output', |
'app': 'electron/app', |
'buildResources': 'electron/buildResources' |
} |
} |
electronInstall.html
<div> |
<inputtype='button' value='Electron' onclick='downloadElectron();' /> |
<spanid='spanElectron'>Build Electron Version Installer for detected OS:</span> |
</div> |
<scripttype='text/javascript'> |
varosdetect='UNKNOWN!'; |
varplatform=navigator.platform.toLowerCase(); |
if(platform.indexOf('win') >= 0) |
osdetect='Windows'; |
elseif(platform.indexOf('mac') >= 0) |
osdetect='MacOS'; |
elseif(platform.indexOf('linux') >= 0) |
osdetect='Linux'; |
document.getElementById('spanElectron').innerHTML+=' <i><strong>'+osdetect+'</strong></i>'; |
functiondownloadElectron(){ |
varhostname=location.hostname; |
varport=location.port.length>0 ? ':'+location.port : '; |
varurl='http://'+hostname+port+'/electron' |
window.open(url); |
} |
</script> |
electronRoute.js
Install Dmg File On Linux
//Install page for Electron Application |
router.get('/electron',function(req,res,next){ |
electronBuilder() |
.then(e=>fs.readFile(e.filePath,(err,data)=>{ |
res.setHeader('Content-Disposition',`attachment; filename='${e.fileName}'`); |
res.setHeader('Content-type',e.mimeType); |
res.send(data); |
})).catch((error)=>{ |
console.error(error); |
}); |
}); |
Create Dmg On Linux Electronics
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment