1 ; * +------------------------------------+
2 ; * | Inspire Internet Relay Chat Daemon |
3 ; * +------------------------------------+
5 ; * InspIRCd: (C) 2002-2007 InspIRCd Development Team
6 ; * See: http://www.inspircd.org/wiki/index.php/Credits
8 ; * This program is free but copyrighted software; see
9 ; * the file COPYING for details.
11 ; * ---------------------------------------------------
13 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
15 ;;;; SET THE BUILD TO BE PACKAGED HERE ;;;;
17 !define BUILD "release"
19 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
21 ; HM NIS Edit Wizard helper defines
22 !define PRODUCT_NAME "InspIRCd"
23 !define PRODUCT_VERSION "1.2"
24 !define PRODUCT_PUBLISHER "InspIRCd Development Team"
25 !define PRODUCT_WEB_SITE "http://www.inspircd.org/"
26 !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\inspircd.exe"
27 !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
28 !define PRODUCT_UNINST_ROOT_KEY "HKLM"
34 ; MUI 1.67 compatible ------
38 !define MUI_ABORTWARNING
39 !define MUI_ICON "inspircd.ico"
40 !define MUI_UNICON "inspircd.ico"
43 !insertmacro MUI_PAGE_WELCOME
45 !define MUI_LICENSEPAGE_CHECKBOX
46 !insertmacro MUI_PAGE_LICENSE "..\docs\COPYING"
50 !insertmacro MUI_PAGE_COMPONENTS
52 !insertmacro MUI_PAGE_INSTFILES
54 !define MUI_FINISHPAGE_RUN "$INSTDIR\InspGUI.exe"
55 !insertmacro MUI_PAGE_FINISH
58 !insertmacro MUI_UNPAGE_INSTFILES
61 !insertmacro MUI_LANGUAGE "English"
64 !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
68 Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
70 InstallDir "$PROGRAMFILES\InspIRCd"
71 InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
73 ShowUnInstDetails show
75 Function IsDotNetInstalled
78 StrCpy $1 "SOFTWARE\Microsoft\.NETFramework" ;registry entry to look in.
82 ;Enumerate the versions installed.
83 EnumRegKey $3 HKLM "$1\policy" $2
85 ;If we don't find any versions installed, it's not here.
86 StrCmp $3 "" noDotNet notEmpty
90 ;Find out if the RegKey starts with 'v'.
91 ;If it doesn't, goto the next key.
93 StrCmp $4 "v" +1 goNext
96 ;It starts with 'v'. Now check to see how the installed major version
97 ;relates to our required major version.
98 ;If it's equal check the minor version, if it's greater,
99 ;we found a good RegKey.
100 IntCmp $4 ${DOT_MAJOR} +1 goNext yesDotNetReg
101 ;Check the minor version. If it's equal or greater to our requested
102 ;version then we're good.
104 IntCmp $4 ${DOT_MINOR} yesDotNetReg goNext yesDotNetReg
107 ;Go to the next RegKey.
112 ;Now that we've found a good RegKey, let's make sure it's actually
113 ;installed by getting the install path and checking to see if the
114 ;mscorlib.dll exists.
115 EnumRegValue $2 HKLM "$1\policy\$3" 0
116 ;$2 should equal whatever comes after the major and minor versions
118 StrCmp $2 "" noDotNet
119 ReadRegStr $4 HKLM $1 "InstallRoot"
120 ;Hopefully the install root isn't empty.
121 StrCmp $4 "" noDotNet
122 ;build the actuall directory path to mscorlib.dll.
123 StrCpy $4 "$4$3.$2\mscorlib.dll"
124 IfFileExists $4 yesDotNet noDotNet
127 MessageBox MB_OK "You do not have have v${DOT_MAJOR}.${DOT_MINOR} or greater of the .NET framework installed. This is required for the InspIRCd Monitor, however you can still launch the IRCd manually."
130 ;Everything checks out. Go on with the rest of the installation.
134 Section "Binary Executable" SEC01
135 Call IsDotNetInstalled
136 SetOutPath "$INSTDIR"
138 File "..\bin\${BUILD}\InspGUI.exe"
139 CreateDirectory "$SMPROGRAMS\InspIRCd"
140 CreateShortCut "$SMPROGRAMS\InspIRCd\InspIRCd.lnk" "$INSTDIR\InspGUI.exe"
141 SetOutPath "$INSTDIR\bin"
143 File "..\bin\${BUILD}\bin\inspircd.exe"
146 Section "Config Files" SEC02
147 SetOutPath "$INSTDIR\conf"
148 File "..\conf\inspircd.motd.example"
149 File "..\conf\inspircd.helpop-full.example"
150 File "..\conf\inspircd.helpop.example"
151 File "..\conf\inspircd.filter.example"
152 File "..\docs\inspircd.conf.example"
153 File "..\conf\inspircd.censor.example"
154 File "..\conf\inspircd.rules.example"
155 File "..\conf\inspircd.quotes.example"
158 Section "Command Handlers" SEC03
159 SetOutPath "$INSTDIR\lib"
160 File "..\bin\${BUILD}\lib\cmd_*.so"
163 Section "Modules" SEC04
164 SetOutPath "$INSTDIR\modules"
165 File "..\bin\${BUILD}\modules\m_*.so"
168 Section "SSL Modules" SEC05
169 SetOutPath "$INSTDIR\bin"
171 File "..\bin\${BUILD}\bin\libgcrypt-11.dll"
172 File "..\bin\${BUILD}\bin\libgnutls-13.dll"
173 File "..\bin\${BUILD}\bin\libgnutls-extra-13.dll"
174 File "..\bin\${BUILD}\bin\libgnutls-openssl-13.dll"
175 File "..\bin\${BUILD}\bin\libgpg-error-0.dll"
176 File "..\bin\${BUILD}\bin\libopencdk-8.dll"
177 File "..\bin\${BUILD}\bin\libtasn1-3.dll"
178 SetOutPath "$INSTDIR\modules"
179 File "c:\temp\m_ssl_gnutls.so"
180 File "c:\temp\m_sslinfo.so"
181 File "c:\temp\m_ssl_oper_cert.so"
182 SetOutPath "$INSTDIR\conf"
188 Section "Regexp Modules" SEC06
189 SetOutPath "$INSTDIR\bin"
191 File "..\bin\${BUILD}\bin\pcre.dll"
192 SetOutPath "$INSTDIR\modules"
193 File "c:\temp\m_filter_pcre.so"
196 Section -AdditionalIcons
198 WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
199 CreateShortCut "$SMPROGRAMS\InspIRCd\InspIRCd Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url"
200 CreateShortCut "$SMPROGRAMS\InspIRCd\Uninstall.lnk" "$INSTDIR\uninst.exe"
204 WriteUninstaller "$INSTDIR\uninst.exe"
205 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\bin\inspircd.exe"
206 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
207 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
208 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\bin\inspircd.exe"
209 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
210 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
211 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
212 MessageBox MB_ICONINFORMATION|MB_OK "InspIRCd was successfully installed. Remember to edit your configuration file in $INSTDIR\conf!"
215 ; Section descriptions
216 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
217 !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} "Actual executable"
218 !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} "Command modules"
219 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02} "Default configuration files"
220 !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} "Optional non-SSL modules"
221 !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} "SSL modules and GnuTLS DLL libraries"
222 !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} "Regular expression module and PCRE DLL library"
223 !insertmacro MUI_FUNCTION_DESCRIPTION_END
226 Function un.onUninstSuccess
228 MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
232 SectionSetFlags ${SEC01} 17
233 SectionSetFlags ${SEC03} 17
234 StrCpy $INSTDIR "$PROGRAMFILES\InspIRCd"
238 MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
243 Delete "$INSTDIR\${PRODUCT_NAME}.url"
244 Delete "$INSTDIR\uninst.exe"
245 Delete "$INSTDIR\modules\m_*.so"
246 Delete "$INSTDIR\lib\cmd_*.so"
247 Delete "$INSTDIR\conf\inspircd.quotes.example"
248 Delete "$INSTDIR\conf\inspircd.rules.example"
249 Delete "$INSTDIR\conf\inspircd.censor.example"
250 Delete "$INSTDIR\conf\inspircd.conf.example"
251 Delete "$INSTDIR\conf\inspircd.filter.example"
252 Delete "$INSTDIR\conf\inspircd.helpop.example"
253 Delete "$INSTDIR\conf\inspircd.helpop-full.example"
254 Delete "$INSTDIR\conf\inspircd.motd.example"
255 Delete "$INSTDIR\bin\inspircd.exe"
256 Delete "$INSTDIR\bin\*.dll"
257 Delete "$INSTDIR\InspGUI.exe"
258 Delete "$SMPROGRAMS\InspIRCd\Uninstall.lnk"
259 Delete "$SMPROGRAMS\InspIRCd\InspIRCd Website.lnk"
260 Delete "$SMPROGRAMS\InspIRCd\InspIRCd.lnk"
262 RMDir "$SMPROGRAMS\InspIRCd"
263 RMDir "$INSTDIR\modules"
265 RMDir "$INSTDIR\conf"
269 DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
270 DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"