Skip to content

Commit 7c22827

Browse files
author
Felix
committed
Fix package for Windows and Macos
1 parent dcbfaa8 commit 7c22827

File tree

4 files changed

+106
-21
lines changed

4 files changed

+106
-21
lines changed

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
## Docker UI
22

3-
Simple Docker UI for Chrome is an unofficial developer tool for monitoring and managing your local Docker containers.
4-
5-
<a target="_blank" href="https://chrome.google.com/webstore/detail/jfaelnolkgonnjdlkfokjadedkacbnib">
6-
<img alt="Try it now" src="https://raw.github.com/GoogleChrome/chrome-app-samples/master/tryitnowbutton_small.png" title="Click here to install this app from the Chrome Web Store"></img>
7-
</a>
3+
Simple Docker UI is an unofficial developer tool for monitoring and managing your local Docker containers.
4+
Available on for OS X, Windows, ChromeOS and Linux (soon)
85

6+
* [Download Windows version](releases/)
7+
* [Download OS X version](releases/)
8+
* [Download Chrome plugin version](https://chrome.google.com/webstore/detail/jfaelnolkgonnjdlkfokjadedkacbnib)
99

1010
This app uses Docker Remote Api.
1111
Please note this is a beta version and only provides a basic set of features.
@@ -33,16 +33,17 @@ Any feedback is more than welcome!
3333

3434
### Config
3535

36-
[Connect on OS X](https://github.com/felixgborrego/docker-ui-chrome-app/wiki/Mac-OS-X)
36+
[Connect on OS X](https://github.com/felixgborrego/docker-ui-chrome-app/wiki/OS-X-Installable-Desktop-version)
3737

38-
[Connect on Linux](https://github.com/felixgborrego/docker-ui-chrome-app/wiki/linux)
38+
[Connect on Windows](https://github.com/felixgborrego/docker-ui-chrome-app/wiki/Windows-installable-Desktop-version)
3939

40-
[Connect on Windows](https://github.com/felixgborrego/docker-ui-chrome-app/wiki/windows)
40+
[Connect on Linux](https://github.com/felixgborrego/docker-ui-chrome-app/wiki/linux)
4141

4242
### Stack
4343

4444
* [Scala.js](http://www.scala-js.org/)
4545
* [React on Scala.js](https://github.com/japgolly/scalajs-react)
46+
* [Electron](http://electron.atom.io)
4647
* Bootstrap
4748
* Bower
4849
* Momentjs

electron/README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ bower install
2020
### Compile Scala.js
2121
2222
```
23-
sbt
24-
project electron
25-
~fullOptJS'
23+
export SBT_OPTS="-Xmx1G"
24+
sbt electron/fullOptJS
2625
```
2726
2827
### Run the Electron UI
@@ -32,9 +31,17 @@ npm start
3231
```
3332
3433
### Package the native app
34+
3535
```
36-
npm install electron-installer-dmg
37-
nom install electron-installer
38-
npm run-script package
36+
cd electron
37+
npm run-script package-mac
3938
npm run-script dmg
39+
```
40+
41+
###Package Native app for Windows
42+
43+
```
44+
cd electron
45+
npm run-script package-exe
46+
npm run-script create-installer-win
4047
```

electron/installers/setupEvents.js

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
const electron = require('electron')
2+
const app = electron.app
3+
4+
module.exports = {
5+
handleSquirrelEvent: function() {
6+
if (process.argv.length === 1) {
7+
return false;
8+
}
9+
10+
const ChildProcess = require('child_process');
11+
const path = require('path');
12+
13+
const appFolder = path.resolve(process.execPath, '..');
14+
const rootAtomFolder = path.resolve(appFolder, '..');
15+
const updateDotExe = path.resolve(path.join(rootAtomFolder, 'Update.exe'));
16+
const exeName = path.basename(process.execPath);
17+
const spawn = function(command, args) {
18+
let spawnedProcess, error;
19+
20+
try {
21+
spawnedProcess = ChildProcess.spawn(command, args, {detached: true});
22+
} catch (error) {}
23+
24+
return spawnedProcess;
25+
};
26+
27+
const spawnUpdate = function(args) {
28+
return spawn(updateDotExe, args);
29+
};
30+
31+
const squirrelEvent = process.argv[1];
32+
switch (squirrelEvent) {
33+
case '--squirrel-install':
34+
case '--squirrel-updated':
35+
// Optionally do things such as:
36+
// - Add your .exe to the PATH
37+
// - Write to the registry for things like file associations and
38+
// explorer context menus
39+
40+
// Install desktop and start menu shortcuts
41+
spawnUpdate(['--createShortcut', exeName]);
42+
43+
setTimeout(app.quit, 1000);
44+
return true;
45+
46+
case '--squirrel-uninstall':
47+
// Undo anything you did in the --squirrel-install and
48+
// --squirrel-updated handlers
49+
50+
// Remove desktop and start menu shortcuts
51+
spawnUpdate(['--removeShortcut', exeName]);
52+
53+
setTimeout(app.quit, 1000);
54+
return true;
55+
56+
case '--squirrel-obsolete':
57+
// This is called on the outgoing version of your app before
58+
// we update to the new version - it's the opposite of
59+
// --squirrel-updated
60+
61+
app.quit();
62+
return true;
63+
}
64+
}
65+
}

electron/package.json

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
{
2-
"name": "electron-dockerui",
3-
"version": "0.5.1",
4-
"description": "A minimal Electron application",
2+
"name": "SimpleDockerUI",
3+
"version": "0.5.3",
4+
"productName": "SimpleDockerUI",
5+
"description": "Simple UI and Manager for Docker",
56
"main": "main.js",
67
"scripts": {
78
"start": "electron .",
89
"debug": "cd .. && sbt \"project electron\" \"fastOptJS\" && cd electron && electron .",
910
"test": "sbt test",
10-
"package": "electron-packager . SimpleDockerUI --platform=darwin --arch=x64 --overwrite --icon=img/logo_small.icns --ignore='src' --ignore='target' --asar",
11-
"dmg": "electron-installer-dmg SimpleDockerUI-darwin-x64/SimpleDockerUI.app SimpleDockerUI --icon=img/logo_small.icns --overwrite"
11+
12+
"package-mac": "electron-packager . SimpleDockerUI --platform=darwin --arch=x64 --overwrite --out dist/ --icon=img/logo_small.icns --ignore=src --ignore=target --asar=true",
13+
"dmg": "electron-installer-dmg dist/SimpleDockerUI-darwin-x64/SimpleDockerUI.app SimpleDockerUI --out dist/ --icon=img/logo_small.icns --overwrite",
14+
15+
16+
"package-exe": "electron-packager . SimpleDockerUI --platform=win32 --arch=x64 --out dist/ --overwrite --icon=img/logo_small.ico --ignore=src --ignore=target --asar=true --win32metadata.ProductName=SimpleDockerUI --win32metadata.CompanyName=SimpleDockerUI",
17+
"create-installer-win": "node installers/windows/createinstaller.js"
1218
},
1319
"repository": {
1420
"type": "git",
@@ -29,11 +35,17 @@
2935
"homepage": "https://github.com/felixgborrego/docker-ui-chrome-app",
3036
"devDependencies": {
3137
"electron": "^1.4.6",
32-
"electron-installer-dmg": "^0.1.2"
38+
"electron-installer-dmg": "^0.1.2",
39+
"electron-packager": "^8.3.0",
40+
"electron-winstaller": "^2.5.0"
3341
},
3442
"dependencies": {
43+
"devtron": "^1.4.0",
3544
"docker-modem": "^0.3.1",
3645
"split-ca": "^1.0.0",
37-
"universal-analytics": "0.4.6"
46+
"universal-analytics": "0.4.6",
47+
"fs-plus": "*",
48+
"rimraf": "*",
49+
"yargs": "*"
3850
}
3951
}

0 commit comments

Comments
 (0)