1 ; * +------------------------------------+
2 ; * | Inspire Internet Relay Chat Daemon |
3 ; * +------------------------------------+
5 ; * InspIRCd: (C) 2002-2011 InspIRCd Development Team
6 ; * See: http://wiki.inspircd.org/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 "2.0"
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
55 !insertmacro MUI_UNPAGE_INSTFILES
58 !insertmacro MUI_LANGUAGE "English"
61 !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
65 Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
66 OutFile "${PRODUCT_NAME}-${PRODUCT_VERSION}-Setup.exe"
67 InstallDir "$PROGRAMFILES\InspIRCd"
68 InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
70 ShowUnInstDetails show
72 Function IsDotNetInstalled
75 StrCpy $1 "SOFTWARE\Microsoft\.NETFramework" ;registry entry to look in.
79 ;Enumerate the versions installed.
80 EnumRegKey $3 HKLM "$1\policy" $2
82 ;If we don't find any versions installed, it's not here.
83 StrCmp $3 "" noDotNet notEmpty
87 ;Find out if the RegKey starts with 'v'.
88 ;If it doesn't, goto the next key.
90 StrCmp $4 "v" +1 goNext
93 ;It starts with 'v'. Now check to see how the installed major version
94 ;relates to our required major version.
95 ;If it's equal check the minor version, if it's greater,
96 ;we found a good RegKey.
97 IntCmp $4 ${DOT_MAJOR} +1 goNext yesDotNetReg
98 ;Check the minor version. If it's equal or greater to our requested
99 ;version then we're good.
101 IntCmp $4 ${DOT_MINOR} yesDotNetReg goNext yesDotNetReg
104 ;Go to the next RegKey.
109 ;Now that we've found a good RegKey, let's make sure it's actually
110 ;installed by getting the install path and checking to see if the
111 ;mscorlib.dll exists.
112 EnumRegValue $2 HKLM "$1\policy\$3" 0
113 ;$2 should equal whatever comes after the major and minor versions
115 StrCmp $2 "" noDotNet
116 ReadRegStr $4 HKLM $1 "InstallRoot"
117 ;Hopefully the install root isn't empty.
118 StrCmp $4 "" noDotNet
119 ;build the actuall directory path to mscorlib.dll.
120 StrCpy $4 "$4$3.$2\mscorlib.dll"
121 IfFileExists $4 yesDotNet noDotNet
124 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."
127 ;Everything checks out. Go on with the rest of the installation.
131 Section "Binary Executable" SEC01
132 Call IsDotNetInstalled
133 CreateDirectory "$SMPROGRAMS\InspIRCd"
134 CreateDirectory "$INSTDIR\logs"
135 CreateDirectory "$INSTDIR\data"
136 CreateShortCut "$SMPROGRAMS\InspIRCd\InspIRCd.lnk" "$INSTDIR\inspircd.exe"
137 SetOutPath "$INSTDIR"
139 File "..\bin\${BUILD}\inspircd.exe"
140 DetailPrint "Installing InspIRCd service..."
141 nsExec::Exec /TIMEOUT=30000 '"$INSTDIR\inspircd.exe" --installservice'
144 Section "Config Files" SEC02
145 SetOutPath "$INSTDIR\conf"
146 File "..\docs\*.example"
149 Section "Command Handlers" SEC03
150 SetOutPath "$INSTDIR\modules"
151 File "..\bin\${BUILD}\modules\cmd_*.so"
154 Section "Modules" SEC04
155 SetOutPath "$INSTDIR\modules"
156 File "..\bin\${BUILD}\modules\m_*.so"
159 Section -AdditionalIcons
161 WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
162 CreateShortCut "$SMPROGRAMS\InspIRCd\InspIRCd Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url"
163 CreateShortCut "$SMPROGRAMS\InspIRCd\Uninstall.lnk" "$INSTDIR\uninst.exe"
167 WriteUninstaller "$INSTDIR\uninst.exe"
168 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\inspircd.exe"
169 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
170 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
171 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\inspircd.exe"
172 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
173 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
174 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
175 MessageBox MB_ICONINFORMATION|MB_OK "InspIRCd was successfully installed. Remember to edit your configuration file in $INSTDIR\conf!"
178 ; Section descriptions
179 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
180 !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} "Actual executable"
181 !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} "Command modules"
182 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02} "Default configuration files"
183 !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} "Optional non-SSL modules"
184 !insertmacro MUI_FUNCTION_DESCRIPTION_END
187 Function un.onUninstSuccess
189 MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
193 SectionSetFlags ${SEC01} 17
194 SectionSetFlags ${SEC03} 17
195 StrCpy $INSTDIR "$PROGRAMFILES\InspIRCd"
199 MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
204 DetailPrint "Uninstalling InspIRCd service..."
205 nsExec::Exec /TIMEOUT=30000 '"$INSTDIR\inspircd.exe" --removeservice'
206 Delete "$INSTDIR\${PRODUCT_NAME}.url"
207 Delete "$INSTDIR\uninst.exe"
208 Delete "$INSTDIR\modules\*.so"
209 Delete "$INSTDIR\conf\*.example"
210 Delete "$INSTDIR\*.log"
211 Delete "$INSTDIR\logs\*"
212 Delete "$INSTDIR\data\*"
213 Delete "$INSTDIR\inspircd.exe"
214 Delete "$SMPROGRAMS\InspIRCd\Uninstall.lnk"
215 Delete "$SMPROGRAMS\InspIRCd\InspIRCd Website.lnk"
216 Delete "$SMPROGRAMS\InspIRCd\InspIRCd.lnk"
218 RMDir "$SMPROGRAMS\InspIRCd"
219 RMDir "$INSTDIR\modules"
220 RMDir "$INSTDIR\conf"
221 RMDir "$INSTDIR\logs"
222 RMDir "$INSTDIR\data"
225 DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
226 DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"