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\*.so"
\r
168 Section -AdditionalIcons
\r
169 SetOutPath $INSTDIR
\r
170 WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
\r
171 CreateShortCut "$SMPROGRAMS\InspIRCd\InspIRCd Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url"
\r
172 CreateShortCut "$SMPROGRAMS\InspIRCd\Uninstall.lnk" "$INSTDIR\uninst.exe"
\r
176 WriteUninstaller "$INSTDIR\uninst.exe"
\r
177 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\bin\inspircd.exe"
\r
178 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
\r
179 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
\r
180 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\bin\inspircd.exe"
\r
181 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
\r
182 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
\r
183 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
\r
184 MessageBox MB_ICONINFORMATION|MB_OK "InspIRCd was successfully installed. Remember to edit your configuration file in $INSTDIR\conf!"
\r
187 ; Section descriptions
\r
188 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
\r
189 !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} "Actual Executable"
\r
190 !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} "Command Modules"
\r
191 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02} "Default Config Files"
\r
192 !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} "Optional Modules"
\r
193 !insertmacro MUI_FUNCTION_DESCRIPTION_END
\r
196 Function un.onUninstSuccess
\r
198 MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
\r
202 SectionSetFlags ${SEC01} 17
\r
203 SectionSetFlags ${SEC03} 17
\r
204 StrCpy $INSTDIR "$PROGRAMFILES\InspIRCd"
\r
208 MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
\r
213 Delete "$INSTDIR\${PRODUCT_NAME}.url"
\r
214 Delete "$INSTDIR\uninst.exe"
\r
215 Delete "$INSTDIR\modules\m_*.so"
\r
216 Delete "$INSTDIR\lib\cmd_*.so"
\r
217 Delete "$INSTDIR\conf\inspircd.quotes.example"
\r
218 Delete "$INSTDIR\conf\inspircd.rules.example"
\r
219 Delete "$INSTDIR\conf\inspircd.censor.example"
\r
220 Delete "$INSTDIR\conf\inspircd.conf.example"
\r
221 Delete "$INSTDIR\conf\inspircd.filter.example"
\r
222 Delete "$INSTDIR\conf\inspircd.helpop.example"
\r
223 Delete "$INSTDIR\conf\inspircd.helpop-full.example"
\r
224 Delete "$INSTDIR\conf\inspircd.motd.example"
\r
225 Delete "$INSTDIR\bin\inspircd.exe"
\r
226 Delete "$INSTDIR\InspGUI.exe"
\r
228 Delete "$SMPROGRAMS\InspIRCd\Uninstall.lnk"
\r
229 Delete "$SMPROGRAMS\InspIRCd\InspIRCd Website.lnk"
\r
230 Delete "$SMPROGRAMS\InspIRCd\InspIRCd.lnk"
\r
232 RMDir "$SMPROGRAMS\InspIRCd"
\r
233 RMDir "$INSTDIR\modules"
\r
234 RMDir "$INSTDIR\lib"
\r
235 RMDir "$INSTDIR\conf"
\r
236 RMDir "$INSTDIR\bin"
\r
239 DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
\r
240 DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
\r