Merge pull request #79 from resin-io/feat/osx-installer

Implement OS X installer
This commit is contained in:
Juan Cruz Viotti 2016-02-08 12:55:10 -04:00
commit 8529e7fac5
5 changed files with 30 additions and 14 deletions

View File

@ -1,9 +1,11 @@
ELECTRON_PACKAGER=./node_modules/.bin/electron-packager ELECTRON_PACKAGER=./node_modules/.bin/electron-packager
ELECTRON_BUILDER=./node_modules/.bin/electron-builder
ELECTRON_IGNORE=$(shell cat package.ignore | tr "\\n" "|" | sed "s/.$$//") ELECTRON_IGNORE=$(shell cat package.ignore | tr "\\n" "|" | sed "s/.$$//")
ELECTRON_VERSION=0.36.0 ELECTRON_VERSION=0.36.0
APPLICATION_NAME="Etcher"
release/Etcher-darwin-x64: . release/Etcher-darwin-x64: .
$(ELECTRON_PACKAGER) . "Etcher" \ $(ELECTRON_PACKAGER) . $(APPLICATION_NAME) \
--platform=darwin \ --platform=darwin \
--arch=x64 \ --arch=x64 \
--version=$(ELECTRON_VERSION) \ --version=$(ELECTRON_VERSION) \
@ -14,7 +16,7 @@ release/Etcher-darwin-x64: .
--out=release/ --out=release/
release/Etcher-linux-ia32: . release/Etcher-linux-ia32: .
$(ELECTRON_PACKAGER) . "Etcher" \ $(ELECTRON_PACKAGER) . $(APPLICATION_NAME) \
--platform=linux \ --platform=linux \
--arch=ia32 \ --arch=ia32 \
--version=$(ELECTRON_VERSION) \ --version=$(ELECTRON_VERSION) \
@ -24,7 +26,7 @@ release/Etcher-linux-ia32: .
--out=release/ --out=release/
release/Etcher-linux-x64: . release/Etcher-linux-x64: .
$(ELECTRON_PACKAGER) . "Etcher" \ $(ELECTRON_PACKAGER) . $(APPLICATION_NAME) \
--platform=linux \ --platform=linux \
--arch=x64 \ --arch=x64 \
--version=$(ELECTRON_VERSION) \ --version=$(ELECTRON_VERSION) \
@ -34,7 +36,7 @@ release/Etcher-linux-x64: .
--out=release/ --out=release/
release/Etcher-win32-ia32: . release/Etcher-win32-ia32: .
$(ELECTRON_PACKAGER) . "Etcher" \ $(ELECTRON_PACKAGER) . $(APPLICATION_NAME) \
--platform=win32 \ --platform=win32 \
--arch=ia32 \ --arch=ia32 \
--version=$(ELECTRON_VERSION) \ --version=$(ELECTRON_VERSION) \
@ -45,7 +47,7 @@ release/Etcher-win32-ia32: .
--out=release/ --out=release/
release/Etcher-win32-x64: . release/Etcher-win32-x64: .
$(ELECTRON_PACKAGER) . "Etcher" \ $(ELECTRON_PACKAGER) . $(APPLICATION_NAME) \
--platform=win32 \ --platform=win32 \
--arch=x64 \ --arch=x64 \
--version=$(ELECTRON_VERSION) \ --version=$(ELECTRON_VERSION) \
@ -60,5 +62,12 @@ package-linux: release/Etcher-linux-ia32 release/Etcher-linux-x64
package-win32: release/Etcher-win32-ia32 release/Etcher-win32-x64 package-win32: release/Etcher-win32-ia32 release/Etcher-win32-x64
package-all: package-osx package-linux package-win32 package-all: package-osx package-linux package-win32
release/installers/Etcher.dmg: release/Etcher-darwin-x64 package.json
$(ELECTRON_BUILDER) "$</$(APPLICATION_NAME).app" \
--platform=osx \
--out=release/installers
installer-osx: release/installers/Etcher.dmg
clean: clean:
rm -rf release/ rm -rf release/

View File

@ -6,7 +6,7 @@ This is a small guide to package and publish Resin Etcher to all supported opera
Packaging Packaging
--------- ---------
You need to install [wine](https://www.winehq.org) to package the application for Windows. You need to install [wine](https://www.winehq.org) and [nsis](http://nsis.sourceforge.net/Main_Page) to package the application for Windows.
Make sure you install npm dependencies with `--force` since there might be optional dependencies for an operating system not equal to the host that will not make it to the package otherwise: Make sure you install npm dependencies with `--force` since there might be optional dependencies for an operating system not equal to the host that will not make it to the package otherwise:
@ -17,15 +17,9 @@ npm install --force
Run the following command to package Resin Etcher Run the following command to package Resin Etcher
```sh ```sh
# all supported operating systems make installer-osx
make package-all
# or a single operating system
make package-osx
make package-linux
make package-win32
``` ```
The resulting packages will be saved to `release/`. The resulting packages will be saved to `release/installers`.
You can run `make clean` to start in a fresh state. You can run `make clean` to start in a fresh state.

BIN
assets/osx/installer.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
assets/osx/installer@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -16,6 +16,18 @@
}, },
"author": "Juan Cruz Viotti <juan@resin.io>", "author": "Juan Cruz Viotti <juan@resin.io>",
"license": "Apache-2.0", "license": "Apache-2.0",
"builder": {
"osx" : {
"title": "Etcher",
"background": "assets/osx/installer.png",
"icon": "assets/icon.icns",
"icon-size": 110,
"contents": [
{ "x": 415, "y": 225, "type": "link", "path": "/Applications" },
{ "x": 140, "y": 225, "type": "file" }
]
}
},
"optionalDependencies": { "optionalDependencies": {
"elevator": "^1.0.0", "elevator": "^1.0.0",
"removedrive": "^1.0.0" "removedrive": "^1.0.0"
@ -37,6 +49,7 @@
"devDependencies": { "devDependencies": {
"angular-mocks": "^1.4.7", "angular-mocks": "^1.4.7",
"electron-mocha": "^0.8.0", "electron-mocha": "^0.8.0",
"electron-builder": "^2.6.0",
"electron-packager": "^5.1.1", "electron-packager": "^5.1.1",
"electron-prebuilt": "^0.36.4", "electron-prebuilt": "^0.36.4",
"gulp": "^3.9.0", "gulp": "^3.9.0",