tell you how to write your Electron app, or how Electron itself works • Lots and lots of great talks about this, I recommend Jessica Lord’s Essential Electron (http://jlord.us/essential-electron) to learn more
to set up a project so that you can use the latest web technologies such as React, Angular, ES2017+async/await, and TypeScript • What even do Desktop apps look like in 2017 on different operating systems? • How to package up your app and give it to others, and how to build your app for production • How to set up automatic updates so that users always have the latest version of your app
in the ecosystem into one great command-line build system • Handles setting up new projects à la create-react-app • Packaging, compilation, and publishing are all handled
unlike previous releases, is more like a service or website – new features show up for free • Major updates are free, and have weird names: “Original release => Anniversary Update => Creators Update => Fall Creators Update” • You can download apps via the Windows Store (similar to the Mac App Store), or via a standalone installer that you run
framework that most Electron apps use though they’re not required to. • Written by yours truly! • Squirrel.Windows’s goal is to do as little as possible to get your app running from the moment users click “Install” • Update policy is controlled by your app, and by default is designed to be silent and in the background
the Windows App Store, or distribute it as a standalone package, whose extension ends in .appx • Your apps run in a sandbox, but not nearly as restrictive as macOS or mobile • Users can install AppX files, but there’s no built-in easy way to do updates of that app which is a bummer
easy peasy! • Mac apps can also be distributed via the Mac App Store, but your app must live in a restricted sandbox and some Electron features are disabled as a result. • Apps are self-contained, but you get no notification of install/uninstall so no way to clean up
Electron apps use to update (obvs there is no install step for macOS apps) • While it shares the same name as Squirrel.Windows, its design is very different. I tried to convince them! • Squirrel.Mac will update your app in the background, wait for it to exit, then move it to the new version
update Linux apps, but we’ll focus on the most common one, a Debian Package • Users download your package and install it via the UI, or via the dpkg command • Commercial apps typically set up an Update Repository and configure it on users’ systems. Updates are Not Easy at the moment. Room for improvement!
to change, check the GitHub page for electron- forge • Sometimes you need to click the link to go to the backing library’s GitHub page to see options (i.e. electron-winstaller, electron-windows- store). Confusing! • electron-forge does its best to fill out everything with the sanest default, taking from other fields in package.json if it can, you don’t have to fill out everything
• Easiest thing to do is to just update the app in the background • API also lets you be more visible about updates, choose to cancel them • If you need more flexibility, both Squirrel.Mac and Squirrel.Windows have super super simple server-sides, easy to implement custom policy
files for you, you can copy all of these files directly to an S3 bucket. Bam, you’re done! • For small / internal projects, you don’t need to sign your application, but if you distribute something to the public, you need to sign it. Google for “Authenticode Certificate” and don’t pay more than $100/yr • Squirrel will notify your app on install/uninstall with a special command-line param, you must handle this!
parameters: • --squirrel-install 1.2.3 • --squirrel-uninstall 1.2.3 • --squirrel-updated 1.2.3 • --squirrel-obsolete 1.2.3 • You must immediately exit once you finish! • At minimum, you should create a start-menu shortcut. Squirrel.Windows will do this for you if you ask it
log to C:\Users\NAME\AppData\Local\SquirrelTemp • Your app itself will end up in C:\Users\NAME\AppData\Local\PACKAGE_ID • The log file for updating will end up in C:\Users\NAME\AppData\Local\PACKAGE_ID\SquirrelSetu p.log
be signed with an Apple signature to distribute apps for production because of Gatekeeper, this means you have to pay $100/yr to Apple • On your local machine, you can disable Gatekeeper, or if you right-click on an app => “Open”, you can one-off disable it • Your apps that are packaged as zip files don’t run in the sandbox by default
kinds of certificates to sign your application: • A Developer certificate – works for your machine, nobody else’s. Every developer in a company will sign this, it will have your name on it • A Developer ID certificate – use this for distributing apps on your own. It will have your company’s name, and you can only download it exactly once (save the file!) If you lose this, you must contact Apple • Mac App Application / Installer certificate – this is solely for the App Store, even though it sounds like it’s what you want
certificates • The command line security tool will let you list signing identities, import files when the UI Keychain utility fails for no reason, etc etc • electron-forge will try to find the most appropriate signature type automatically, but if you have multiple identities you may have to specify it in your package.json
connect to a server that will tell it whether it should apply updates • This is a real bummer, so @felixrieseberg and I wrote some code we use for Slack to solve this, which allows you to host Squirrel.Mac updates on a simple file server like S3, https://github.com/felixrieseberg/electron-squirrel-s3 • We’re going to try to clean this up a bit more, but the idea is you have a simple JSON file alongside your released Zip packages
is the same as the production one, so no signing with your dev cert • Running your app directly from Terminal will give you some helpful debugging things, /path/to/Myapp.App/Contents/MacOS/Myapp (some things will act a little wonky when you do this, beware) • Make sure to handle errors thrown by auto-update framework
“control”, which describes what other C libraries that it needs • Native node modules often have C library dependencies on Linux, make sure to test on a clean machine! • Your app shortcut is created via a “.desktop” file. This sets up many other things, such as file associations or protocol URLs