The only development dependency of this project is Node.js. So just make sure you have it installed. Then type few commands known to every Node developer...
git clone https://github.com/steedos/desktop.git
cd desktop
export ELECTRON_MIRROR=http://npm.taobao.org/mirrors/electron/
npm install -d
npm start
... and boom! You have running desktop application on your screen.
app
- code of your application goes here.config
- place for you to declare environment specific stuff.build
- in this folder lands built, runnable application.releases
- ready for distribution installers will land here.resources
- resources for particular operating system.tasks
- build and development environment scripts.
npm install -d
It will also download Electron runtime, and install dependencies for second package.json
file inside app
folder.
npm start
desktop has preconfigured jasmine unit test runner. To run it go with standard:
npm test
You don't have to declare paths to spec files in any particular place. The runner will search through the project for all *.spec.js
files and include them automatically.
Note: There are various icon and bitmap files in resources
directory. Those are used in installers and are intended to be replaced by your own graphics.
To make ready for distribution installer use command:
npm run release
It will start the packaging process for operating system you are running this command on. Ready for distribution file will be outputted to releases
directory.
You can create Windows installer only when running on Windows, the same is true for Linux and OSX. So to generate all three installers you need all three operating systems.
The Mac release supports code signing. To sign the .app
in the release image, include the certificate ID in the command as so,
npm run sign
The installer is built using NSIS. You have to install NSIS version 3.0, and add its folder to PATH in Environment Variables, so it is reachable to scripts in this project. For example, C:\Program Files (x86)\NSIS
.
There are still a lot of 32-bit Windows installations in use. If you want to support those systems and have 64-bit OS on your machine you need to manually force npm to install all packages for 32-bit. Npm allowes to do that via environment variable:
SET PATH=%PATH%;G:\NSIS
SET npm_config_arch=ia32
rmdir /S node_modules
npm install
Note: This snippet deletes whole node_modules
folder assuming you already had run npm install
in the past (then fresh install is required for the trick to work).