Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
toyobayashi committed Mar 6, 2024
1 parent 6a42f46 commit 586be17
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 41 deletions.
29 changes: 10 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,23 @@ Repo: [mishiro-score-viewer](https://github.com/toyobayashi/mishiro-score-viewer
### Windows Require

* __Windows 7+__
* __Node.js 12+__
* __Python 2.7__ ( 3.x is not supported by `node-gyp` yet)
* __Visual Studio 2015/2017/2019 with C++ Desktop workload installed__
* __.NET & Powershell__
* __Node.js 18+__
* __Python 3__
* __Visual Studio 2022 with C++ Desktop workload installed__
* __.NET & Powershell__

### Linux Require

* __Node.js 12+__
* __Python 2.7__
* __Node.js 18+__
* __Python 3__
* __gcc & g++__
* __make__
* __zip & unzip__

### MacOS Require (This part is not tested)

* __Node.js 12+__
* __Python 2.7__
* __Node.js 18+__
* __Python 3__
* __Xcode__ (install Command Line Tools by running ```xcode-select --install``` in your terminal)

### Quick Start
Expand Down Expand Up @@ -94,18 +94,10 @@ Repo: [mishiro-score-viewer](https://github.com/toyobayashi/mishiro-score-viewer
``` bat
> cd mishiro/app
REM set global npm config toolset variable
REM if your VC++ toolset is not v140 (VS 2015)
> npm config set toolset v142
REM install node-gyp@5
> npm install -g node-gyp
REM it's important to set the npm_config_node_gyp environment variable to tell npm using global installed node-gyp
> for /f "delims=" %P in ('npm prefix -g') do npm config set node_gyp "%P\node_modules\node-gyp\bin\node-gyp.js"
REM install electron's node C++ header
> for /f "delims=" %P in ('node -p "require('./package.json').devDependencies.electron"') do node-gyp install --target=%P --dist-url=https://atom.io/download/electron
> for /f "delims=" %P in ('node -p "require('./package.json').devDependencies.electron"') do node-gyp install --target=%P --dist-url=https://electronjs.org/headers
REM install dependencies
> npm install
Expand All @@ -119,8 +111,7 @@ Repo: [mishiro-score-viewer](https://github.com/toyobayashi/mishiro-score-viewer
$ cd mishiro/app
$ npm install -g node-gyp
$ npm config set node_gyp "`npm prefix -g`/lib/node_modules/node-gyp/bin/node-gyp.js"
$ node-gyp install --target=$(node -p require\(\'./package.json\'\).devDependencies.electron) --dist-url=https://atom.io/download/electron
$ node-gyp install --target=$(node -p require\(\'./package.json\'\).devDependencies.electron) --dist-url=https://electronjs.org/headers
$ npm install
$ npm run get # get external resources
Expand Down
34 changes: 12 additions & 22 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,23 @@
### Windows 需要

* __Windows 7 以上__
* __Node.js 12+__
* __Python 2.7__`node-gyp` 现在不支持 3.x )
* __Visual Studio 2015/2017/2019 并安装`使用 C++ 的桌面开发`工作负载或 `VC++ v140+ 构建工具集`__
* __.NET 和 Powershell__ (Windows 10 有自带)
* __Node.js 18+__
* __Python 3__
* __Visual Studio 2022 并安装`使用 C++ 的桌面开发`工作负载或 `VC++ v140+ 构建工具集`__
* __.NET 和 Powershell__

### Linux 需要

* __Node.js 12+__
* __Python 2.7__
* __Node.js 18+__
* __Python 3__
* __gcc & g++__
* __make__
* __zip & unzip__

### MacOS 需要 (这部分未测试)

* __Node.js 12+__
* __Python 2.7__
* __Node.js 18+__
* __Python 3__
* __Xcode__ (终端运行 ```xcode-select --install``` 安装Command Line Tools)

### 快速开始
Expand Down Expand Up @@ -78,22 +78,13 @@
> cd mishiro/app
REM 设置国内镜像
> npm config set registry http://registry.npm.taobao.org/
> npm config set electron_mirror https://npm.taobao.org/mirrors/electron/
> npm config set registry https://registry.npmmirror.com/
> npm config set electron_mirror https://registry.npmmirror.com/-/binary/electron/
REM 特别的,如果安装的 VC++ 构建工具集版本不是 v140 (VS 2015)
REM 需要全局设置一下 toolset 变量让 sqlite3 能够编译通过
> npm config set toolset v142
REM 安装 node-gyp@5
> npm install -g node-gyp
REM 这一步很重要,把 npm 内部使用的 node-gyp 设置成全局安装的 node-gyp
REM 新版 node-gyp 的头文件缓存位置和老版本不一样,没有这一步安装原生模块依赖时可能会报找不到头文件的错
> for /f "delims=" %P in ('npm prefix -g') do npm config set node_gyp "%P\node_modules\node-gyp\bin\node-gyp.js"
REM 根据 package.json 中指定的 electron 版本下载对应的头文件
> for /f "delims=" %P in ('node -p "require('./package.json').devDependencies.electron"') do node-gyp install --target=%P --dist-url=https://npm.taobao.org/mirrors/atom-shell
> for /f "delims=" %P in ('node -p "require('./package.json').devDependencies.electron"') do node-gyp install --target=%P --dist-url=https://electronjs.org/headers
REM 安装依赖
> npm install
Expand All @@ -110,8 +101,7 @@
$ npm config set electron_mirror https://registry.npmmirror.com/-/binary/electron/
$ npm install -g node-gyp
$ npm config set node_gyp "`npm prefix -g`/lib/node_modules/node-gyp/bin/node-gyp.js"
$ node-gyp install --target=$(node -p require\(\'./package.json\'\).devDependencies.electron) --dist-url=https://npm.taobao.org/mirrors/atom-shell
$ node-gyp install --target=$(node -p require\(\'./package.json\'\).devDependencies.electron) --dist-url=https://electronjs.org/headers
$ npm install
$ npm run get # 获取开发所需要的额外的资源
Expand Down

0 comments on commit 586be17

Please sign in to comment.