mosquitto/installer/mosquitto64.nsi

149 lines
5.0 KiB
Plaintext
Raw Normal View History

2014-05-07 22:27:00 +00:00
; NSIS installer script for mosquitto
2015-09-22 12:48:36 +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"
2018-09-25 15:26:02 +00:00
!define VERSION 1.5.3
2015-09-22 12:48:36 +00:00
OutFile "mosquitto-${VERSION}-install-windows-x64.exe"
2014-05-07 22:27:00 +00:00
2015-09-22 12:48:36 +00:00
!include "x64.nsh"
2018-08-16 12:24:07 +00:00
InstallDir "$PROGRAMFILES64\mosquitto"
2015-09-22 12:48:36 +00:00
2014-05-07 22:27:00 +00:00
;--------------------------------
; Installer pages
!insertmacro MUI_PAGE_WELCOME
2015-09-22 12:48:36 +00:00
Page custom DependencyPage
2014-05-07 22:27:00 +00:00
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
2015-03-02 22:12:50 +00:00
!insertmacro MUI_PAGE_FINISH
2014-05-07 22:27:00 +00:00
2015-09-22 12:48:36 +00:00
2014-05-07 22:27:00 +00:00
;--------------------------------
; 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"
2015-09-22 12:48:36 +00:00
File "..\build64\src\Release\mosquitto.exe"
File "..\build64\src\Release\mosquitto_passwd.exe"
File "..\build64\client\Release\mosquitto_pub.exe"
File "..\build64\client\Release\mosquitto_sub.exe"
File "..\build64\lib\Release\mosquitto.dll"
File "..\build64\lib\cpp\Release\mosquittopp.dll"
2014-05-07 22:27:00 +00:00
File "..\aclfile.example"
File "..\ChangeLog.txt"
File "..\mosquitto.conf"
File "..\pwfile.example"
2015-06-03 14:37:41 +00:00
File "..\readme.md"
2014-05-07 22:27:00 +00:00
File "..\readme-windows.txt"
2015-09-22 12:48:36 +00:00
;File "C:\pthreads\Pre-built.2\dll\x64\pthreadVC2.dll"
2018-08-16 12:24:07 +00:00
;File "C:\OpenSSL-Win64\bin\libssl_1-1-x64.dll"
;File "C:\OpenSSL-Win64\bin\libcrypto_1-1-x64.dll"
2015-03-02 22:12:50 +00:00
File "..\edl-v10"
File "..\epl-v10"
2014-05-07 22:27:00 +00:00
SetOutPath "$INSTDIR\devel"
File "..\lib\mosquitto.h"
2015-09-22 12:48:36 +00:00
File "..\build64\lib\Release\mosquitto.lib"
2014-05-07 22:27:00 +00:00
File "..\lib\cpp\mosquittopp.h"
2015-09-22 12:48:36 +00:00
File "..\build64\lib\cpp\Release\mosquittopp.lib"
2014-05-07 22:27:00 +00:00
File "..\src\mosquitto_plugin.h"
WriteUninstaller "$INSTDIR\Uninstall.exe"
2018-08-16 12:24:07 +00:00
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto64" "DisplayName" "Eclipse Mosquitto MQTT broker (64 bit)"
2015-09-22 12:48:36 +00:00
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto64" "UninstallString" "$\"$INSTDIR\Uninstall.exe$\""
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto64" "QuietUninstallString" "$\"$INSTDIR\Uninstall.exe$\" /S"
2018-08-16 12:24:07 +00:00
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto64" "HelpLink" "https://mosquitto.org/"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto64" "URLInfoAbout" "https://mosquitto.org/"
2015-09-22 12:48:36 +00:00
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto64" "DisplayVersion" "${VERSION}"
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto64" "NoModify" "1"
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto64" "NoRepair" "1"
2014-05-07 22:27:00 +00:00
WriteRegExpandStr ${env_hklm} MOSQUITTO_DIR $INSTDIR
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
SectionEnd
Section "Uninstall"
ExecWait '"$INSTDIR\mosquitto.exe" uninstall'
Delete "$INSTDIR\mosquitto.exe"
Delete "$INSTDIR\mosquitto_passwd.exe"
Delete "$INSTDIR\mosquitto_pub.exe"
Delete "$INSTDIR\mosquitto_sub.exe"
Delete "$INSTDIR\mosquitto.dll"
Delete "$INSTDIR\mosquittopp.dll"
Delete "$INSTDIR\aclfile.example"
Delete "$INSTDIR\ChangeLog.txt"
Delete "$INSTDIR\mosquitto.conf"
Delete "$INSTDIR\pwfile.example"
Delete "$INSTDIR\readme.txt"
Delete "$INSTDIR\readme-windows.txt"
2015-03-02 22:12:50 +00:00
;Delete "$INSTDIR\pthreadVC2.dll"
2018-08-16 12:24:07 +00:00
;Delete "$INSTDIR\libssl_1-1-x64.dll"
;Delete "$INSTDIR\libcrypto_1-1-x64.dll"
2015-03-02 22:12:50 +00:00
Delete "$INSTDIR\edl-v10"
Delete "$INSTDIR\epl-v10"
2014-05-07 22:27:00 +00:00
Delete "$INSTDIR\devel\mosquitto.h"
Delete "$INSTDIR\devel\mosquitto.lib"
Delete "$INSTDIR\devel\mosquittopp.h"
Delete "$INSTDIR\devel\mosquittopp.lib"
Delete "$INSTDIR\devel\mosquitto_plugin.h"
Delete "$INSTDIR\Uninstall.exe"
RMDir "$INSTDIR"
2015-09-22 12:48:36 +00:00
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto64"
2014-05-07 22:27:00 +00:00
DeleteRegValue ${env_hklm} MOSQUITTO_DIR
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
SectionEnd
LangString DESC_SecInstall ${LANG_ENGLISH} "The main installation."
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SecInstall} $(DESC_SecInstall)
!insertmacro MUI_FUNCTION_DESCRIPTION_END
2015-09-22 12:48:36 +00:00
Var Dialog
Var OSSLLink
Var PTHLink
Function DependencyPage
nsDialogs::Create 1018
Pop $Dialog
${If} $Dialog == error
Abort
${EndIf}
2018-08-16 12:24:07 +00:00
${NSD_CreateLabel} 0 0 100% 12u "OpenSSL - install 'Win64 OpenSSL v1.1.0* Light' then copy libssl_1-1-x64.dll and libcrypto_1-1-x64.dll to the mosquitto directory"
2015-09-22 12:48:36 +00:00
${NSD_CreateLink} 13u 13u 100% 12u "http://slproweb.com/products/Win32OpenSSL.html"
Pop $OSSLLink
${NSD_OnClick} $OSSLLink OnClick_OSSL
!insertmacro MUI_HEADER_TEXT_PAGE "Dependencies" "This page lists packages that must be installed if not already present"
nsDialogs::Show
FunctionEnd
Function OnClick_OSSL
Pop $0
ExecShell "open" "http://slproweb.com/products/Win32OpenSSL.html"
FunctionEnd