Skip to content

Commit

Permalink
Merge pull request #18 from bluegene1/master
Browse files Browse the repository at this point in the history
0.6.0 release.
  • Loading branch information
danielgogo authored Apr 25, 2019
2 parents 36b7ac4 + 05a502a commit 4de95e0
Show file tree
Hide file tree
Showing 284 changed files with 12,010 additions and 7,489 deletions.
63 changes: 42 additions & 21 deletions build/build.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

; 安装程序初始定义常量
!define PRODUCT_NAME "Samurai"
!define PRODUCT_VERSION " 0.3.0.9"; 加版本号,开头多加一个空格!
!define PRODUCT_VERSION "0.6.0";
!define PRODUCT_PUBLISHER "www.platon.network<[email protected]>"
!define PRODUCT_WEB_SITE "https://www.platon.network"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\Samurai.exe"
Expand Down Expand Up @@ -41,20 +41,36 @@ Page custom SetCustom LeaveCustom ;
!insertmacro MUI_UNPAGE_INSTFILES

; 安装界面包含的语言设置

!insertmacro MUI_LANGUAGE "English"

!insertmacro MUI_LANGUAGE "SimpChinese"

LangString brandingText ${LANG_ENGLISH} "Install System:"
LangString brandingText ${LANG_SimpChinese} "Install System:"
LangString instInfo ${LANG_ENGLISH} "The installer detected that $(^Name) is running. Need to stop and uninstall it to proceed with the new installation. Do you want to uninstall it now?"
LangString instInfo ${LANG_SimpChinese} "安装程序检测到 $(^Name) 正在运行,您必须将其卸载才能进行下一步安装,是否现在进行卸载?"
LangString selectLocation ${LANG_ENGLISH} "Please select a location to store the block data and the keystore file."
LangString selectLocation ${LANG_SimpChinese} "请选择存储区块数据及Keystore文件的位置."
LangString UninstInfo ${LANG_ENGLISH} "Are you sure you want to completely remove $(^Name) and all its components?"
LangString UninstInfo ${LANG_SimpChinese} "您确实要完全移除 $(^Name) ,及其所有的组件?"
LangString UninstSuccess ${LANG_ENGLISH} "Has been successfully removed from your computer."
LangString UninstSuccess ${LANG_SimpChinese} "已成功地从你的计算机移除。"
LangString closeInfo ${LANG_ENGLISH} "${PRODUCT_NAME} is running, click OK to close."
LangString closeInfo ${LANG_SimpChinese} "${PRODUCT_NAME} 正在运行,点击OK关闭."
LangString openFileInfo ${LANG_ENGLISH} "Opening leftover data directories(backup before deleting!)"
LangString openFileInfo ${LANG_SimpChinese} "打开剩余的数据目录(删除前注意备份)"

; 安装预释放文件
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
!insertmacro MUI_RESERVEFILE_LANGDLL
; ------ MUI 现代界面定义结束 ------

Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "..\dist\${PRODUCT_NAME}-windows-amd64${PRODUCT_VERSION}.exe"
OutFile "..\dist\${PRODUCT_NAME}-windows-x86_64-${PRODUCT_VERSION}.exe"
InstallDir "$PROGRAMFILES\Samurai"
InstallDirRegKey HKLM "${PRODUCT_UNINST_KEY}" "UninstallString"
ShowInstDetails show
ShowUnInstDetails show
BrandingText "$(brandingText) ${PRODUCT_NAME} ${PRODUCT_VERSION}"

; 激活安装日志记录,该日志文件将会作为卸载文件的依据(注意,本区段必须放置在所有区段之前)
Section "-LogSetOn"
Expand All @@ -65,10 +81,9 @@ Section "Samurai"
ReadRegStr $R2 HKLM "${PRODUCT_UNINST_KEY}" "UninstallString"
StrCmp $R2 "" NO YES
YES:
MessageBox MB_ICONQuESTION|MB_YESNO "The installer detected that Samurai is running. Need to stop and uninstall it to proceed with the new installation. Do you want to uninstall it now?" IDYES keep IDNO none
MessageBox MB_ICONQuESTION|MB_YESNO "$(instInfo)" IDYES keep IDNO none
keep:
ExecWait $R2

none:
Quit
NO:
Expand Down Expand Up @@ -125,15 +140,15 @@ Function SetCustom
; 判断勾选的组件,并把未勾选组件的安装路径控件设为不可用
SectionGetFlags ${SecA} $0
StrCmp $0 0 0 +2
WriteINIStr "$PLUGINSDIR\setup.ini" "Field 2" "Flags" "Disabled"
WriteINIStr "$PLUGINSDIR\setup.ini" "Field 2" "Flags" ""
StrCmp $0 1 0 +2 ; 如果组件勾选了,还需要去掉 Disabled,这两行代码不能省略
WriteINIStr "$PLUGINSDIR\setup.ini" "Field 2" "Flags" "Disabled"
WriteINIStr "$PLUGINSDIR\setup.ini" "Field 2" "Flags" ""

; 预定义组件安装路径
WriteINIStr "$PLUGINSDIR\setup.ini" "Field 2" "State" "$APPDATA\Samurai"

InstallOptions::initDialog /NOUNLOAD "$PLUGINSDIR\setup.ini"
!insertmacro MUI_HEADER_TEXT "Please select a location to store the block data and the keystore file." ""
!insertmacro MUI_HEADER_TEXT "$(selectLocation)" ""
InstallOptions::show
Pop $R0

Expand Down Expand Up @@ -179,28 +194,34 @@ Section Uninstall
RMDir "$INSTDIR"

DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
SetAutoClose true
SectionEnd

#-- 根据 NSIS 脚本编辑规则,所有 Function 区段必须放置在 Section 区段之后编写,以避免安装程序出现未可预知的问题。--#

Function un.onInit
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all its components?" IDYES +2
Abort
;检测程序是否运行
FindProcDLL::FindProc "Samurai.exe"
Pop $R0
IntCmp $R0 1 0 no_run
MessageBox MB_ICONSTOP "卸载程序检测到 ${PRODUCT_NAME} 正在运行,请关闭之后再卸载!"
Quit
no_run:
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "$(UninstInfo)" IDYES +2
Abort
CheckProc:
killer::IsProcessRunning "Samurai.exe"
Pop $R0
IntCmp $R0 1 0 no_run
MessageBox MB_ICONEXCLAMATION|MB_OKCANCEL "$(closeInfo)" IDYES kill IDNO none
kill:
killer::KillProcess "Samurai.exe"
Sleep 1000
Goto CheckProc
none:
Quit
no_run:
FunctionEnd

Function un.onUninstSuccess
MessageBox MB_ICONINFORMATION|MB_OK "Opening leftover data directories(backup before deleting!)" IDOK ok
ReadRegStr $0 HKLM "${PRODUCT_DIR_REGKEY}" "UserDataPath"
DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
MessageBox MB_ICONINFORMATION|MB_OK "$(openFileInfo)" IDOK ok
ok:
ExecShell explore "$APPDATA\Samurai"
ExecShell explore $0
FunctionEnd

; 以下是卸载程序通过安装日志卸载文件的专用函数,请不要随意修改
Expand Down
28 changes: 17 additions & 11 deletions build/config.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,32 @@
"include_dirs": [],
"libraries": [],
"msbuild_toolset": "v141",
"msvs_windows_target_platform_version": "10.0.17134.0"
"msvs_windows_target_platform_version": "10.0.17763.0"
},
"variables": {
"asan": 0,
"build_v8_with_gn": "false",
"coverage": "false",
"debug_devtools": "node",
"debug_http2": "false",
"debug_nghttp2": "false",
"enable_lto": "false",
"enable_pgo_generate": "false",
"enable_pgo_use": "false",
"force_dynamic_crt": 0,
"host_arch": "x64",
"icu_data_file": "icudt60l.dat",
"icu_data_in": "..\\..\\deps/icu-small\\source/data/in\\icudt60l.dat",
"icu_data_in": "..\\..\\deps/icu-small\\source/data/in\\icudt62l.dat",
"icu_endianness": "l",
"icu_gyp_path": "tools/icu/icu-generic.gyp",
"icu_locales": "en,root",
"icu_path": "deps/icu-small",
"icu_small": "true",
"icu_ver_major": "60",
"icu_ver_major": "62",
"nasm_version": "2.14",
"node_byteorder": "little",
"node_debug_lib": "false",
"node_enable_d8": "false",
"node_enable_v8_vtunejit": "false",
"node_install_npm": "true",
"node_module_version": 57,
"node_module_version": 64,
"node_no_browser_globals": "false",
"node_prefix": "/usr/local",
"node_release_urlbase": "https://nodejs.org/download/release/",
Expand All @@ -45,14 +48,16 @@
"node_use_bundled_v8": "true",
"node_use_dtrace": "false",
"node_use_etw": "true",
"node_use_lttng": "false",
"node_use_large_pages": "false",
"node_use_openssl": "true",
"node_use_pch": "false",
"node_use_perfctr": "true",
"node_use_v8_platform": "true",
"node_with_ltcg": "true",
"node_without_node_options": "false",
"openssl_fips": "",
"openssl_no_asm": 0,
"shlib_suffix": "so.57",
"shlib_suffix": "so.64",
"target_arch": "x64",
"v8_enable_gdbjit": 0,
"v8_enable_i18n_support": 1,
Expand All @@ -62,10 +67,11 @@
"v8_promise_internal_field_count": 1,
"v8_random_seed": 0,
"v8_trace_maps": 0,
"v8_typed_array_max_size_in_heap": 0,
"v8_use_snapshot": "true",
"want_separate_host_toolset": 0,
"nodedir": "C:\\Users\\yann_liang\\.node-gyp\\8.12.0",
"nodedir": "C:\\Users\\yann_liang\\.node-gyp\\10.15.3",
"standalone_static_library": 1,
"msbuild_path": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\MSBuild\\15.0\\Bin\\MSBuild.exe"
"msbuild_path": "D:\\Microsoft Visual Studio\\2017\\BuildTools\\MSBuild\\15.0\\Bin\\MSBuild.exe"
}
}
2 changes: 1 addition & 1 deletion build/webpack.renderer.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const HtmlWebpackPlugin = require('html-webpack-plugin')
* that provide pure *.vue files that need compiling
* https://simulatedgreg.gitbooks.io/electron-vue/content/en/webpack-configurations.html#white-listing-externals
*/
let whiteListedModules = ['vue']
let whiteListedModules = ['vue','element-ui']

let rendererConfig = {
devtool: '#cheap-module-eval-source-map',
Expand Down
32 changes: 22 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"name": "Samurai",
"version": "0.3.9",
"version": "0.6.0",
"author": "www.platon.network<[email protected]>",
"description": "Samurai钱包客户端",
"license": null,
"main": "./dist/electron/main.js",
"homepage": "https://www.platon.network/",
"scripts": {
"win": "node build/build.js && electron-builder -w --x64",
"win": "node build/build.js && electron-builder -w --x64 -p onTag",
"mac": "node build/build.js && electron-builder --mac --arch=x64 ",
"linux": "node build/build.js && electron-builder --linux tar.xz",
"build": "node build/build.js && electron-builder",
"build:dir": "node build/build.js && electron-builder --dir",
"build": "node build/build.js && electron-builder -p onTag",
"build:dir": "node build/build.js && electron-builder --dir -p onTag",
"build:clean": "cross-env BUILD_TARGET=clean node build/build.js",
"build:web": "cross-env BUILD_TARGET=web node build/build.js",
"dev": "node build/dev-runner.js",
Expand All @@ -22,7 +22,7 @@
},
"build": {
"productName": "Samurai",
"buildVersion": "0.3.0.9",
"buildVersion": "0.6.0",
"appId": "org.simulatedgreg.electron-vue",
"directories": {
"output": "dist"
Expand All @@ -39,8 +39,8 @@
]
},
{
"from": "src/services/demo1/",
"to": "demo1",
"from": "src/services/buildInContract/",
"to": "buildInContract",
"filter": []
}
],
Expand Down Expand Up @@ -78,6 +78,12 @@
"to": "platon_exe",
"filter": []
}
],
"publish": [
{
"provider": "generic",
"url": "https://download.platon.network/0.6"
}
]
},
"linux": {
Expand Down Expand Up @@ -106,12 +112,17 @@
"bignumber": "^1.1.0",
"bignumber.js": "^8.0.1",
"console-utility": "git+ssh://http://luchenqun:[email protected]/Juzix-ethereum/console-utility.git#develop",
"crypto": "^1.0.1",
"crypto-js": "^3.1.9-1",
"decimal.js": "^10.0.1",
"electron-updater": "^4.0.8",
"element-ui": "^1.4.3",
"ethereumjs-tx": "^1.3.7",
"jssha": "^2.3.1",
"keythereum": "^1.0.4",
"less": "^2.7.2",
"less-loader": "^4.0.5",
"lodash": "^4.17.11",
"mddir": "^1.1.1",
"node-loader": "^0.6.0",
"node-uuid": "^1.4.8",
Expand All @@ -122,7 +133,7 @@
"vue-qr": "^1.5.2",
"vue-router": "^2.5.3",
"vuex": "^2.3.1",
"web3": "git+ssh://[email protected]:PlatON/client-sdk-js.git#0.3.0_dev"
"web3": "git+ssh://[email protected]:PlatON/client-sdk-js.git#0.5.0_dev"
},
"devDependencies": {
"babel-core": "^6.22.1",
Expand All @@ -140,16 +151,17 @@
"del": "^2.2.1",
"devtron": "^1.1.0",
"electron": "^3.1.0",
"electron-builder": "^20.38.4",
"electron-builder": "^20.34.0",
"electron-debug": "^1.4.0",
"electron-devtools-installer": "^2.0.1",
"electron-devtools-installer": "^2.2.4",
"extract-text-webpack-plugin": "^2.0.0-beta.4",
"file-loader": "^0.11.1",
"html-webpack-plugin": "^2.30.1",
"json-loader": "^0.5.4",
"less": "^2.7.2",
"less-loader": "^4.0.5",
"multispinner": "^0.2.1",
"sha3": "^2.0.0",
"style-loader": "^0.18.1",
"url-loader": "^0.5.7",
"vue-html-loader": "^1.2.2",
Expand Down
Loading

0 comments on commit 4de95e0

Please sign in to comment.