Skip to content

Commit

Permalink
Merge pull request #4 from ShawnLin013/feature/Update-README
Browse files Browse the repository at this point in the history
Add windows installer
  • Loading branch information
ShawnLin013 authored Apr 26, 2018
2 parents c916b0b + 981f20a commit 9396d05
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 8 deletions.
File renamed without changes.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
![](https://github.com/ShawnLin013/moai/blob/master/images/logo.png)

[![](https://img.shields.io/badge/platform-macOS%20%7C%20Windows%20%7C%20Linux-lightgrey.svg)](https://github.com/ShawnLin013/moai/releases/latest)
[![](https://img.shields.io/github/release/ShawnLin013/moai.svg)](https://github.com/ShawnLin013/moai/releases/latest)
[![](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)

# MOAI

A cross-platform application for changing your ip config.

<img src="https://github.com/ShawnLin013/moai/blob/master/images/logo.png">
![](https://github.com/ShawnLin013/moai/blob/master/images/preview.gif)

## Installation

Download the latest [MOAI release](https://github.com/ShawnLin013/moai/releases/latest).

## License

Expand Down
37 changes: 37 additions & 0 deletions build-windows-installer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
let { MSICreator } = require('electron-wix-msi');
let packageInfo = require('./package.json');
let arches = ['ia32', 'x64'];

arches.forEach(function (arch) {
console.log(`[${arch}] Start Building...`);

// Step 1: Instantiate the MSICreator
const msiCreator = new MSICreator({
appDirectory: `${process.env.PWD}/build/MOAI-win32-${arch}`,
outputDirectory: `${process.env.PWD}/build/MOAI-win32-${arch}-installer`,
description: packageInfo.description,
exe: packageInfo.productName,
name: packageInfo.productName,
manufacturer: packageInfo.productName,
version: packageInfo.version,
ui: {
chooseDirectory: true,
images: {
background: `${process.env.PWD}/images/WixUIDialogBmp.png`,
banner: `${process.env.PWD}/images/WixUIBannerBmp.png`,
exclamationIcon: `${process.env.PWD}/images/WixUIExclamationIco.ico`,
infoIcon: `${process.env.PWD}/images/WixUIInfoIco.ico`,
newIcon: `${process.env.PWD}/images/WixUINewIco.ico`,
upIcon: `${process.env.PWD}/images/WixUIUpIco.ico`
}
}
});

// Step 2: Create a .wxs template file
msiCreator.create().then(() => {
// Step 3: Compile the template to a .msi file
msiCreator.compile().then(() => {
console.log(`[${arch}] Build Success!`);
});
});
});
Binary file added images/WixUIBannerBmp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/WixUIDialogBmp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/WixUIExclamationIco.ico
Binary file not shown.
Binary file added images/WixUIInfoIco.ico
Binary file not shown.
Binary file added images/WixUINewIco.ico
Binary file not shown.
Binary file added images/WixUIUpIco.ico
Binary file not shown.
Binary file added images/preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 10 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
{
"name": "moai",
"productName": "MOAI",
"version": "0.0.1",
"version": "1.0.0",
"description": "A cross-platform application for changing your ip config.",
"main": "main.js",
"scripts": {
"start": "electron .",
"build-win32": "electron-packager . --platform=win32 --arch=ia32 --overwrite --prune --icon=images/icon.ico --ignore=app/src --out=build",
"build-win64": "electron-packager . --platform=win32 --arch=x64 --overwrite --prune --icon=images/icon.ico --ignore=app/src --out=build",
"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",
"build-linux": "electron-packager . --platform=linux --arch=x64 --overwrite --prune --icon=images/icon.png --ignore=app/src --out=build"
"build-win32": "electron-packager . --platform=win32 --arch=ia32 --overwrite --prune --icon=images/icon.ico --out=build",
"build-win64": "electron-packager . --platform=win32 --arch=x64 --overwrite --prune --icon=images/icon.ico --out=build",
"build-mac": "electron-packager . --platform=darwin --arch=x64 --overwrite --prune --icon=images/icon.icns --out=build && electron-installer-dmg ./build/MOAI-darwin-x64/MOAI.app MOAI --out=out --overwrite --icon=images/icon.icns",
"build-linux": "electron-packager . --platform=linux --arch=x64 --overwrite --prune --icon=images/icon.png --out=build"
},
"repository": "https://github.com/ShawnLin013/moai",
"keywords": [
"ip",
"network"
],
"author": "Shawn",
"author": "ShawnLin013",
"license": "MIT",
"win32metadata": {
"requested-execution-level": "requireAdministrator"
},
"devDependencies": {
"electron": "^1.8.4",
"electron-packager": "^12.0.1",
"electron-winstaller": "^2.6.4"
"electron-wix-msi": "^1.3.0"
},
"dependencies": {
"child-process-promise": "^2.2.1",
Expand Down

0 comments on commit 9396d05

Please sign in to comment.