Skip to content

Commit

Permalink
Merge pull request #79 from MakinoharaShoko/dev
Browse files Browse the repository at this point in the history
4.4
  • Loading branch information
MakinoharaShoko authored Jul 3, 2023
2 parents 1730118 + c470bf3 commit a5fe357
Show file tree
Hide file tree
Showing 39 changed files with 13,050 additions and 3,696 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
.idea

.vscode
release
bundle
Binary file added assets/nsis.ico
Binary file not shown.
1 change: 1 addition & 0 deletions assets/warning.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Don't use ico file renamed by bmp file. It'll make error.
104 changes: 104 additions & 0 deletions installer.nsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
; 依赖
!include MUI2.nsh


; 变量


; 常量
!define NAME "WebGal_Terre"
!define VERSION "2.3.15" ; 版本号变量
!define PRODUCT_VERSION "${VERSION}.0"
!define COPYRIGHT "Mahiru - https://github.com/MakinoharaShoko" ; 版权信息
!define ICON_PATH ".\assets\nsis.ico"
!define UNINSTALL_KEY "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall${NAME}" ; 软件注册
!define RELEASE_PATH ".\release" ; 构建文件所在位置


; 安装信息
Name "${NAME} v${version} Setup" ; 安装程序名称
OutFile "./bundle/WebGal_Terre_Setup.exe" ; 安装包输出路径
; 图标
Icon "${ICON_PATH}"
!define MUI_ICON "${ICON_PATH}"
!define MUI_UNICON "${ICON_PATH}"
!define MUI_ABORTWARNING ; 退出时警告
; 默认安装路径
InstallDir "$PROGRAMFILES\${NAME}"

; 版本信息
VIAddVersionKey ProductName "${NAME} Installer" ; product name
VIAddVersionKey ProductVersion "${VERSION}" ; product version
VIAddVersionKey Comments "${NAME} is WebGal's web graphics editor." ; description
VIAddVersionKey LegalCopyright "${COPYRIGHT}" ; copyright
VIAddVersionKey FileVersion "${VERSION}" ; file version
VIAddVersionKey FileDescription "${NAME} Installer" ; file description
VIProductVersion "${PRODUCT_VERSION}" ; product verion(actual replace FileVersion)


; Welcome page
!insertmacro MUI_PAGE_WELCOME

; License page
!insertmacro MUI_PAGE_LICENSE ".\LICENSE"

; Directory page
!insertmacro MUI_PAGE_DIRECTORY

; Instfiles page
!insertmacro MUI_PAGE_INSTFILES

; Finish page
!insertmacro MUI_PAGE_FINISH

; Uninstaller pages
!insertmacro MUI_UNPAGE_INSTFILES

Section -Install
SetOutPath $INSTDIR

; 可覆写情况
SetOverwrite ifnewer

; 卸载程序
WriteUninstaller "$INSTDIR\uninstall.exe"

; 安装包内文件
File /r "${RELEASE_PATH}\*.*"

; 快捷方式
CreateShortCut "$DESKTOP\${NAME}.lnk" "$INSTDIR\${NAME}.exe"

; 开始菜单
CreateShortCut "$SMPROGRAMS\${NAME}.lnk" "$INSTDIR\${NAME}.exe"

; Register the installed software
WriteRegStr HKLM "${UNINSTALL_KEY}" "DisplayName" "${Name}"
WriteRegStr HKLM "${UNINSTALL_KEY}" "InstallDir" "$INSTDIR"
WriteRegStr HKLM "${UNINSTALL_KEY}" "UninstallString" "$INSTDIR\uninstall.exe"
WriteRegStr HKLM "${UNINSTALL_KEY}" "DisplayIcon" "$INSTDIR\resources\uninstallerIcon.ico"
WriteRegStr HKLM "${UNINSTALL_KEY}" "DisplayVersion" "${VERSION}"
SectionEnd


Section -Uninstall
RMDir /r "$INSTDIR\"

; delete Desktop icon
Delete "$DESKTOP\${NAME}.lnk"

; delete start menu folder
Delete "$SMPROGRAMS\${NAME}.lnk"

; delete reg item
DeleteRegKey HKLM "${UNINSTALL_KEY}"
SectionEnd

; languages
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "SimpChinese"


; 初始化函数
Function .onInit
FunctionEnd
Loading

0 comments on commit a5fe357

Please sign in to comment.