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