• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; NSIS installer script for libwebsockets
2
3!include "MUI.nsh"
4
5Name "libwebsockets"
6OutFile "libwebsockets-${VERSION}-install.exe"
7
8InstallDir "$PROGRAMFILES\libwebsockets"
9
10;--------------------------------
11; Installer pages
12!insertmacro MUI_PAGE_WELCOME
13!insertmacro MUI_PAGE_COMPONENTS
14!insertmacro MUI_PAGE_DIRECTORY
15!insertmacro MUI_PAGE_INSTFILES
16!insertmacro MUI_PAGE_FINISH
17
18
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;--------------------------------
27; Languages
28!insertmacro MUI_LANGUAGE "English"
29
30;--------------------------------
31; Installer sections
32
33Section "Files" SecInstall
34	SectionIn RO
35	SetOutPath "$INSTDIR"
36	File "..\libwebsockets-api-doc.html"
37	File "..\LICENSE"
38	File "..\README.md"
39	File "..\README.build.md"
40	File "..\README.coding.md"
41	File "..\README.test-apps.md"
42	File /nonfatal "..\build\bin\Release\libwebsockets-test-client.exe"
43	File /nonfatal "..\build\bin\Release\libwebsockets-test-echo.exe"
44	File /nonfatal "..\build\bin\Release\libwebsockets-test-fraggle.exe"
45	File /nonfatal "..\build\bin\Release\libwebsockets-test-ping.exe"
46	File /nonfatal "..\build\bin\Release\libwebsockets-test-server.exe"
47	File /nonfatal "..\build\bin\Release\libwebsockets-test-server-extpoll.exe"
48	File /nonfatal "..\build\bin\Release\websockets.dll"
49	File /nonfatal "..\build\bin\Release\websockets_shared.dll"
50
51	SetOutPath "$INSTDIR\libwebsockets-test-server"
52	File /nonfatal "..\build\bin\share\libwebsockets-test-server\favicon.ico"
53	File /nonfatal "..\build\bin\share\libwebsockets-test-server\leaf.jpg"
54	File /nonfatal "..\build\bin\share\libwebsockets-test-server\libwebsockets.org-logo.png"
55	File /nonfatal "..\build\bin\share\libwebsockets-test-server\libwebsockets-test-server.key.pem"
56	File /nonfatal "..\build\bin\share\libwebsockets-test-server\libwebsockets-test-server.pem"
57	File /nonfatal "..\build\bin\share\libwebsockets-test-server\test.html"
58
59	SetOutPath "$INSTDIR\lib"
60	File /nonfatal "..\build\lib\Release\websockets.lib"
61	File /nonfatal "..\build\lib\Release\websockets_static.lib"
62	File /nonfatal "..\build\lib\Release\websockets_shared.lib"
63	File /nonfatal "..\build\lib\Release\websockets.lib"
64
65	SetOutPath "$INSTDIR\include"
66	File "..\lib\libwebsockets.h"
67
68	WriteUninstaller "$INSTDIR\Uninstall.exe"
69	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\libwebsockets" "DisplayName" "libwebsockets library and clients"
70	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\libwebsockets" "UninstallString" "$\"$INSTDIR\Uninstall.exe$\""
71	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\libwebsockets" "QuietUninstallString" "$\"$INSTDIR\Uninstall.exe$\" /S"
72	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\libwebsockets" "HelpLink" "https://libwebsockets.org/"
73	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\libwebsockets" "URLInfoAbout" "http://libwebsockets.org/"
74	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\libwebsockets" "DisplayVersion" "${VERSION}"
75	WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\libwebsockets" "NoModify" "1"
76	WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\libwebsockets" "NoRepair" "1"
77SectionEnd
78
79Section "Uninstall"
80	Delete "$INSTDIR\libwebsockets-api-doc.html"
81	Delete "$INSTDIR\LICENSE"
82	Delete "$INSTDIR\README.md"
83	Delete "$INSTDIR\README.build.md"
84	Delete "$INSTDIR\README.coding.md"
85	Delete "$INSTDIR\README.test-apps.md"
86	Delete "$INSTDIR\libwebsockets-test-client.exe"
87	Delete "$INSTDIR\libwebsockets-test-echo.exe"
88	Delete "$INSTDIR\libwebsockets-test-fraggle.exe"
89	Delete "$INSTDIR\libwebsockets-test-ping.exe"
90	Delete "$INSTDIR\libwebsockets-test-server.exe"
91	Delete "$INSTDIR\libwebsockets-test-server-extpoll.exe"
92	Delete "$INSTDIR\websockets.dll"
93
94	Delete "$INSTDIR\libwebsockets-test-server\favicon.ico"
95	Delete "$INSTDIR\libwebsockets-test-server\leaf.jpg"
96	Delete "$INSTDIR\libwebsockets-test-server\libwebsockets.org-logo.png"
97	Delete "$INSTDIR\libwebsockets-test-server\libwebsockets-test-server.key.pem"
98	Delete "$INSTDIR\libwebsockets-test-server\libwebsockets-test-server.pem"
99	Delete "$INSTDIR\libwebsockets-test-server\test.html"
100	RMDir "$INSTDIR\libwebsockets-test-server"
101
102	Delete "$INSTDIR\lib\websockets.lib"
103	Delete "$INSTDIR\lib\websockets_static.lib"
104	RMDir "$INSTDIR\lib"
105
106	Delete "$INSTDIR\include\libwebsockets.h"
107	RMDir "$INSTDIR\include"
108
109	Delete "$INSTDIR\Uninstall.exe"
110	RMDir "$INSTDIR"
111	DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\libwebsockets"
112SectionEnd
113
114LangString DESC_SecInstall ${LANG_ENGLISH} "The main installation."
115!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
116	!insertmacro MUI_DESCRIPTION_TEXT ${SecInstall} $(DESC_SecInstall)
117!insertmacro MUI_FUNCTION_DESCRIPTION_END
118
119