hurl/bin/windows/hurl.nsi

159 lines
4.6 KiB
Plaintext
Raw Normal View History

2021-10-08 10:28:02 +03:00
; includes
2021-03-03 01:07:32 +03:00
!include "MUI2.nsh"
!include "FileFunc.nsh"
2021-03-03 01:07:32 +03:00
; define icons
2022-07-30 05:49:56 +03:00
!define MUI_ICON "..\..\bin\windows\logo.ico"
2021-03-03 01:07:32 +03:00
!define MUI_HEADERIMAGE
2022-07-30 05:49:56 +03:00
!define MUI_HEADERIMAGE_BITMAP "..\..\bin\windows\logo.bmp"
2021-03-03 01:07:32 +03:00
!define MUI_HEADERIMAGE_RIGHT
; define version
!define /file VERSION "version.txt"
; define windows uninstall panel regestry path
!define UNINSTALLPANELKEY "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Hurl"
2021-03-03 01:07:32 +03:00
; The name of the installer
Name "hurl ${VERSION}"
; The file to write
OutFile "hurl-${VERSION}-win64-installer.exe"
2021-03-03 01:07:32 +03:00
; Request application privileges for Windows Vista and higher
RequestExecutionLevel admin
; Build Unicode installer
Unicode False
; The default installation directory
InstallDir $PROGRAMFILES64\hurl
; Start pages
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE ..\..\LICENSE
Page components
Page directory
Page instfiles
; Finish page
!define MUI_FINISHPAGE_LINK 'Click here to visit us at https://hurl.dev/'
!define MUI_FINISHPAGE_LINK_LOCATION https://hurl.dev/
!define MUI_FINISHPAGE_TITLE_3LINES
!define MUI_FINISHPAGE_TITLE "Congratulation, hurl ${VERSION} is ready to use on your favorite windows terminal (cmd and powershell)"
2021-03-03 01:07:32 +03:00
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_LANGUAGE English
UninstPage uninstConfirm
UninstPage instfiles
; The stuff to install
SectionGroup "executables"
Section "hurl.exe"
SectionIn RO
SetOutPath $INSTDIR
File "hurl.exe"
2021-10-08 10:28:02 +03:00
; Write installation dir to user Path variable
EnVar::SetHKCU
2021-10-08 10:28:02 +03:00
EnVar::Check "NULL" "NULL"
EnVar::DeleteValue "Path" "$INSTDIR"
EnVar::AddValue "Path" "$INSTDIR"
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
2021-03-03 01:07:32 +03:00
; Write the uninstall
WriteUninstaller "$INSTDIR\uninstall.exe"
; Write windows uninstall panel information
${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2
IntFmt $0 "0x%08X" $0
2021-12-10 02:20:46 +03:00
WriteRegStr HKLM "${UNINSTALLPANELKEY}" "DisplayName" "Hurl"
WriteRegStr HKLM "${UNINSTALLPANELKEY}" "DisplayVersion" "${VERSION}"
WriteRegStr HKLM "${UNINSTALLPANELKEY}" "DisplayIcon" "$INSTDIR\hurl.exe"
WriteRegStr HKLM "${UNINSTALLPANELKEY}" "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
WriteRegStr HKLM "${UNINSTALLPANELKEY}" "URLUpdateInfo" "https://github.com/Orange-OpenSource/hurl/releases"
WriteRegStr HKLM "${UNINSTALLPANELKEY}" "URLInfoAbout" "https://github.com/Orange-OpenSource/hurl"
WriteRegStr HKLM "${UNINSTALLPANELKEY}" "HelpLink" "https://www.hurl.dev"
WriteRegStr HKLM "${UNINSTALLPANELKEY}" "RegCompany" "Orange-OpenSource"
WriteRegStr HKLM "${UNINSTALLPANELKEY}" "Readme" "$INSTDIR\README.md"
WriteRegStr HKLM "${UNINSTALLPANELKEY}" "NoModify" 1
WriteRegStr HKLM "${UNINSTALLPANELKEY}" "NoRepair" 1
WriteRegStr HKLM "${UNINSTALLPANELKEY}" "InstallLocation" "$INSTDIR"
2022-09-16 11:13:28 +03:00
WriteRegStr HKLM "${UNINSTALLPANELKEY}" "Publisher" "Orange-OpenSource"
WriteRegDWORD HKLM "${UNINSTALLPANELKEY}" "EstimatedSize" "$0"
2021-03-03 01:07:32 +03:00
SectionEnd
Section "hurlfmt.exe"
SectionIn RO
SetOutPath $INSTDIR
File "hurlfmt.exe"
2022-09-16 11:13:28 +03:00
SectionEnd
2021-03-03 01:07:32 +03:00
SectionGroupEnd
SectionGroup "dlls"
Section "charset-1.dll"
SectionIn RO
SetOutPath $INSTDIR
File "charset-1.dll"
SectionEnd
Section "iconv-2.dll"
SectionIn RO
SetOutPath $INSTDIR
File "iconv-2.dll"
SectionEnd
Section "libxml2.dll"
SectionIn RO
SetOutPath $INSTDIR
File "libxml2.dll"
SectionEnd
2022-05-19 17:11:07 +03:00
Section "liblzma.dll"
2021-03-03 01:07:32 +03:00
SectionIn RO
SetOutPath $INSTDIR
2022-05-19 17:11:07 +03:00
File "liblzma.dll"
2021-03-03 01:07:32 +03:00
SectionEnd
Section "zlib1.dll"
SectionIn RO
SetOutPath $INSTDIR
File "zlib1.dll"
2022-09-16 11:13:28 +03:00
SectionEnd
Section "libcurl.dll"
SectionIn RO
SetOutPath $INSTDIR
File "libcurl.dll"
SectionEnd
2021-03-03 01:07:32 +03:00
SectionGroupEnd
SectionGroup "txt"
Section "version.txt"
SectionIn 3
SetOutPath $INSTDIR
File "version.txt"
SectionEnd
Section "README.md"
SectionIn 3
SetOutPath $INSTDIR
File "..\..\README.md"
SectionEnd
Section "CHANGELOG.md"
SectionIn 3
SetOutPath $INSTDIR
File "..\..\CHANGELOG.md"
2022-09-16 11:13:28 +03:00
SectionEnd
2021-03-03 01:07:32 +03:00
Section "LICENSE"
SectionIn 3
SetOutPath $INSTDIR
File "..\..\LICENSE"
2022-09-16 11:13:28 +03:00
SectionEnd
2021-03-03 01:07:32 +03:00
SectionGroupEnd
; Uninstaller
2022-09-16 11:13:28 +03:00
Section "Uninstall"
2021-10-08 10:28:02 +03:00
; Remove installed files
2021-03-03 01:07:32 +03:00
Delete $INSTDIR\*
RMDir "$INSTDIR"
; Remove entry from windows uninstaller panel
DeleteRegKey HKLM "${UNINSTALLPANELKEY}"
2021-10-08 10:28:02 +03:00
; Remove install dir from user Path variable
EnVar::SetHKCU
EnVar::Check "NULL" "NULL"
EnVar::DeleteValue "Path" "$INSTDIR"
SectionEnd