Skip to content

Commit

Permalink
Windows installer updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralight committed Mar 2, 2015
1 parent 4b6784f commit 7beedcf
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 45 deletions.
66 changes: 34 additions & 32 deletions installer/mosquitto-cygwin.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ InstallDir "$PROGRAMFILES\mosquitto"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH

!define MUI_FINISHPAGE_TEXT "mosquitto has been installed on your computer.\n\nTo complete the installation you must install the dependencies described in the following readme.\n\nClick Finish to close this wizard."
!define MUI_FINISHPAGE_SHOWREADME $INSTDIR\readme-dependencies-cygwin.txt
!define MUI_FINISHPAGE_SHOWREADME_TEXT "Show dependencies readme"
!insertmacro MUI_PAGE_FINISH

;--------------------------------
; Uninstaller pages
Expand All @@ -39,11 +42,11 @@ InstallDir "$PROGRAMFILES\mosquitto"
Section "Files" SecInstall
SectionIn RO
SetOutPath "$INSTDIR"
File "c:\cygwin\bin\cygwin1.dll"
File "c:\cygwin\bin\cyggcc_s-1.dll"
File "c:\cygwin\bin\cygcrypto-1.0.0.dll"
File "c:\cygwin\bin\cygssl-1.0.0.dll"
File "c:\cygwin\bin\cygz.dll"
;File "c:\cygwin\bin\cygwin1.dll"
;File "c:\cygwin\bin\cyggcc_s-1.dll"
;File "c:\cygwin\bin\cygcrypto-1.0.0.dll"
;File "c:\cygwin\bin\cygssl-1.0.0.dll"
;File "c:\cygwin\bin\cygz.dll"
File "..\src\mosquitto.exe"
File "..\build\src\Release\mosquitto_passwd.exe"
File "..\build\client\Release\mosquitto_pub.exe"
Expand All @@ -56,11 +59,11 @@ Section "Files" SecInstall
File "..\pwfile.example"
File "..\readme.txt"
File "..\readme-windows.txt"
File "C:\pthreads\Pre-built.2\dll\x86\pthreadVC2.dll"
File "C:\OpenSSL-Win32\libeay32.dll"
File "C:\OpenSSL-Win32\ssleay32.dll"
File "..\LICENSE.txt"
File "..\LICENSE-3rd-party.txt"
;File "C:\pthreads\Pre-built.2\dll\x86\pthreadVC2.dll"
;File "C:\OpenSSL-Win32\libeay32.dll"
;File "C:\OpenSSL-Win32\ssleay32.dll"
File "..\edl-v10"
File "..\epl-v10"

SetOutPath "$INSTDIR\devel"
File "..\lib\mosquitto.h"
Expand All @@ -70,14 +73,14 @@ Section "Files" SecInstall
File "..\src\mosquitto_plugin.h"

WriteUninstaller "$INSTDIR\Uninstall.exe"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto" "DisplayName" "Mosquitto MQTT broker"
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"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto" "HelpLink" "https://mosquitto.org/"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto" "URLInfoAbout" "https://mosquitto.org/"
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"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MosquittoCygwin" "DisplayName" "Mosquitto MQTT broker"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MosquittoCygwin" "UninstallString" "$\"$INSTDIR\Uninstall.exe$\""
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MosquittoCygwin" "QuietUninstallString" "$\"$INSTDIR\Uninstall.exe$\" /S"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MosquittoCygwin" "HelpLink" "https://mosquitto.org/"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MosquittoCygwin" "URLInfoAbout" "https://mosquitto.org/"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MosquittoCygwin" "DisplayVersion" "${VERSION}"
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MosquittoCygwin" "NoModify" "1"
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MosquittoCygwin" "NoRepair" "1"

WriteRegExpandStr ${env_hklm} MOSQUITTO_DIR $INSTDIR
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
Expand All @@ -89,11 +92,11 @@ SectionEnd

Section "Uninstall"
ExecWait '"$INSTDIR\mosquitto.exe" uninstall'
Delete "$INSTDIR\cygwin1.dll"
Delete "$INSTDIR\cyggcc_s-1.dll"
Delete "$INSTDIR\cygcrypto-1.0.0.dll"
Delete "$INSTDIR\cygssl-1.0.0.dll"
Delete "$INSTDIR\cygz.dll"
;Delete "$INSTDIR\cygwin1.dll"
;Delete "$INSTDIR\cyggcc_s-1.dll"
;Delete "$INSTDIR\cygcrypto-1.0.0.dll"
;Delete "$INSTDIR\cygssl-1.0.0.dll"
;Delete "$INSTDIR\cygz.dll"
Delete "$INSTDIR\mosquitto.exe"
Delete "$INSTDIR\mosquitto_passwd.exe"
Delete "$INSTDIR\mosquitto_pub.exe"
Expand All @@ -106,11 +109,11 @@ Section "Uninstall"
Delete "$INSTDIR\pwfile.example"
Delete "$INSTDIR\readme.txt"
Delete "$INSTDIR\readme-windows.txt"
Delete "$INSTDIR\pthreadVC2.dll"
Delete "$INSTDIR\libeay32.dll"
Delete "$INSTDIR\ssleay32.dll"
Delete "$INSTDIR\LICENSE.txt"
Delete "$INSTDIR\LICENSE-3rd-party.txt"
;Delete "$INSTDIR\pthreadVC2.dll"
;Delete "$INSTDIR\libeay32.dll"
;Delete "$INSTDIR\ssleay32.dll"
Delete "$INSTDIR\edl-v10"
Delete "$INSTDIR\epl-v10"

Delete "$INSTDIR\devel\mosquitto.h"
Delete "$INSTDIR\devel\mosquitto.lib"
Expand All @@ -120,16 +123,15 @@ Section "Uninstall"

Delete "$INSTDIR\Uninstall.exe"
RMDir "$INSTDIR"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MosquittoCygwin"

DeleteRegValue ${env_hklm} MOSQUITTO_DIR
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
SectionEnd

LangString DESC_SecInstall ${LANG_ENGLISH} "The main installation."
LangString DESC_SecService ${LANG_ENGLISH} "Install mosquitto as a Windows service?"
LangString DESC_SecService ${LANG_ENGLISH} "Install mosquitto as a Windows service (needs all dependencies installed)?"
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SecInstall} $(DESC_SecInstall)
!insertmacro MUI_DESCRIPTION_TEXT ${SecService} $(DESC_SecService)
!insertmacro MUI_FUNCTION_DESCRIPTION_END

26 changes: 15 additions & 11 deletions installer/mosquitto.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ InstallDir "$PROGRAMFILES\mosquitto"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES

!define MUI_FINISHPAGE_TEXT "mosquitto has been installed on your computer.\n\nTo complete the installation you must install the dependencies described in the following readme.\n\nClick Finish to close this wizard."
!define MUI_FINISHPAGE_SHOWREADME $INSTDIR\readme-windows.txt
!define MUI_FINISHPAGE_SHOWREADME_TEXT "Show dependencies readme"
!insertmacro MUI_PAGE_FINISH


Expand All @@ -30,7 +34,7 @@ InstallDir "$PROGRAMFILES\mosquitto"

;--------------------------------
; Languages

1
!insertmacro MUI_LANGUAGE "English"

;--------------------------------
Expand All @@ -51,11 +55,11 @@ Section "Files" SecInstall
File "..\pwfile.example"
File "..\readme.txt"
File "..\readme-windows.txt"
File "C:\pthreads\Pre-built.2\dll\x86\pthreadVC2.dll"
File "C:\OpenSSL-Win32\libeay32.dll"
File "C:\OpenSSL-Win32\ssleay32.dll"
File "..\LICENSE.txt"
File "..\LICENSE-3rd-party.txt"
;File "C:\pthreads\Pre-built.2\dll\x86\pthreadVC2.dll"
;File "C:\OpenSSL-Win32\libeay32.dll"
;File "C:\OpenSSL-Win32\ssleay32.dll"
File "..\edl-v10"
File "..\epl-v10"

SetOutPath "$INSTDIR\devel"
File "..\lib\mosquitto.h"
Expand Down Expand Up @@ -96,11 +100,11 @@ Section "Uninstall"
Delete "$INSTDIR\pwfile.example"
Delete "$INSTDIR\readme.txt"
Delete "$INSTDIR\readme-windows.txt"
Delete "$INSTDIR\pthreadVC2.dll"
Delete "$INSTDIR\libeay32.dll"
Delete "$INSTDIR\ssleay32.dll"
Delete "$INSTDIR\LICENSE.txt"
Delete "$INSTDIR\LICENSE-3rd-party.txt"
;Delete "$INSTDIR\pthreadVC2.dll"
;Delete "$INSTDIR\libeay32.dll"
;Delete "$INSTDIR\ssleay32.dll"
Delete "$INSTDIR\edl-v10"
Delete "$INSTDIR\epl-v10"

Delete "$INSTDIR\devel\mosquitto.h"
Delete "$INSTDIR\devel\mosquitto.lib"
Expand Down
68 changes: 66 additions & 2 deletions readme-windows.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,69 @@
Mosquitto is now installed as a Windows service. You can start/stop it from
the control panel as well as running it as a normal executable.
Mosquitto for Windows
=====================

Mosquitto for Windows comes in two flavours, win32 or Cygwin. The win32 version is only
supported on Windows Vista or later.

In all cases, the dependencies are not provided in this installer and must be installed
separately in the case that they are not already available.


Capabilities
------------

The network support in Windows is severely limited. The broker is limited to approximately
1024 MQTT connections.


Websockets
----------

The broker executables provided in the installers do not have Websockets support enabled.
If you wish to have a version of the broker with Websockets support, you will need to compile
libwebsockets version v1.3-chrome37-firefox30 yourself and mosquitto version 1.4 yourself.

Please note that on Windows, libwebsockets limits connections to a maximum of 64 clients.


Dependencies - win32
--------------------

* OpenSSL
Link: https://slproweb.com/products/Win32OpenSSL.html
Install "Win32 OpenSSL <version>"
Required DLLs: libeay32.dll ssleay32.dll
* pthreads
Link: ftp:https://sourceware.org/pub/pthreads-win32
Install "pthreads-w32-<version>-release.zip
Required DLLs: pthreadVC2.dll

Please ensure that the required DLLs are on the system path, or are in the same directory as
the mosquitto executable.


Dependencies - Cygwin
---------------------

* OpenSSL
Link: https://slproweb.com/products/Win32OpenSSL.html
Install "Win32 OpenSSL <version>"
* pthreads
Link: ftp:https://sourceware.org/pub/pthreads-win32
Install "pthreads-w32-<version>-release.zip
* Cygwin
Link: https://www.cygwin.com/setup-x86.exe
Required packages: libgcc1, openssl, zlib0


Windows Service
---------------

If all dependencies are installed prior to the installer being run, the broker can be
installed as a Windows service.

You can start/stop it from
the control panel as well as running it as a normal
executable.

When running as a service, the configuration in mosquitto.conf in the
installation directory is used so modify this to your needs.

0 comments on commit 7beedcf

Please sign in to comment.