Skip to content

Commit 981f20a

Browse files
committed
Add windows installer
1 parent c916b0b commit 981f20a

File tree

11 files changed

+58
-8
lines changed

11 files changed

+58
-8
lines changed
File renamed without changes.

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
1+
![](https://github.com/ShawnLin013/moai/blob/master/images/logo.png)
2+
3+
[![](https://img.shields.io/badge/platform-macOS%20%7C%20Windows%20%7C%20Linux-lightgrey.svg)](https://github.com/ShawnLin013/moai/releases/latest)
4+
[![](https://img.shields.io/github/release/ShawnLin013/moai.svg)](https://github.com/ShawnLin013/moai/releases/latest)
5+
[![](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
6+
17
# MOAI
28

39
A cross-platform application for changing your ip config.
410

5-
<img src="https://github.com/ShawnLin013/moai/blob/master/images/logo.png">
11+
![](https://github.com/ShawnLin013/moai/blob/master/images/preview.gif)
12+
13+
## Installation
14+
15+
Download the latest [MOAI release](https://github.com/ShawnLin013/moai/releases/latest).
616

717
## License
818

build-windows-installer.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
let { MSICreator } = require('electron-wix-msi');
2+
let packageInfo = require('./package.json');
3+
let arches = ['ia32', 'x64'];
4+
5+
arches.forEach(function (arch) {
6+
console.log(`[${arch}] Start Building...`);
7+
8+
// Step 1: Instantiate the MSICreator
9+
const msiCreator = new MSICreator({
10+
appDirectory: `${process.env.PWD}/build/MOAI-win32-${arch}`,
11+
outputDirectory: `${process.env.PWD}/build/MOAI-win32-${arch}-installer`,
12+
description: packageInfo.description,
13+
exe: packageInfo.productName,
14+
name: packageInfo.productName,
15+
manufacturer: packageInfo.productName,
16+
version: packageInfo.version,
17+
ui: {
18+
chooseDirectory: true,
19+
images: {
20+
background: `${process.env.PWD}/images/WixUIDialogBmp.png`,
21+
banner: `${process.env.PWD}/images/WixUIBannerBmp.png`,
22+
exclamationIcon: `${process.env.PWD}/images/WixUIExclamationIco.ico`,
23+
infoIcon: `${process.env.PWD}/images/WixUIInfoIco.ico`,
24+
newIcon: `${process.env.PWD}/images/WixUINewIco.ico`,
25+
upIcon: `${process.env.PWD}/images/WixUIUpIco.ico`
26+
}
27+
}
28+
});
29+
30+
// Step 2: Create a .wxs template file
31+
msiCreator.create().then(() => {
32+
// Step 3: Compile the template to a .msi file
33+
msiCreator.compile().then(() => {
34+
console.log(`[${arch}] Build Success!`);
35+
});
36+
});
37+
});

images/WixUIBannerBmp.png

1.45 KB
Loading

images/WixUIDialogBmp.png

5.19 KB
Loading

images/WixUIExclamationIco.ico

4.57 KB
Binary file not shown.

images/WixUIInfoIco.ico

4.57 KB
Binary file not shown.

images/WixUINewIco.ico

2.6 KB
Binary file not shown.

images/WixUIUpIco.ico

2.6 KB
Binary file not shown.

images/preview.png

23.1 KB
Loading

0 commit comments

Comments
 (0)