2015-07-05 14:08:13 +08:00
|
|
|
{
|
2016-01-19 18:04:49 +08:00
|
|
|
"name": "nativefier-placeholder",
|
|
|
|
"version": "1.0.0",
|
2015-07-05 15:11:49 +08:00
|
|
|
"description": "Placeholder for the nativefier cli to override with a target url",
|
2016-01-22 18:03:35 +08:00
|
|
|
"main": "lib/main.js",
|
2015-07-05 14:08:13 +08:00
|
|
|
"dependencies": {
|
2018-07-21 08:45:01 -04:00
|
|
|
"electron-context-menu": "^0.10.0",
|
2017-11-14 08:05:01 -05:00
|
|
|
"electron-dl": "^1.10.0",
|
Support packaging nativefier applications into Squirrel-based installers (#744)
[Squirrel](https://github.com/Squirrel/Squirrel.Windows) is *"an installation and update
framework for Windows desktop apps "*.
This PR adds `electron-squirrel-startup`, allowing to package nativefier applications
into squirrel-based setup installers. Squirrel require this entrypoint to perform
desktop and startup menu creations, without showing the UI on setup launches.
- References: https://github.com/mongodb-js/electron-squirrel-startup
- Resolves `electron-winstaller` and `electron-installer-windows` support of desktop / startup menu shortcuts for nativefier packaged applications.
- The `electron-squirrel-startup` entrypoint has no effect on both Linux and Darwin, only on Windows
- Supporting it directly inside `nativefier` avoids having to "hack" around the existing `main.js`
and including dependencies from `electron-squirrel-startup` in an intermediate package
to be included in a third layer for the final installer executable
- The following script based on both `nativefier` and `electron-winstaller` templates
represents a portable proof of concept for this merge request :
```js
var nativefier = require('nativefier').default;
var electronInstaller = require('electron-winstaller');
var options = {
name: 'Web WhatsApp',
targetUrl: 'http://web.whatsapp.com',
platform: 'windows',
arch: 'x64',
version: '0.36.4',
out: '.',
overwrite: false,
asar: false,
counter: false,
bounce: false,
width: 1280,
height: 800,
showMenuBar: false,
fastQuit: false,
userAgent: 'Mozilla ...',
ignoreCertificate: false,
ignoreGpuBlacklist: false,
enableEs3Apis: false,
insecure: false,
honest: false,
zoom: 1.0,
singleInstance: false,
fileDownloadOptions: {
saveAs: true
},
processEnvs: {
GOOGLE_API_KEY: '<your-google-api-key>'
}
};
nativefier(options, function(error, appPath) {
if (error) {
console.error(error);
return;
}
console.log('App has been nativefied to', appPath);
resultPromise = electronInstaller.createWindowsInstaller({
appDirectory: 'Web WhatsApp-win32-x64',
outputDirectory: './',
authors: 'Web WhatsApp',
exe: 'Web WhatsApp.exe'
});
resultPromise.then(() => console.log('It worked!'), e => console.log(`No dice: ${e.message}`));
});
```
2019-02-08 15:57:32 +01:00
|
|
|
"electron-squirrel-startup": "^1.0.0",
|
2017-11-14 08:05:01 -05:00
|
|
|
"electron-window-state": "^4.1.1",
|
2017-12-19 13:42:06 +00:00
|
|
|
"loglevel": "^1.5.1",
|
2017-11-14 08:05:01 -05:00
|
|
|
"source-map-support": "^0.5.0",
|
|
|
|
"wurl": "^2.5.2"
|
2015-07-05 14:08:13 +08:00
|
|
|
},
|
|
|
|
"devDependencies": {},
|
|
|
|
"scripts": {
|
|
|
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
|
|
},
|
|
|
|
"keywords": [
|
|
|
|
"desktop",
|
|
|
|
"electron"
|
|
|
|
],
|
|
|
|
"author": "Jia Hao",
|
2016-01-19 11:25:54 +08:00
|
|
|
"license": "MIT"
|
2015-07-05 14:08:13 +08:00
|
|
|
}
|