2014-05-07 22:27:00 +00:00
|
|
|
; NSIS installer script for mosquitto
|
|
|
|
|
2015-05-07 13:19:59 +00:00
|
|
|
!include "MUI2.nsh"
|
|
|
|
!include "nsDialogs.nsh"
|
|
|
|
!include "LogicLib.nsh"
|
2014-05-07 22:27:00 +00:00
|
|
|
|
|
|
|
; For environment variable code
|
|
|
|
!include "WinMessages.nsh"
|
|
|
|
!define env_hklm 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"'
|
|
|
|
|
2018-08-16 12:24:07 +00:00
|
|
|
Name "Eclipse Mosquitto"
|
2021-11-17 00:26:03 +00:00
|
|
|
!define VERSION 2.0.14
|
2015-09-22 14:29:56 +00:00
|
|
|
OutFile "mosquitto-${VERSION}-install-windows-x86.exe"
|
2014-05-07 22:27:00 +00:00
|
|
|
|
|
|
|
InstallDir "$PROGRAMFILES\mosquitto"
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
; Installer pages
|
|
|
|
!insertmacro MUI_PAGE_WELCOME
|
2015-05-07 13:19:59 +00:00
|
|
|
|
2019-03-05 14:10:51 +00:00
|
|
|
!insertmacro MUI_PAGE_COMPONENTS
|
2014-05-07 22:27:00 +00:00
|
|
|
!insertmacro MUI_PAGE_DIRECTORY
|
|
|
|
!insertmacro MUI_PAGE_INSTFILES
|
|
|
|
!insertmacro MUI_PAGE_FINISH
|
|
|
|
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
; Uninstaller pages
|
|
|
|
!insertmacro MUI_UNPAGE_WELCOME
|
|
|
|
!insertmacro MUI_UNPAGE_CONFIRM
|
|
|
|
!insertmacro MUI_UNPAGE_INSTFILES
|
|
|
|
!insertmacro MUI_UNPAGE_FINISH
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
; Languages
|
|
|
|
!insertmacro MUI_LANGUAGE "English"
|
|
|
|
|
|
|
|
;--------------------------------
|
|
|
|
; Installer sections
|
|
|
|
|
|
|
|
Section "Files" SecInstall
|
|
|
|
SectionIn RO
|
|
|
|
SetOutPath "$INSTDIR"
|
|
|
|
File "..\build\src\Release\mosquitto.exe"
|
2020-12-03 14:02:43 +00:00
|
|
|
File "..\build\apps\mosquitto_passwd\Release\mosquitto_passwd.exe"
|
|
|
|
File "..\build\apps\mosquitto_ctrl\Release\mosquitto_ctrl.exe"
|
2014-05-07 22:27:00 +00:00
|
|
|
File "..\build\client\Release\mosquitto_pub.exe"
|
|
|
|
File "..\build\client\Release\mosquitto_sub.exe"
|
2019-10-29 14:41:39 +00:00
|
|
|
File "..\build\client\Release\mosquitto_rr.exe"
|
2014-05-07 22:27:00 +00:00
|
|
|
File "..\build\lib\Release\mosquitto.dll"
|
|
|
|
File "..\build\lib\cpp\Release\mosquittopp.dll"
|
2020-12-03 14:02:43 +00:00
|
|
|
File "..\build\plugins\dynamic-security\Release\mosquitto_dynamic_security.dll"
|
2014-05-07 22:27:00 +00:00
|
|
|
File "..\aclfile.example"
|
|
|
|
File "..\ChangeLog.txt"
|
|
|
|
File "..\mosquitto.conf"
|
2021-05-13 16:37:26 +00:00
|
|
|
File "..\NOTICE.md"
|
2014-05-07 22:27:00 +00:00
|
|
|
File "..\pwfile.example"
|
2020-11-12 22:08:38 +00:00
|
|
|
File "..\README.md"
|
|
|
|
File "..\README-windows.txt"
|
2020-12-03 14:02:43 +00:00
|
|
|
File "..\README-letsencrypt.md"
|
2015-03-02 22:12:50 +00:00
|
|
|
;File "C:\pthreads\Pre-built.2\dll\x86\pthreadVC2.dll"
|
2018-12-04 10:51:41 +00:00
|
|
|
File "C:\OpenSSL-Win32\bin\libssl-1_1.dll"
|
|
|
|
File "C:\OpenSSL-Win32\bin\libcrypto-1_1.dll"
|
2015-03-02 22:12:50 +00:00
|
|
|
File "..\edl-v10"
|
2020-12-03 14:02:43 +00:00
|
|
|
File "..\epl-v20"
|
2014-05-07 22:27:00 +00:00
|
|
|
|
|
|
|
SetOutPath "$INSTDIR\devel"
|
|
|
|
File "..\build\lib\Release\mosquitto.lib"
|
|
|
|
File "..\build\lib\cpp\Release\mosquittopp.lib"
|
2020-10-07 21:04:15 +00:00
|
|
|
File "..\include\mosquitto.h"
|
|
|
|
File "..\include\mosquitto_broker.h"
|
|
|
|
File "..\include\mosquitto_plugin.h"
|
|
|
|
File "..\include\mqtt_protocol.h"
|
|
|
|
File "..\lib\cpp\mosquittopp.h"
|
2014-05-07 22:27:00 +00:00
|
|
|
|
|
|
|
WriteUninstaller "$INSTDIR\Uninstall.exe"
|
2018-08-16 12:24:07 +00:00
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto" "DisplayName" "Eclipse Mosquitto MQTT broker"
|
2014-05-07 22:27:00 +00:00
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto" "UninstallString" "$\"$INSTDIR\Uninstall.exe$\""
|
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto" "QuietUninstallString" "$\"$INSTDIR\Uninstall.exe$\" /S"
|
2018-08-16 12:24:07 +00:00
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto" "HelpLink" "https://mosquitto.org/"
|
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto" "URLInfoAbout" "https://mosquitto.org/"
|
2014-05-07 22:27:00 +00:00
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto" "DisplayVersion" "${VERSION}"
|
|
|
|
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto" "NoModify" "1"
|
|
|
|
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto" "NoRepair" "1"
|
|
|
|
|
|
|
|
WriteRegExpandStr ${env_hklm} MOSQUITTO_DIR $INSTDIR
|
|
|
|
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
|
|
|
|
SectionEnd
|
|
|
|
|
2019-03-05 14:10:51 +00:00
|
|
|
Section "Service" SecService
|
|
|
|
ExecWait '"$INSTDIR\mosquitto.exe" install'
|
|
|
|
SectionEnd
|
|
|
|
|
2014-05-07 22:27:00 +00:00
|
|
|
Section "Uninstall"
|
|
|
|
ExecWait '"$INSTDIR\mosquitto.exe" uninstall'
|
|
|
|
Delete "$INSTDIR\mosquitto.exe"
|
2020-12-02 20:58:41 +00:00
|
|
|
Delete "$INSTDIR\mosquitto_ctrl.exe"
|
2014-05-07 22:27:00 +00:00
|
|
|
Delete "$INSTDIR\mosquitto_passwd.exe"
|
|
|
|
Delete "$INSTDIR\mosquitto_pub.exe"
|
|
|
|
Delete "$INSTDIR\mosquitto_sub.exe"
|
2019-10-29 14:41:39 +00:00
|
|
|
Delete "$INSTDIR\mosquitto_rr.exe"
|
2014-05-07 22:27:00 +00:00
|
|
|
Delete "$INSTDIR\mosquitto.dll"
|
|
|
|
Delete "$INSTDIR\mosquittopp.dll"
|
2020-12-02 20:58:41 +00:00
|
|
|
Delete "$INSTDIR\mosquitto_dynamic_security.dll"
|
2014-05-07 22:27:00 +00:00
|
|
|
Delete "$INSTDIR\aclfile.example"
|
|
|
|
Delete "$INSTDIR\ChangeLog.txt"
|
|
|
|
Delete "$INSTDIR\mosquitto.conf"
|
|
|
|
Delete "$INSTDIR\pwfile.example"
|
2021-10-05 08:40:31 +00:00
|
|
|
Delete "$INSTDIR\README.md"
|
2020-11-12 22:08:38 +00:00
|
|
|
Delete "$INSTDIR\README-windows.txt"
|
2020-12-03 14:02:43 +00:00
|
|
|
Delete "$INSTDIR\README-letsencrypt.md"
|
2015-03-02 22:12:50 +00:00
|
|
|
;Delete "$INSTDIR\pthreadVC2.dll"
|
2018-12-04 10:51:41 +00:00
|
|
|
Delete "$INSTDIR\libssl-1_1.dll"
|
|
|
|
Delete "$INSTDIR\libcrypto-1_1.dll"
|
2015-03-02 22:12:50 +00:00
|
|
|
Delete "$INSTDIR\edl-v10"
|
2020-12-03 14:02:43 +00:00
|
|
|
Delete "$INSTDIR\epl-v20"
|
2014-05-07 22:27:00 +00:00
|
|
|
|
|
|
|
Delete "$INSTDIR\devel\mosquitto.h"
|
|
|
|
Delete "$INSTDIR\devel\mosquitto.lib"
|
2020-10-07 21:04:15 +00:00
|
|
|
Delete "$INSTDIR\devel\mosquitto_broker.h"
|
|
|
|
Delete "$INSTDIR\devel\mosquitto_plugin.h"
|
2014-05-07 22:27:00 +00:00
|
|
|
Delete "$INSTDIR\devel\mosquittopp.h"
|
|
|
|
Delete "$INSTDIR\devel\mosquittopp.lib"
|
2020-10-07 21:04:15 +00:00
|
|
|
Delete "$INSTDIR\devel\mqtt_protocol.h"
|
2021-10-05 08:40:31 +00:00
|
|
|
RMDir "$INSTDIR\devel"
|
2014-05-07 22:27:00 +00:00
|
|
|
|
|
|
|
Delete "$INSTDIR\Uninstall.exe"
|
|
|
|
RMDir "$INSTDIR"
|
|
|
|
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto"
|
|
|
|
|
|
|
|
DeleteRegValue ${env_hklm} MOSQUITTO_DIR
|
|
|
|
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
|
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
LangString DESC_SecInstall ${LANG_ENGLISH} "The main installation."
|
2019-03-05 14:10:51 +00:00
|
|
|
LangString DESC_SecService ${LANG_ENGLISH} "Install mosquitto as a Windows service?"
|
|
|
|
|
2014-05-07 22:27:00 +00:00
|
|
|
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
|
|
|
|
!insertmacro MUI_DESCRIPTION_TEXT ${SecInstall} $(DESC_SecInstall)
|
2019-03-05 14:10:51 +00:00
|
|
|
!insertmacro MUI_DESCRIPTION_TEXT ${SecService} $(DESC_SecService)
|
2014-05-07 22:27:00 +00:00
|
|
|
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
|
|
|
|