mosquitto.nsi 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. ; NSIS installer script for mosquitto
  2. !include "MUI2.nsh"
  3. !include "nsDialogs.nsh"
  4. !include "LogicLib.nsh"
  5. ; For environment variable code
  6. !include "WinMessages.nsh"
  7. !define env_hklm 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"'
  8. Name "Eclipse Mosquitto"
  9. !define VERSION 2.0.13
  10. OutFile "mosquitto-${VERSION}-install-windows-x86.exe"
  11. InstallDir "$PROGRAMFILES\mosquitto"
  12. ;--------------------------------
  13. ; Installer pages
  14. !insertmacro MUI_PAGE_WELCOME
  15. !insertmacro MUI_PAGE_COMPONENTS
  16. !insertmacro MUI_PAGE_DIRECTORY
  17. !insertmacro MUI_PAGE_INSTFILES
  18. !insertmacro MUI_PAGE_FINISH
  19. ;--------------------------------
  20. ; Uninstaller pages
  21. !insertmacro MUI_UNPAGE_WELCOME
  22. !insertmacro MUI_UNPAGE_CONFIRM
  23. !insertmacro MUI_UNPAGE_INSTFILES
  24. !insertmacro MUI_UNPAGE_FINISH
  25. ;--------------------------------
  26. ; Languages
  27. !insertmacro MUI_LANGUAGE "English"
  28. ;--------------------------------
  29. ; Installer sections
  30. Section "Files" SecInstall
  31. SectionIn RO
  32. SetOutPath "$INSTDIR"
  33. File "..\build\src\Release\mosquitto.exe"
  34. File "..\build\apps\mosquitto_passwd\Release\mosquitto_passwd.exe"
  35. File "..\build\apps\mosquitto_ctrl\Release\mosquitto_ctrl.exe"
  36. File "..\build\client\Release\mosquitto_pub.exe"
  37. File "..\build\client\Release\mosquitto_sub.exe"
  38. File "..\build\client\Release\mosquitto_rr.exe"
  39. File "..\build\lib\Release\mosquitto.dll"
  40. File "..\build\lib\cpp\Release\mosquittopp.dll"
  41. File "..\build\plugins\dynamic-security\Release\mosquitto_dynamic_security.dll"
  42. File "..\aclfile.example"
  43. File "..\ChangeLog.txt"
  44. File "..\mosquitto.conf"
  45. File "..\NOTICE.md"
  46. File "..\pwfile.example"
  47. File "..\README.md"
  48. File "..\README-windows.txt"
  49. File "..\README-letsencrypt.md"
  50. ;File "C:\pthreads\Pre-built.2\dll\x86\pthreadVC2.dll"
  51. File "C:\OpenSSL-Win32\bin\libssl-1_1.dll"
  52. File "C:\OpenSSL-Win32\bin\libcrypto-1_1.dll"
  53. File "..\edl-v10"
  54. File "..\epl-v20"
  55. SetOutPath "$INSTDIR\devel"
  56. File "..\build\lib\Release\mosquitto.lib"
  57. File "..\build\lib\cpp\Release\mosquittopp.lib"
  58. File "..\include\mosquitto.h"
  59. File "..\include\mosquitto_broker.h"
  60. File "..\include\mosquitto_plugin.h"
  61. File "..\include\mqtt_protocol.h"
  62. File "..\lib\cpp\mosquittopp.h"
  63. WriteUninstaller "$INSTDIR\Uninstall.exe"
  64. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto" "DisplayName" "Eclipse Mosquitto MQTT broker"
  65. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto" "UninstallString" "$\"$INSTDIR\Uninstall.exe$\""
  66. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto" "QuietUninstallString" "$\"$INSTDIR\Uninstall.exe$\" /S"
  67. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto" "HelpLink" "https://mosquitto.org/"
  68. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto" "URLInfoAbout" "https://mosquitto.org/"
  69. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto" "DisplayVersion" "${VERSION}"
  70. WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto" "NoModify" "1"
  71. WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto" "NoRepair" "1"
  72. WriteRegExpandStr ${env_hklm} MOSQUITTO_DIR $INSTDIR
  73. SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
  74. SectionEnd
  75. Section "Service" SecService
  76. ExecWait '"$INSTDIR\mosquitto.exe" install'
  77. SectionEnd
  78. Section "Uninstall"
  79. ExecWait '"$INSTDIR\mosquitto.exe" uninstall'
  80. Delete "$INSTDIR\mosquitto.exe"
  81. Delete "$INSTDIR\mosquitto_ctrl.exe"
  82. Delete "$INSTDIR\mosquitto_passwd.exe"
  83. Delete "$INSTDIR\mosquitto_pub.exe"
  84. Delete "$INSTDIR\mosquitto_sub.exe"
  85. Delete "$INSTDIR\mosquitto_rr.exe"
  86. Delete "$INSTDIR\mosquitto.dll"
  87. Delete "$INSTDIR\mosquittopp.dll"
  88. Delete "$INSTDIR\mosquitto_dynamic_security.dll"
  89. Delete "$INSTDIR\aclfile.example"
  90. Delete "$INSTDIR\ChangeLog.txt"
  91. Delete "$INSTDIR\mosquitto.conf"
  92. Delete "$INSTDIR\pwfile.example"
  93. Delete "$INSTDIR\README.md"
  94. Delete "$INSTDIR\README-windows.txt"
  95. Delete "$INSTDIR\README-letsencrypt.md"
  96. ;Delete "$INSTDIR\pthreadVC2.dll"
  97. Delete "$INSTDIR\libssl-1_1.dll"
  98. Delete "$INSTDIR\libcrypto-1_1.dll"
  99. Delete "$INSTDIR\edl-v10"
  100. Delete "$INSTDIR\epl-v20"
  101. Delete "$INSTDIR\devel\mosquitto.h"
  102. Delete "$INSTDIR\devel\mosquitto.lib"
  103. Delete "$INSTDIR\devel\mosquitto_broker.h"
  104. Delete "$INSTDIR\devel\mosquitto_plugin.h"
  105. Delete "$INSTDIR\devel\mosquittopp.h"
  106. Delete "$INSTDIR\devel\mosquittopp.lib"
  107. Delete "$INSTDIR\devel\mqtt_protocol.h"
  108. RMDir "$INSTDIR\devel"
  109. Delete "$INSTDIR\Uninstall.exe"
  110. RMDir "$INSTDIR"
  111. DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Mosquitto"
  112. DeleteRegValue ${env_hklm} MOSQUITTO_DIR
  113. SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
  114. SectionEnd
  115. LangString DESC_SecInstall ${LANG_ENGLISH} "The main installation."
  116. LangString DESC_SecService ${LANG_ENGLISH} "Install mosquitto as a Windows service?"
  117. !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
  118. !insertmacro MUI_DESCRIPTION_TEXT ${SecInstall} $(DESC_SecInstall)
  119. !insertmacro MUI_DESCRIPTION_TEXT ${SecService} $(DESC_SecService)
  120. !insertmacro MUI_FUNCTION_DESCRIPTION_END