Skip to content

Commit c916b0b

Browse files
authored
Merge pull request #3 from ShawnLin013/feature/Windows-installer
Feature/windows installer
2 parents 2e66d49 + 6d50430 commit c916b0b

File tree

11 files changed

+45
-58
lines changed

11 files changed

+45
-58
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
node_modules
2+
build

README.md

Lines changed: 4 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,9 @@
1-
# electron-quick-start
1+
# MOAI
22

3-
**Clone and run for a quick way to see Electron in action.**
3+
A cross-platform application for changing your ip config.
44

5-
This is a minimal Electron application based on the [Quick Start Guide](https://electronjs.org/docs/tutorial/quick-start) within the Electron documentation.
6-
7-
**Use this app along with the [Electron API Demos](https://electronjs.org/#get-started) app for API code examples to help you get started.**
8-
9-
A basic Electron application needs just these files:
10-
11-
- `package.json` - Points to the app's main file and lists its details and dependencies.
12-
- `main.js` - Starts the app and creates a browser window to render HTML. This is the app's **main process**.
13-
- `index.html` - A web page to render. This is the app's **renderer process**.
14-
15-
You can learn more about each of these components within the [Quick Start Guide](https://electronjs.org/docs/tutorial/quick-start).
16-
17-
## To Use
18-
19-
To clone and run this repository you'll need [Git](https://git-scm.com) and [Node.js](https://nodejs.org/en/download/) (which comes with [npm](http://npmjs.com)) installed on your computer. From your command line:
20-
21-
```bash
22-
# Clone this repository
23-
git clone https://github.com/electron/electron-quick-start
24-
# Go into the repository
25-
cd electron-quick-start
26-
# Install dependencies
27-
npm install
28-
# Run the app
29-
npm start
30-
```
31-
32-
Note: If you're using Linux Bash for Windows, [see this guide](https://www.howtogeek.com/261575/how-to-run-graphical-linux-desktop-applications-from-windows-10s-bash-shell/) or use `node` from the command prompt.
33-
34-
## Resources for Learning Electron
35-
36-
- [electronjs.org/docs](https://electronjs.org/docs) - all of Electron's documentation
37-
- [electronjs.org/community#boilerplates](https://electronjs.org/community#boilerplates) - sample starter apps created by the community
38-
- [electron/electron-quick-start](https://github.com/electron/electron-quick-start) - a very basic starter Electron app
39-
- [electron/simple-samples](https://github.com/electron/simple-samples) - small applications with ideas for taking them further
40-
- [electron/electron-api-demos](https://github.com/electron/electron-api-demos) - an Electron app that teaches you how to use Electron
41-
- [hokein/electron-sample-apps](https://github.com/hokein/electron-sample-apps) - small demo apps for the various Electron APIs
5+
<img src="https://github.com/ShawnLin013/moai/blob/master/images/logo.png">
426

437
## License
448

45-
[CC0 1.0 (Public Domain)](LICENSE.md)
9+
The source code is licensed under the [MIT](LICENSE) license.

images/icon.icns

116 KB
Binary file not shown.

images/icon.ico

361 KB
Binary file not shown.

images/icon.png

11 KB
Loading

images/logo.png

7.81 KB
Loading

images/moai.png

-10.8 KB
Binary file not shown.

index.html

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@
1414
<link rel="stylesheet" type="text/css" href="semantic/semantic.min.css" />
1515
<link rel="stylesheet" type="text/css" href="css/app.css" />
1616

17-
<title>Moai</title>
17+
<title>MOAI</title>
1818
</head>
1919

2020
<body>
2121
<div class="">
2222
<div class="header__row ">
2323
<h1 class="ui header teal">
24-
<img class="ui middle aligned image" src="./images/moai.png">
24+
<img class="ui middle aligned image" src="./images/icon.png">
2525
<div class="content">
26-
Moai
26+
MOAI
2727
<div class="sub header">A cross-platform application for changing your ip config.</div>
2828
</div>
2929
</h1>
@@ -151,6 +151,19 @@ <h1 class="ui header teal">
151151
</div>
152152
</div>
153153
</div>
154+
<div class="ui basic modal">
155+
<div class="content">
156+
<img class="ui small image" src="./images/icon.png">
157+
</div>
158+
<div id="error-header" class="ui header" style="text-align: center; padding: .75rem 1rem!important;"></div>
159+
<div id="error-content" class="content" style="text-align: center;"></div>
160+
<div class="actions">
161+
<div class="ui red basic cancel inverted button">
162+
<i class="remove icon"></i>
163+
Close
164+
</div>
165+
</div>
166+
</div>
154167
</div>
155168
</body>
156169

main.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ const url = require('url')
1212
let mainWindow
1313

1414
const minWindowWidth = 800
15-
const minWindowHeight = 680
15+
const minWindowHeight = 700
1616

1717
function createWindow () {
1818
// Create the browser window.
1919
mainWindow = new BrowserWindow({
2020
width: minWindowWidth,
21-
height: minWindowHeight
21+
height: minWindowHeight,
22+
minWidth: minWindowWidth,
23+
minHeight: minWindowHeight
2224
})
2325

2426
// and load the index.html of the app.
@@ -28,15 +30,11 @@ function createWindow () {
2830
slashes: true
2931
}))
3032

31-
// Set minimum size of the window
32-
mainWindow.setMinimumSize(minWindowWidth, minWindowHeight)
33-
mainWindow.setResizable(false)
34-
3533
// Hide menu
3634
mainWindow.setMenu(null)
3735

3836
// Open the DevTools.
39-
mainWindow.webContents.openDevTools()
37+
// mainWindow.webContents.openDevTools()
4038

4139
// Emitted when the window is closed.
4240
mainWindow.on('closed', function () {

package.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
{
22
"name": "moai",
3+
"productName": "MOAI",
34
"version": "0.0.1",
45
"description": "A cross-platform application for changing your ip config.",
56
"main": "main.js",
67
"scripts": {
7-
"start": "electron ."
8+
"start": "electron .",
9+
"build-win32": "electron-packager . --platform=win32 --arch=ia32 --overwrite --prune --icon=images/icon.ico --ignore=app/src --out=build",
10+
"build-win64": "electron-packager . --platform=win32 --arch=x64 --overwrite --prune --icon=images/icon.ico --ignore=app/src --out=build",
11+
"build-mac": "electron-packager . --platform=darwin --arch=x64 --overwrite --prune --icon=images/icon.icns --ignore=app/src --out=build && electron-installer-dmg ./build/MOAI-darwin-x64/MOAI.app MOAI --out=out --overwrite --icon=images/icon.icns",
12+
"build-linux": "electron-packager . --platform=linux --arch=x64 --overwrite --prune --icon=images/icon.png --ignore=app/src --out=build"
813
},
914
"repository": "https://github.com/ShawnLin013/moai",
1015
"keywords": [
@@ -14,7 +19,9 @@
1419
"author": "Shawn",
1520
"license": "MIT",
1621
"devDependencies": {
17-
"electron": "^1.8.4"
22+
"electron": "^1.8.4",
23+
"electron-packager": "^12.0.1",
24+
"electron-winstaller": "^2.6.4"
1825
},
1926
"dependencies": {
2027
"child-process-promise": "^2.2.1",

0 commit comments

Comments
 (0)