127 lines
3.7 KiB
Plaintext
127 lines
3.7 KiB
Plaintext
!include "MUI2.nsh"
|
|
|
|
;--------------------------------
|
|
|
|
; The name of the installer
|
|
Name "Univerxel"
|
|
|
|
Icon "../resource/package/univerxel.ico"
|
|
|
|
; Request application privileges for Windows Vista and higher
|
|
RequestExecutionLevel user
|
|
|
|
; Build Unicode installer
|
|
Unicode True
|
|
|
|
SetCompressor /SOLID LZMA
|
|
|
|
; The default installation directory
|
|
InstallDir $LOCALAPPDATA\Univerxel
|
|
|
|
; Registry key to check for directory (so if you install again, it will
|
|
; overwrite the old one automatically)
|
|
InstallDirRegKey HKLM "Software\Univerxel" "Install_Dir"
|
|
|
|
VIAddVersionKey "CompanyName" "Shu"
|
|
VIAddVersionKey "FileDescription" "Univerxel installer"
|
|
VIAddVersionKey "ProductName" "Univerxel installer"
|
|
VIAddVersionKey "LegalCopyright" "MIT - Shu"
|
|
VIAddVersionKey "FileVersion" "0.0.1"
|
|
VIProductVersion "0.0.1.1"
|
|
|
|
OutFile "Univerxel-installer.exe"
|
|
|
|
;--------------------------------
|
|
|
|
; Pages
|
|
|
|
!define MUI_ABORTWARNING
|
|
|
|
!insertmacro MUI_PAGE_COMPONENTS
|
|
!insertmacro MUI_PAGE_DIRECTORY
|
|
!insertmacro MUI_PAGE_INSTFILES
|
|
|
|
!insertmacro MUI_UNPAGE_CONFIRM
|
|
!insertmacro MUI_UNPAGE_INSTFILES
|
|
|
|
!insertmacro MUI_LANGUAGE "English"
|
|
|
|
;--------------------------------
|
|
|
|
; The stuff to install
|
|
Section "Dependencies"
|
|
SectionIn RO
|
|
SetOutPath $INSTDIR
|
|
File "package\libcrypto-1_1-x64.dll"
|
|
File "package\openssl-license.txt"
|
|
|
|
; Write the installation path into the registry
|
|
WriteRegStr HKLM SOFTWARE\Univerxel "Install_Dir" "$INSTDIR"
|
|
|
|
; Write the uninstall keys for Windows
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Univerxel" "DisplayName" "Univerxel"
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Univerxel" "UninstallString" '"$INSTDIR\uninstall.exe"'
|
|
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Univerxel" "NoModify" 1
|
|
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Univerxel" "NoRepair" 1
|
|
WriteUninstaller "$INSTDIR\uninstall.exe"
|
|
CreateDirectory "$SMPROGRAMS\Univerxel"
|
|
SectionEnd
|
|
Section "All in one"
|
|
SetOutPath $INSTDIR
|
|
File "Release\univerxel.exe"
|
|
File /r content
|
|
SetOverwrite off
|
|
File /oname=config.toml "..\resource\package\config.full.toml"
|
|
SetOverwrite on
|
|
CreateShortcut "$SMPROGRAMS\Univerxel\Univerxel (Full).lnk" "$INSTDIR\univerxel.exe"
|
|
SectionEnd
|
|
Section /o "Client"
|
|
SetOutPath $INSTDIR
|
|
File "Release\univerxel-client.exe"
|
|
File /r /x *.pem /x *.dict content
|
|
SetOverwrite off
|
|
File /oname=config.toml "..\resource\package\config.client.toml"
|
|
SetOverwrite on
|
|
CreateShortcut "$SMPROGRAMS\Univerxel\Univerxel (Client).lnk" "$INSTDIR\univerxel-client.exe"
|
|
SectionEnd
|
|
Section /o "Server"
|
|
SetOutPath $INSTDIR
|
|
File "Release\univerxel-server.exe"
|
|
CreateDirectory "$INSTDIR\content"
|
|
File /oname=content\cert.pem content\cert.pem
|
|
File /oname=content\key.pem content\key.pem
|
|
File /oname=content\zstd.dict content\zstd.dict
|
|
SetOverwrite off
|
|
File /oname=config.toml "..\resource\package\config.server.toml"
|
|
SetOverwrite on
|
|
CreateShortcut "$SMPROGRAMS\Univerxel\Univerxel (Server).lnk" "$INSTDIR\univerxel-server.exe"
|
|
SectionEnd
|
|
|
|
;--------------------------------
|
|
|
|
; Uninstaller
|
|
|
|
Section "Uninstall"
|
|
|
|
; Remove registry keys
|
|
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Univerxel"
|
|
DeleteRegKey HKLM SOFTWARE\Univerxel
|
|
|
|
; Remove files and uninstaller
|
|
Delete "$INSTDIR\libcrypto-1_1-x64.dll"
|
|
Delete "$INSTDIR\openssl-license.txt"
|
|
Delete "$INSTDIR\univerxel.exe"
|
|
Delete "$INSTDIR\univerxel-client.exe"
|
|
Delete "$INSTDIR\univerxel-server.exe"
|
|
RMDir /r "$INSTDIR\content"
|
|
Delete "$INSTDIR\uninstall.exe"
|
|
|
|
; Remove shortcuts, if any
|
|
Delete "$SMPROGRAMS\Univerxel\*.lnk"
|
|
|
|
; Remove directories
|
|
RMDir /r "$SMPROGRAMS\Univerxel"
|
|
RMDir /r "$INSTDIR"
|
|
|
|
SectionEnd
|