Skip to content

Commit a5fe357

Browse files
Merge pull request #79 from MakinoharaShoko/dev
4.4
2 parents 1730118 + c470bf3 commit a5fe357

39 files changed

+13050
-3696
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
node_modules
22
.idea
3-
3+
.vscode
44
release
5+
bundle

assets/nsis.ico

10.5 KB
Binary file not shown.

assets/warning.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Don't use ico file renamed by bmp file. It'll make error.

installer.nsi

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
; 依赖
2+
!include MUI2.nsh
3+
4+
5+
; 变量
6+
7+
8+
; 常量
9+
!define NAME "WebGal_Terre"
10+
!define VERSION "2.3.15" ; 版本号变量
11+
!define PRODUCT_VERSION "${VERSION}.0"
12+
!define COPYRIGHT "Mahiru - https://github.com/MakinoharaShoko" ; 版权信息
13+
!define ICON_PATH ".\assets\nsis.ico"
14+
!define UNINSTALL_KEY "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall${NAME}" ; 软件注册
15+
!define RELEASE_PATH ".\release" ; 构建文件所在位置
16+
17+
18+
; 安装信息
19+
Name "${NAME} v${version} Setup" ; 安装程序名称
20+
OutFile "./bundle/WebGal_Terre_Setup.exe" ; 安装包输出路径
21+
; 图标
22+
Icon "${ICON_PATH}"
23+
!define MUI_ICON "${ICON_PATH}"
24+
!define MUI_UNICON "${ICON_PATH}"
25+
!define MUI_ABORTWARNING ; 退出时警告
26+
; 默认安装路径
27+
InstallDir "$PROGRAMFILES\${NAME}"
28+
29+
; 版本信息
30+
VIAddVersionKey ProductName "${NAME} Installer" ; product name
31+
VIAddVersionKey ProductVersion "${VERSION}" ; product version
32+
VIAddVersionKey Comments "${NAME} is WebGal's web graphics editor." ; description
33+
VIAddVersionKey LegalCopyright "${COPYRIGHT}" ; copyright
34+
VIAddVersionKey FileVersion "${VERSION}" ; file version
35+
VIAddVersionKey FileDescription "${NAME} Installer" ; file description
36+
VIProductVersion "${PRODUCT_VERSION}" ; product verion(actual replace FileVersion)
37+
38+
39+
; Welcome page
40+
!insertmacro MUI_PAGE_WELCOME
41+
42+
; License page
43+
!insertmacro MUI_PAGE_LICENSE ".\LICENSE"
44+
45+
; Directory page
46+
!insertmacro MUI_PAGE_DIRECTORY
47+
48+
; Instfiles page
49+
!insertmacro MUI_PAGE_INSTFILES
50+
51+
; Finish page
52+
!insertmacro MUI_PAGE_FINISH
53+
54+
; Uninstaller pages
55+
!insertmacro MUI_UNPAGE_INSTFILES
56+
57+
Section -Install
58+
SetOutPath $INSTDIR
59+
60+
; 可覆写情况
61+
SetOverwrite ifnewer
62+
63+
; 卸载程序
64+
WriteUninstaller "$INSTDIR\uninstall.exe"
65+
66+
; 安装包内文件
67+
File /r "${RELEASE_PATH}\*.*"
68+
69+
; 快捷方式
70+
CreateShortCut "$DESKTOP\${NAME}.lnk" "$INSTDIR\${NAME}.exe"
71+
72+
; 开始菜单
73+
CreateShortCut "$SMPROGRAMS\${NAME}.lnk" "$INSTDIR\${NAME}.exe"
74+
75+
; Register the installed software
76+
WriteRegStr HKLM "${UNINSTALL_KEY}" "DisplayName" "${Name}"
77+
WriteRegStr HKLM "${UNINSTALL_KEY}" "InstallDir" "$INSTDIR"
78+
WriteRegStr HKLM "${UNINSTALL_KEY}" "UninstallString" "$INSTDIR\uninstall.exe"
79+
WriteRegStr HKLM "${UNINSTALL_KEY}" "DisplayIcon" "$INSTDIR\resources\uninstallerIcon.ico"
80+
WriteRegStr HKLM "${UNINSTALL_KEY}" "DisplayVersion" "${VERSION}"
81+
SectionEnd
82+
83+
84+
Section -Uninstall
85+
RMDir /r "$INSTDIR\"
86+
87+
; delete Desktop icon
88+
Delete "$DESKTOP\${NAME}.lnk"
89+
90+
; delete start menu folder
91+
Delete "$SMPROGRAMS\${NAME}.lnk"
92+
93+
; delete reg item
94+
DeleteRegKey HKLM "${UNINSTALL_KEY}"
95+
SectionEnd
96+
97+
; languages
98+
!insertmacro MUI_LANGUAGE "English"
99+
!insertmacro MUI_LANGUAGE "SimpChinese"
100+
101+
102+
; 初始化函数
103+
Function .onInit
104+
FunctionEnd

0 commit comments

Comments
 (0)