mosquitto64.nsi 5.2 KB

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