-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from renshengruxi666/master
代码迁移
- Loading branch information
Showing
16 changed files
with
84 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
; 该脚本使用 HM VNISEdit 脚本编辑器向导产生 | ||
; 该脚本使用 HM VNISEdit 脚本编辑器向导产生 | ||
|
||
!include "LogicLib.nsh" | ||
|
||
; 安装程序初始定义常量 | ||
; 安装程序初始定义常量 | ||
!define PRODUCT_NAME "Samurai" | ||
!define PRODUCT_VERSION "0.6.0"; | ||
!define PRODUCT_VERSION "0.6.1"; | ||
!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" | ||
|
@@ -13,56 +13,56 @@ | |
|
||
SetCompressor lzma | ||
|
||
; ------ MUI 现代界面定义 (1.67 版本以上兼容) ------ | ||
; ------ MUI 现代界面定义 (1.67 版本以上兼容) ------ | ||
!include "MUI.nsh" | ||
|
||
; MUI 预定义常量 | ||
; MUI 预定义常量 | ||
!define MUI_ABORTWARNING | ||
!define MUI_ICON "icons\icon.ico" | ||
!define MUI_UNICON "icons\icon.ico" | ||
!define MUI_WELCOMEFINISHPAGE_BITMAP "icons\bg.bmp" | ||
|
||
; 欢迎页面 | ||
; 欢迎页面 | ||
!insertmacro MUI_PAGE_WELCOME | ||
; 许可协议页面 | ||
; 许可协议页面 | ||
!define MUI_LICENSEPAGE_CHECKBOX | ||
!insertmacro MUI_PAGE_LICENSE "softwareLicence.txt" | ||
; 安装目录选择页面 | ||
; 安装目录选择页面 | ||
!insertmacro MUI_PAGE_DIRECTORY | ||
|
||
Page custom SetCustom LeaveCustom ;自定义窗口,选择数据目录 | ||
; 安装过程页面 | ||
Page custom SetCustom LeaveCustom ;自定义窗口,选择数据目录 | ||
; 安装过程页面 | ||
!insertmacro MUI_PAGE_INSTFILES | ||
; 安装完成页面 | ||
; 安装完成页面 | ||
!define MUI_FINISHPAGE_RUN "$INSTDIR\Samurai.exe" | ||
!insertmacro MUI_PAGE_FINISH | ||
|
||
; 安装卸载过程页面 | ||
; 安装卸载过程页面 | ||
!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 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 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 UninstInfo ${LANG_SimpChinese} "您确实要完全移除 $(^Name) ,及其所有的组件?" | ||
LangString UninstSuccess ${LANG_ENGLISH} "Has been successfully removed from your computer." | ||
LangString UninstSuccess ${LANG_SimpChinese} "已成功地从你的计算机移除。" | ||
LangString UninstSuccess ${LANG_SimpChinese} "已成功地从你的计算机移除。" | ||
LangString closeInfo ${LANG_ENGLISH} "${PRODUCT_NAME} is running, click OK to close." | ||
LangString closeInfo ${LANG_SimpChinese} "${PRODUCT_NAME} 正在运行,点击OK关闭." | ||
LangString closeInfo ${LANG_SimpChinese} "${PRODUCT_NAME} 正在运行,点击OK关闭." | ||
LangString openFileInfo ${LANG_ENGLISH} "Opening leftover data directories(backup before deleting!)" | ||
LangString openFileInfo ${LANG_SimpChinese} "打开剩余的数据目录(删除前注意备份)" | ||
LangString openFileInfo ${LANG_SimpChinese} "打开剩余的数据目录(删除前注意备份)" | ||
|
||
; 安装预释放文件 | ||
; 安装预释放文件 | ||
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS | ||
!insertmacro MUI_RESERVEFILE_LANGDLL | ||
; ------ MUI 现代界面定义结束 ------ | ||
; ------ MUI 现代界面定义结束 ------ | ||
|
||
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}" | ||
OutFile "..\dist\${PRODUCT_NAME}-windows-x86_64-${PRODUCT_VERSION}.exe" | ||
|
@@ -72,7 +72,7 @@ ShowInstDetails show | |
ShowUnInstDetails show | ||
BrandingText "$(brandingText) ${PRODUCT_NAME} ${PRODUCT_VERSION}" | ||
|
||
; 激活安装日志记录,该日志文件将会作为卸载文件的依据(注意,本区段必须放置在所有区段之前) | ||
; 激活安装日志记录,该日志文件将会作为卸载文件的依据(注意,本区段必须放置在所有区段之前) | ||
Section "-LogSetOn" | ||
LogSet on | ||
SectionEnd | ||
|
@@ -130,21 +130,21 @@ FunctionEnd | |
|
||
;Function .onInstSuccess | ||
; ReadINIStr $0 "$PLUGINSDIR\setup.ini" "Field 2" State | ||
; MessageBox MB_OK "存储PlatON区块数据及Keystore文件的2222位置为:$0" | ||
; MessageBox MB_OK "存储PlatON区块数据及Keystore文件的2222位置为:$0" | ||
; FileOpen $1 "C:\test\test.txt" w | ||
; FileWrite $1 'load("test.il" "test")\r$\n' | ||
; FileClose $1 | ||
; FunctionEnd | ||
|
||
Function SetCustom | ||
; 判断勾选的组件,并把未勾选组件的安装路径控件设为不可用 | ||
; 判断勾选的组件,并把未勾选组件的安装路径控件设为不可用 | ||
SectionGetFlags ${SecA} $0 | ||
StrCmp $0 0 0 +2 | ||
WriteINIStr "$PLUGINSDIR\setup.ini" "Field 2" "Flags" "" | ||
StrCmp $0 1 0 +2 ; 如果组件勾选了,还需要去掉 Disabled,这两行代码不能省略 | ||
StrCmp $0 1 0 +2 ; 如果组件勾选了,还需要去掉 Disabled,这两行代码不能省略 | ||
WriteINIStr "$PLUGINSDIR\setup.ini" "Field 2" "Flags" "" | ||
|
||
; 预定义组件安装路径 | ||
; 预定义组件安装路径 | ||
WriteINIStr "$PLUGINSDIR\setup.ini" "Field 2" "State" "$APPDATA\Samurai" | ||
|
||
InstallOptions::initDialog /NOUNLOAD "$PLUGINSDIR\setup.ini" | ||
|
@@ -158,7 +158,7 @@ Function LeaveCustom | |
|
||
ReadINIStr $0 "$PLUGINSDIR\setup.ini" "Field 2" "State" | ||
StrCmp $0 "" +2 | ||
; 判断用户输入的路径是否合法。 | ||
; 判断用户输入的路径是否合法。 | ||
; IfFileExists "$0\*" +3 | ||
; MessageBox MB_OK|MB_ICONSTOP "Invalid path!" | ||
; Abort | ||
|
@@ -167,10 +167,10 @@ FunctionEnd | |
|
||
|
||
/****************************** | ||
* 以下是安装程序的卸载部分 * | ||
* 以下是安装程序的卸载部分 * | ||
******************************/ | ||
|
||
; 根据安装日志卸载文件的调用宏 | ||
; 根据安装日志卸载文件的调用宏 | ||
!macro DelFileByLog LogFile | ||
ifFileExists `${LogFile}` 0 +4 | ||
Push `${LogFile}` | ||
|
@@ -181,10 +181,10 @@ FunctionEnd | |
Section Uninstall | ||
Delete "$INSTDIR\${PRODUCT_NAME}.url" | ||
|
||
; 调用宏只根据安装日志卸载安装程序自己安装过的文件 | ||
; 调用宏只根据安装日志卸载安装程序自己安装过的文件 | ||
!insertmacro DelFileByLog "$INSTDIR\install.log" | ||
|
||
; 清除安装程序创建的且在卸载时可能为空的子目录,对于递归添加的文件目录,请由最内层的子目录开始清除(注意,不要带 /r 参数,否则会失去 DelFileByLog 的意义) | ||
; 清除安装程序创建的且在卸载时可能为空的子目录,对于递归添加的文件目录,请由最内层的子目录开始清除(注意,不要带 /r 参数,否则会失去 DelFileByLog 的意义) | ||
RMDir "$SMPROGRAMS\Samurai" | ||
RMDir "$INSTDIR\resources\app.asar.unpacked" | ||
RMDir "$INSTDIR\resources" | ||
|
@@ -197,7 +197,7 @@ Section Uninstall | |
SetAutoClose true | ||
SectionEnd | ||
|
||
#-- 根据 NSIS 脚本编辑规则,所有 Function 区段必须放置在 Section 区段之后编写,以避免安装程序出现未可预知的问题。--# | ||
#-- 根据 NSIS 脚本编辑规则,所有 Function 区段必须放置在 Section 区段之后编写,以避免安装程序出现未可预知的问题。--# | ||
|
||
Function un.onInit | ||
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "$(UninstInfo)" IDYES +2 | ||
|
@@ -224,7 +224,7 @@ Function un.onUninstSuccess | |
ExecShell explore $0 | ||
FunctionEnd | ||
|
||
; 以下是卸载程序通过安装日志卸载文件的专用函数,请不要随意修改 | ||
; 以下是卸载程序通过安装日志卸载文件的专用函数,请不要随意修改 | ||
Function un.DelFileByLog | ||
Exch $R0 | ||
Push $R1 | ||
|
Oops, something went wrong.